@nexia/sdk 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/app-availability.d.ts +18 -0
- package/dist/app-availability.js +29 -0
- package/dist/approval.d.ts +180 -0
- package/dist/approval.js +9 -0
- package/dist/context.d.ts +49 -0
- package/dist/context.js +1 -0
- package/dist/data-migration.d.ts +123 -0
- package/dist/data-migration.js +70 -0
- package/dist/fixtures/approval-contract-negative.d.ts +1 -0
- package/dist/fixtures/approval-contract-negative.js +8 -0
- package/dist/handoff-result.d.ts +6 -0
- package/dist/handoff-result.js +17 -0
- package/dist/host.d.ts +602 -0
- package/dist/host.js +803 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +21 -0
- package/dist/number.d.ts +2 -0
- package/dist/number.js +9 -0
- package/dist/organization-target.d.ts +101 -0
- package/dist/organization-target.js +105 -0
- package/dist/permissions.d.ts +3 -0
- package/dist/permissions.js +12 -0
- package/dist/platform.d.ts +378 -0
- package/dist/platform.js +114 -0
- package/dist/process.d.ts +98 -0
- package/dist/process.js +10 -0
- package/dist/resource-composition.d.ts +104 -0
- package/dist/resource-composition.js +576 -0
- package/dist/resource-create-destination.d.ts +17 -0
- package/dist/resource-create-destination.js +1 -0
- package/dist/resource-reference.d.ts +122 -0
- package/dist/resource-reference.js +203 -0
- package/dist/resources/resource-information.d.ts +128 -0
- package/dist/resources/resource-information.js +12 -0
- package/dist/resources/resource-list.d.ts +23 -0
- package/dist/resources/resource-list.js +1 -0
- package/dist/resources/resource-projections.d.ts +311 -0
- package/dist/resources/resource-projections.js +1 -0
- package/dist/resources/resource-transfer.d.ts +208 -0
- package/dist/resources/resource-transfer.js +1 -0
- package/dist/shell.d.ts +1297 -0
- package/dist/shell.js +1 -0
- package/dist/signature.d.ts +489 -0
- package/dist/signature.js +171 -0
- package/dist/spreadsheet.d.ts +42 -0
- package/dist/spreadsheet.js +15 -0
- package/dist/testing.d.ts +16 -0
- package/dist/testing.js +17 -0
- package/package.json +53 -0
package/dist/shell.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
export type SignatureCapabilityKind = "invitation_channel" | "authentication_method" | "routing_mode";
|
|
2
|
+
export type SignatureCapabilityStatus = "operational" | "unavailable";
|
|
3
|
+
export type SignatureCapabilityUnavailableReason = "sms_transport_unconfigured" | "local_delivery_unavailable" | "local_authentication_unavailable" | "routing_mode_unavailable";
|
|
4
|
+
export type SignatureInvitationChannel = "email" | "sms";
|
|
5
|
+
export type SignatureAuthenticationMethod = "request_password" | "email_otp" | "sms_otp";
|
|
6
|
+
export type SignatureRoutingMode = "parallel" | "sequential";
|
|
7
|
+
/** Closed v1 wire vocabulary mirrored by the PHP document-data contracts. */
|
|
8
|
+
export declare const SIGNATURE_DOCUMENT_DATA_FIELD_TYPES: readonly ["string", "text", "date", "datetime", "boolean", "integer", "decimal", "money", "resource_ref", "object", "list"];
|
|
9
|
+
export type SignatureDocumentDataFieldType = (typeof SIGNATURE_DOCUMENT_DATA_FIELD_TYPES)[number];
|
|
10
|
+
export declare const SIGNATURE_DOCUMENT_DATA_CLASSIFICATIONS: readonly ["public", "internal", "confidential", "restricted"];
|
|
11
|
+
export type SignatureDocumentDataClassification = (typeof SIGNATURE_DOCUMENT_DATA_CLASSIFICATIONS)[number];
|
|
12
|
+
export declare const SIGNATURE_DOCUMENT_DATA_FORMATTERS: readonly ["plain", "date_iso", "date_local", "datetime_local", "boolean_yes_no", "integer", "decimal", "money_with_currency", "resource_label"];
|
|
13
|
+
export type SignatureDocumentDataFormatter = (typeof SIGNATURE_DOCUMENT_DATA_FORMATTERS)[number];
|
|
14
|
+
/** Optional temporal component rendered while the complete source value remains frozen. */
|
|
15
|
+
export type SignatureTemporalDisplayPart = "date" | "time" | "year" | "month" | "day";
|
|
16
|
+
export declare const SIGNATURE_DOCUMENT_DATA_LOOKUP_MODES: readonly ["direct_subject", "derived_ref", "explicit_source_ref", "owner_scoped_query"];
|
|
17
|
+
export type SignatureDocumentDataLookupMode = (typeof SIGNATURE_DOCUMENT_DATA_LOOKUP_MODES)[number];
|
|
18
|
+
export declare const SIGNATURE_DOCUMENT_DATA_STATUSES: readonly ["resolved", "selection_required", "missing", "stale", "unavailable"];
|
|
19
|
+
/** Non-probing public state; internal provider diagnostics are not UI wire data. */
|
|
20
|
+
export type SignatureDocumentDataStatus = (typeof SIGNATURE_DOCUMENT_DATA_STATUSES)[number];
|
|
21
|
+
export type SignatureDocumentDataCardinality = "one" | "many";
|
|
22
|
+
/** Canonical public cross-App reference; it never contains protected values. */
|
|
23
|
+
export interface SignatureDocumentDataResourceRef {
|
|
24
|
+
app_key: string;
|
|
25
|
+
resource_key: string;
|
|
26
|
+
resource_id: string;
|
|
27
|
+
display: string;
|
|
28
|
+
href?: string | null;
|
|
29
|
+
}
|
|
30
|
+
export interface SignatureDocumentDataContractDescriptor {
|
|
31
|
+
data_contract_key: string;
|
|
32
|
+
data_contract_version: number;
|
|
33
|
+
field_keys: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
/** Recursive bounded object/list schema supplied as catalog metadata only. */
|
|
36
|
+
export interface SignatureDocumentDataFieldDescriptor {
|
|
37
|
+
key: string;
|
|
38
|
+
type: SignatureDocumentDataFieldType;
|
|
39
|
+
required: boolean;
|
|
40
|
+
classification: SignatureDocumentDataClassification;
|
|
41
|
+
formatters: readonly SignatureDocumentDataFormatter[];
|
|
42
|
+
label_key: string;
|
|
43
|
+
schema?: readonly SignatureDocumentDataFieldDescriptor[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* App-published catalog metadata. `synthetic_sample` is synthetic authoring
|
|
47
|
+
* data and must never be substituted with an actual record response.
|
|
48
|
+
*/
|
|
49
|
+
export interface SignatureDocumentDataSourceDescriptor {
|
|
50
|
+
app_key: string;
|
|
51
|
+
source_key: string;
|
|
52
|
+
source_version: number;
|
|
53
|
+
/** Optional legacy bridge; new sources should identify their owning Resource. */
|
|
54
|
+
resource_key?: string;
|
|
55
|
+
supported_subject_resource_keys: readonly string[];
|
|
56
|
+
cardinality: SignatureDocumentDataCardinality;
|
|
57
|
+
lookup_mode: SignatureDocumentDataLookupMode;
|
|
58
|
+
provided_data_contracts: readonly SignatureDocumentDataContractDescriptor[];
|
|
59
|
+
fields: readonly SignatureDocumentDataFieldDescriptor[];
|
|
60
|
+
synthetic_sample: Record<string, unknown>;
|
|
61
|
+
label_key: string;
|
|
62
|
+
description_key: string;
|
|
63
|
+
stable_sort_key?: string;
|
|
64
|
+
default_source_ref_anchor?: string;
|
|
65
|
+
}
|
|
66
|
+
/** Host-enriched authoring entry with App and Resource display metadata. */
|
|
67
|
+
export interface SignatureDocumentDataSourceCatalogEntry extends SignatureDocumentDataSourceDescriptor {
|
|
68
|
+
/** Host-normalized model identity; legacy sources fall back to source_key. */
|
|
69
|
+
resource_key: string;
|
|
70
|
+
/** App overview label key; legacy or incomplete manifests fall back to display metadata. */
|
|
71
|
+
app_name: string;
|
|
72
|
+
resource_label_key: string;
|
|
73
|
+
}
|
|
74
|
+
export interface SignatureDocumentDataSourceCatalog {
|
|
75
|
+
data: readonly SignatureDocumentDataSourceCatalogEntry[];
|
|
76
|
+
}
|
|
77
|
+
export interface SignatureDocumentDataFieldMapping {
|
|
78
|
+
source_field: string;
|
|
79
|
+
request_input_key: string;
|
|
80
|
+
item_selector?: string | null;
|
|
81
|
+
formatter?: SignatureDocumentDataFormatter | null;
|
|
82
|
+
date_part?: SignatureTemporalDisplayPart;
|
|
83
|
+
}
|
|
84
|
+
interface SignatureDocumentDataBindingCommon {
|
|
85
|
+
alias: string;
|
|
86
|
+
subject_anchor: string;
|
|
87
|
+
source_ref_anchor?: string | null;
|
|
88
|
+
required: boolean;
|
|
89
|
+
cardinality: SignatureDocumentDataCardinality;
|
|
90
|
+
min_items: number;
|
|
91
|
+
max_items: number;
|
|
92
|
+
field_mappings: readonly SignatureDocumentDataFieldMapping[];
|
|
93
|
+
}
|
|
94
|
+
/** A template binding that names one exact App-published source identity. */
|
|
95
|
+
export interface SignatureDocumentDataFixedSourceBinding extends SignatureDocumentDataBindingCommon {
|
|
96
|
+
selection_mode: "fixed_source";
|
|
97
|
+
app_key: string;
|
|
98
|
+
source_key: string;
|
|
99
|
+
source_version: number;
|
|
100
|
+
}
|
|
101
|
+
/** A template binding that accepts one operational source for a semantic contract. */
|
|
102
|
+
export interface SignatureDocumentDataCompatibleSourceBinding extends SignatureDocumentDataBindingCommon {
|
|
103
|
+
selection_mode: "compatible_one";
|
|
104
|
+
data_contract_key: string;
|
|
105
|
+
data_contract_version: number;
|
|
106
|
+
}
|
|
107
|
+
export type SignatureDocumentDataBinding = SignatureDocumentDataFixedSourceBinding | SignatureDocumentDataCompatibleSourceBinding;
|
|
108
|
+
/** Safe candidate projection for an explicit source selection UI. */
|
|
109
|
+
export interface SignatureDocumentDataCandidate {
|
|
110
|
+
resource_ref: SignatureDocumentDataResourceRef;
|
|
111
|
+
source_revision: string | null;
|
|
112
|
+
content_hash: string | null;
|
|
113
|
+
effective_at: string | null;
|
|
114
|
+
}
|
|
115
|
+
/** No resolved protected values are part of this UI state contract. */
|
|
116
|
+
export interface SignatureDocumentDataSourceResolution {
|
|
117
|
+
alias: string;
|
|
118
|
+
status: SignatureDocumentDataStatus;
|
|
119
|
+
candidates: readonly SignatureDocumentDataCandidate[];
|
|
120
|
+
selected_resource_refs: readonly SignatureDocumentDataResourceRef[];
|
|
121
|
+
resolved_at: string | null;
|
|
122
|
+
}
|
|
123
|
+
export interface SignatureInvitationCapability {
|
|
124
|
+
kind: "invitation_channel";
|
|
125
|
+
key: SignatureInvitationChannel;
|
|
126
|
+
status: SignatureCapabilityStatus;
|
|
127
|
+
reason_code: SignatureCapabilityUnavailableReason | null;
|
|
128
|
+
label_key: string;
|
|
129
|
+
description_key: string;
|
|
130
|
+
}
|
|
131
|
+
export interface SignatureAuthenticationCapability {
|
|
132
|
+
kind: "authentication_method";
|
|
133
|
+
key: SignatureAuthenticationMethod;
|
|
134
|
+
status: SignatureCapabilityStatus;
|
|
135
|
+
reason_code: SignatureCapabilityUnavailableReason | null;
|
|
136
|
+
label_key: string;
|
|
137
|
+
description_key: string;
|
|
138
|
+
}
|
|
139
|
+
export interface SignatureRoutingCapability {
|
|
140
|
+
kind: "routing_mode";
|
|
141
|
+
key: SignatureRoutingMode;
|
|
142
|
+
status: SignatureCapabilityStatus;
|
|
143
|
+
reason_code: SignatureCapabilityUnavailableReason | null;
|
|
144
|
+
label_key: string;
|
|
145
|
+
description_key: string;
|
|
146
|
+
}
|
|
147
|
+
export type SignatureCapability = SignatureInvitationCapability | SignatureAuthenticationCapability | SignatureRoutingCapability;
|
|
148
|
+
export interface SignatureCapabilityCatalog {
|
|
149
|
+
data: readonly SignatureCapability[];
|
|
150
|
+
}
|
|
151
|
+
export interface SignatureInvitationChannelSelectorProps {
|
|
152
|
+
catalog: SignatureCapabilityCatalog | null | undefined;
|
|
153
|
+
invitationChannel: SignatureInvitationChannel;
|
|
154
|
+
onChange: (channel: SignatureInvitationChannel) => void;
|
|
155
|
+
disabled?: boolean;
|
|
156
|
+
allowedChannels?: readonly SignatureInvitationChannel[];
|
|
157
|
+
testIdPrefix?: string;
|
|
158
|
+
}
|
|
159
|
+
export interface SignatureAuthenticationMethodSelectorProps {
|
|
160
|
+
catalog: SignatureCapabilityCatalog | null | undefined;
|
|
161
|
+
authenticationMethods: readonly SignatureAuthenticationMethod[];
|
|
162
|
+
onChange: (methods: SignatureAuthenticationMethod[]) => void;
|
|
163
|
+
disabled?: boolean;
|
|
164
|
+
allowedMethods?: readonly SignatureAuthenticationMethod[];
|
|
165
|
+
mandatoryMethods?: readonly SignatureAuthenticationMethod[];
|
|
166
|
+
testIdPrefix?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Request-local inputs are frozen from a published template policy. App
|
|
170
|
+
* packages can render the host editor, but cannot change the template policy
|
|
171
|
+
* through this surface.
|
|
172
|
+
*/
|
|
173
|
+
export type SignatureRequestPreparationInputKind = "text" | "textarea" | "date" | "select" | "checkbox";
|
|
174
|
+
export type SignatureRequestPreparationInputValueAuthority = "coordinator" | "owner_supplied" | "data_source";
|
|
175
|
+
export interface SignatureRequestPreparationRect {
|
|
176
|
+
page: number;
|
|
177
|
+
x: number;
|
|
178
|
+
y: number;
|
|
179
|
+
width: number;
|
|
180
|
+
height: number;
|
|
181
|
+
}
|
|
182
|
+
export interface SignatureRequestPreparationInputDefinition {
|
|
183
|
+
key: string;
|
|
184
|
+
label: string;
|
|
185
|
+
kind: SignatureRequestPreparationInputKind;
|
|
186
|
+
required: boolean;
|
|
187
|
+
default_value: string | boolean | null;
|
|
188
|
+
constraints: {
|
|
189
|
+
max_length: number;
|
|
190
|
+
} | {
|
|
191
|
+
min: string | null;
|
|
192
|
+
max: string | null;
|
|
193
|
+
} | {
|
|
194
|
+
options: string[];
|
|
195
|
+
} | Record<string, never>;
|
|
196
|
+
mapping: {
|
|
197
|
+
mode: "inline";
|
|
198
|
+
} | {
|
|
199
|
+
mode: "overlay";
|
|
200
|
+
rect: SignatureRequestPreparationRect;
|
|
201
|
+
};
|
|
202
|
+
value_authority: SignatureRequestPreparationInputValueAuthority;
|
|
203
|
+
/** Authoring-only signer-area grouping; this grants no source authority. */
|
|
204
|
+
signatory_role_key?: string;
|
|
205
|
+
participant_slot?: number;
|
|
206
|
+
/** Present only when the published policy gives this input to a data source. */
|
|
207
|
+
source_mapping?: {
|
|
208
|
+
source_alias: string;
|
|
209
|
+
source_field: string;
|
|
210
|
+
formatter: SignatureDocumentDataFormatter;
|
|
211
|
+
item_selector: "single" | "all";
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
export interface SignatureRequestPreparationEditPolicy {
|
|
215
|
+
enabled: boolean;
|
|
216
|
+
allow_additional_text: boolean;
|
|
217
|
+
additional_text_limit: {
|
|
218
|
+
max_count: number;
|
|
219
|
+
max_length: number;
|
|
220
|
+
} | null;
|
|
221
|
+
input_definitions: SignatureRequestPreparationInputDefinition[];
|
|
222
|
+
}
|
|
223
|
+
export type SignatureRequestPreparationStatus = "draft" | "rendering" | "ready" | "submitted" | "superseded" | "cancelled";
|
|
224
|
+
export type SignatureRequestPreparationRenderStatus = "queued" | "rendering" | "failed" | "ready";
|
|
225
|
+
export interface SignatureRequestPreparationTextElement {
|
|
226
|
+
key: string;
|
|
227
|
+
text: string;
|
|
228
|
+
rect: SignatureRequestPreparationRect;
|
|
229
|
+
}
|
|
230
|
+
/** A packaged, reviewed image which may be placed on one request document. */
|
|
231
|
+
export interface SignatureRequestPreparationPlacementImageAsset {
|
|
232
|
+
id: string;
|
|
233
|
+
label: string;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* A request-local signer form control. `signatory_role_key` and
|
|
237
|
+
* `participant_slot` identify the immutable signer assignment; an App never
|
|
238
|
+
* provides a person identifier through this document surface.
|
|
239
|
+
*/
|
|
240
|
+
export type SignatureRequestPreparationPlacementFormKind = "text" | "checkbox" | "date" | "select" | "signer_name" | "signature" | "signed_at";
|
|
241
|
+
export interface SignatureRequestPreparationPlacementStaticTextElement {
|
|
242
|
+
key: string;
|
|
243
|
+
type: "static_text";
|
|
244
|
+
rect: SignatureRequestPreparationRect;
|
|
245
|
+
text: string;
|
|
246
|
+
font_size?: number;
|
|
247
|
+
alignment?: "left" | "center" | "right";
|
|
248
|
+
color?: string;
|
|
249
|
+
}
|
|
250
|
+
export interface SignatureRequestPreparationPlacementStaticCheckboxElement {
|
|
251
|
+
key: string;
|
|
252
|
+
type: "static_checkbox";
|
|
253
|
+
rect: SignatureRequestPreparationRect;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* A request-local placement of one descriptor-owned field. Existing template
|
|
257
|
+
* bindings remain immutable; a catalog source added for this request carries
|
|
258
|
+
* its validated fixed-source identity in `source_binding`. The value itself
|
|
259
|
+
* never crosses the frontend placement contract.
|
|
260
|
+
*/
|
|
261
|
+
export interface SignatureRequestPreparationPlacementDataSourceElement {
|
|
262
|
+
key: string;
|
|
263
|
+
type: "data_source";
|
|
264
|
+
rect: SignatureRequestPreparationRect;
|
|
265
|
+
/** Signer card from which this request-local information field was added. */
|
|
266
|
+
signatory_role_key?: string;
|
|
267
|
+
participant_slot?: number;
|
|
268
|
+
source_alias: string;
|
|
269
|
+
source_field: string;
|
|
270
|
+
formatter: SignatureDocumentDataFormatter;
|
|
271
|
+
item_selector: "single" | "all";
|
|
272
|
+
/** Supported for SDK date and datetime fields; absence renders the complete value. */
|
|
273
|
+
date_part?: SignatureTemporalDisplayPart;
|
|
274
|
+
/** Present when this request adds a catalog source not pre-bound by the template. */
|
|
275
|
+
source_binding?: {
|
|
276
|
+
selection_mode: "fixed_source";
|
|
277
|
+
app_key: string;
|
|
278
|
+
source_key: string;
|
|
279
|
+
source_version: number;
|
|
280
|
+
subject_anchor: string;
|
|
281
|
+
source_ref_anchor: string | null;
|
|
282
|
+
required: boolean;
|
|
283
|
+
cardinality: SignatureDocumentDataCardinality;
|
|
284
|
+
min_items: number;
|
|
285
|
+
max_items: number;
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
export interface SignatureRequestPreparationPlacementImageElement {
|
|
289
|
+
key: string;
|
|
290
|
+
type: "image";
|
|
291
|
+
rect: SignatureRequestPreparationRect;
|
|
292
|
+
/** Only an approved asset identity is persisted, never image bytes or a URL. */
|
|
293
|
+
asset_id: string;
|
|
294
|
+
}
|
|
295
|
+
export interface SignatureRequestPreparationPlacementFormElement {
|
|
296
|
+
key: string;
|
|
297
|
+
type: SignatureRequestPreparationPlacementFormKind;
|
|
298
|
+
rect: SignatureRequestPreparationRect;
|
|
299
|
+
signatory_role_key: string;
|
|
300
|
+
participant_slot: number;
|
|
301
|
+
required?: boolean;
|
|
302
|
+
label?: string | null;
|
|
303
|
+
input_guide?: string | null;
|
|
304
|
+
default_value?: string | boolean | null;
|
|
305
|
+
/** Present only when `type` is `select`. */
|
|
306
|
+
options?: string[];
|
|
307
|
+
/** Supported for date and signed_at fields; absence renders the complete value. */
|
|
308
|
+
date_part?: SignatureTemporalDisplayPart;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* The canonical `request_document_elements` transport. It is distinct from a
|
|
312
|
+
* template's document elements: these records live for one prepared request.
|
|
313
|
+
*/
|
|
314
|
+
export type SignatureRequestPreparationPlacementElement = SignatureRequestPreparationPlacementStaticTextElement | SignatureRequestPreparationPlacementStaticCheckboxElement | SignatureRequestPreparationPlacementDataSourceElement | SignatureRequestPreparationPlacementImageElement | SignatureRequestPreparationPlacementFormElement;
|
|
315
|
+
export interface SignatureRequestPreparationPlacementParticipant {
|
|
316
|
+
signatory_role_key: string;
|
|
317
|
+
participant_slot: number;
|
|
318
|
+
label: string;
|
|
319
|
+
}
|
|
320
|
+
export interface SignatureRequestPreparationDocument {
|
|
321
|
+
public_id: string;
|
|
322
|
+
revision: number;
|
|
323
|
+
checksum: string;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Safe projection consumed by the request-local editor. It deliberately
|
|
327
|
+
* excludes template source, routing configuration, and App domain fields.
|
|
328
|
+
*/
|
|
329
|
+
export interface SignatureRequestPreparationEditorPreparation {
|
|
330
|
+
public_id: string;
|
|
331
|
+
status: SignatureRequestPreparationStatus;
|
|
332
|
+
preparation_revision: number;
|
|
333
|
+
/** Legacy template snapshot; request-time placement no longer depends on it. */
|
|
334
|
+
request_edit_policy: SignatureRequestPreparationEditPolicy | null;
|
|
335
|
+
render_status: SignatureRequestPreparationRenderStatus | null;
|
|
336
|
+
signable_document: SignatureRequestPreparationDocument | null;
|
|
337
|
+
}
|
|
338
|
+
export interface SignatureRequestPreparationExactPreviewPreparation {
|
|
339
|
+
public_id: string;
|
|
340
|
+
status: SignatureRequestPreparationStatus;
|
|
341
|
+
signable_document: SignatureRequestPreparationDocument | null;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* App-neutral host editor for request-local content. The App owns persistence
|
|
345
|
+
* and passes the frozen preparation state back after each save or render.
|
|
346
|
+
*/
|
|
347
|
+
export interface SignatureRequestPreparationEditorProps {
|
|
348
|
+
tenantId: string | undefined;
|
|
349
|
+
preparation: SignatureRequestPreparationEditorPreparation;
|
|
350
|
+
/** Current ready document shown until the exact request render is ready. */
|
|
351
|
+
baseDocumentPublicId?: string | null;
|
|
352
|
+
/** @deprecated Request-input definitions are no longer rendered in this step. */
|
|
353
|
+
inputs: Record<string, string | boolean | null>;
|
|
354
|
+
/** @deprecated Legacy `additional_text_elements` fallback. */
|
|
355
|
+
elements: SignatureRequestPreparationTextElement[];
|
|
356
|
+
dirty: boolean;
|
|
357
|
+
saving: boolean;
|
|
358
|
+
/** Canonical request-local placement payload (`request_document_elements`). */
|
|
359
|
+
requestDocumentElements?: SignatureRequestPreparationPlacementElement[];
|
|
360
|
+
/**
|
|
361
|
+
* Frozen signer fields and data overlays inherited from the published
|
|
362
|
+
* document. They are shown read-only and are never included in
|
|
363
|
+
* `onRequestDocumentElementsChange`.
|
|
364
|
+
*/
|
|
365
|
+
inheritedDocumentElements?: readonly SignatureRequestPreparationPlacementElement[];
|
|
366
|
+
requestDocumentParticipants?: readonly SignatureRequestPreparationPlacementParticipant[];
|
|
367
|
+
requestDocumentImageAssets?: readonly SignatureRequestPreparationPlacementImageAsset[];
|
|
368
|
+
/** Value-free cards for the preparation's explicit cross-App data sources. */
|
|
369
|
+
dataSources?: readonly SignatureRequestPreparationDataSourceCard[];
|
|
370
|
+
dataSourcesLoading?: boolean;
|
|
371
|
+
dataSourcesError?: boolean;
|
|
372
|
+
onRefreshDataSources?: () => Promise<void> | void;
|
|
373
|
+
onRefreshDataSource?: (alias: string) => Promise<void> | void;
|
|
374
|
+
onSelectDataSource?: (alias: string, selectedResourceRefs: readonly SignatureDocumentDataResourceRef[]) => Promise<void> | void;
|
|
375
|
+
onInputsChange: (inputs: Record<string, string | boolean | null>) => void;
|
|
376
|
+
onElementsChange: (elements: SignatureRequestPreparationTextElement[]) => void;
|
|
377
|
+
onRequestDocumentElementsChange?: (elements: SignatureRequestPreparationPlacementElement[]) => void;
|
|
378
|
+
}
|
|
379
|
+
export type SignatureSingleRequestParticipantAssignmentSource = "binding_resolved" | "request_supplied" | "template_fixed";
|
|
380
|
+
/** One authorized identity that an App may offer for a signature role. */
|
|
381
|
+
export interface SignatureSingleRequestParticipantCandidate {
|
|
382
|
+
key: string;
|
|
383
|
+
partyPublicId?: string | null;
|
|
384
|
+
userPublicId?: string | null;
|
|
385
|
+
displayName: string;
|
|
386
|
+
invitationAddress: string | null;
|
|
387
|
+
}
|
|
388
|
+
/** App-neutral participant role consumed by Core's single-request dialog. */
|
|
389
|
+
export interface SignatureSingleRequestParticipant {
|
|
390
|
+
roleKey: string;
|
|
391
|
+
participantSlot: number;
|
|
392
|
+
label: string;
|
|
393
|
+
assignmentSource: SignatureSingleRequestParticipantAssignmentSource;
|
|
394
|
+
candidates: readonly SignatureSingleRequestParticipantCandidate[];
|
|
395
|
+
initialCandidateKey?: string | null;
|
|
396
|
+
candidateLabel?: string;
|
|
397
|
+
invitationAddressLabel?: string;
|
|
398
|
+
locale?: string;
|
|
399
|
+
}
|
|
400
|
+
/** Frozen coordinator input returned to the owning App for authorization. */
|
|
401
|
+
export interface SignatureSingleRequestParticipantSubmission {
|
|
402
|
+
roleKey: string;
|
|
403
|
+
participantSlot: number;
|
|
404
|
+
partyPublicId: string | null;
|
|
405
|
+
userPublicId: string | null;
|
|
406
|
+
displayName: string;
|
|
407
|
+
locale: string;
|
|
408
|
+
invitationChannel: "email";
|
|
409
|
+
invitationAddress: string;
|
|
410
|
+
requiredMethods: SignatureAuthenticationMethod[];
|
|
411
|
+
requestPassword?: string;
|
|
412
|
+
}
|
|
413
|
+
export interface SignatureSingleRequestPreparationReference {
|
|
414
|
+
publicId: string;
|
|
415
|
+
revision: number;
|
|
416
|
+
}
|
|
417
|
+
export interface SignatureSingleRequestSubmission {
|
|
418
|
+
preparation: SignatureSingleRequestPreparationReference;
|
|
419
|
+
expectedDocument: SignatureRequestPreparationDocument;
|
|
420
|
+
participants: readonly SignatureSingleRequestParticipantSubmission[];
|
|
421
|
+
expiresInDays: number;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Core-owned single-request experience for an App-owned subject. The App
|
|
425
|
+
* retains authorization and durable handoff state behind the two callbacks.
|
|
426
|
+
*/
|
|
427
|
+
export interface SignatureSingleRequestDialogProps {
|
|
428
|
+
open: boolean;
|
|
429
|
+
tenantId: string | undefined;
|
|
430
|
+
legalEntityPublicId: string | null | undefined;
|
|
431
|
+
title: string;
|
|
432
|
+
description?: string;
|
|
433
|
+
requestLabel: string;
|
|
434
|
+
/** Current ready source document; never used as a participant identity. */
|
|
435
|
+
sourceDocumentPublicId: string;
|
|
436
|
+
participants: readonly SignatureSingleRequestParticipant[];
|
|
437
|
+
participantsLoading?: boolean;
|
|
438
|
+
participantsError?: boolean;
|
|
439
|
+
defaultExpiresInDays?: number;
|
|
440
|
+
onCreatePreparation: (participants: readonly SignatureSingleRequestParticipantSubmission[]) => Promise<SignatureSingleRequestPreparationReference>;
|
|
441
|
+
onSubmit: (submission: SignatureSingleRequestSubmission) => Promise<void>;
|
|
442
|
+
onClose: () => void;
|
|
443
|
+
onDone: () => void;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Browser-safe preparation card. It intentionally has only aliases,
|
|
447
|
+
* provenance references, and status; actual document values remain protected
|
|
448
|
+
* in the preparation snapshot.
|
|
449
|
+
*/
|
|
450
|
+
export interface SignatureRequestPreparationDataSourceCard {
|
|
451
|
+
alias: string;
|
|
452
|
+
/** `unresolved` is the value-free pre-refresh UI state. */
|
|
453
|
+
status: SignatureDocumentDataStatus | "unresolved";
|
|
454
|
+
cardinality: SignatureDocumentDataCardinality | null;
|
|
455
|
+
required: boolean | null;
|
|
456
|
+
min_items: number | null;
|
|
457
|
+
max_items: number | null;
|
|
458
|
+
candidates: readonly {
|
|
459
|
+
resource_ref: SignatureDocumentDataResourceRef;
|
|
460
|
+
}[];
|
|
461
|
+
resolved_items: readonly {
|
|
462
|
+
resource_ref: SignatureDocumentDataResourceRef;
|
|
463
|
+
}[];
|
|
464
|
+
}
|
|
465
|
+
/** Placement-only workspace exposed to every App through the frontend host. */
|
|
466
|
+
export interface SignatureRequestPreparationPlacementEditorProps {
|
|
467
|
+
tenantId: string | undefined;
|
|
468
|
+
preparation: SignatureRequestPreparationEditorPreparation;
|
|
469
|
+
dirty: boolean;
|
|
470
|
+
saving: boolean;
|
|
471
|
+
elements: SignatureRequestPreparationPlacementElement[];
|
|
472
|
+
/** Read-only signer fields and data overlays inherited from the published document. */
|
|
473
|
+
inheritedElements?: readonly SignatureRequestPreparationPlacementElement[];
|
|
474
|
+
participants: readonly SignatureRequestPreparationPlacementParticipant[];
|
|
475
|
+
imageAssets?: readonly SignatureRequestPreparationPlacementImageAsset[];
|
|
476
|
+
onElementsChange: (elements: SignatureRequestPreparationPlacementElement[]) => void;
|
|
477
|
+
}
|
|
478
|
+
/** Read-only exact-PDF review for the same frozen preparation revision. */
|
|
479
|
+
export interface SignatureRequestPreparationExactPreviewProps {
|
|
480
|
+
tenantId: string | undefined;
|
|
481
|
+
preparation: SignatureRequestPreparationExactPreviewPreparation;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Reduces the host response to the complete, stable capability catalog.
|
|
485
|
+
* Malformed, widened, duplicate, or incomplete responses fail closed.
|
|
486
|
+
*/
|
|
487
|
+
export declare function projectSignatureCapabilityCatalog(value: unknown): SignatureCapabilityCatalog;
|
|
488
|
+
export declare function signatureCapabilityIdentity(kind: SignatureCapabilityKind, key: SignatureInvitationChannel | SignatureAuthenticationMethod | SignatureRoutingMode): string;
|
|
489
|
+
export {};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/** Closed v1 wire vocabulary mirrored by the PHP document-data contracts. */
|
|
2
|
+
export const SIGNATURE_DOCUMENT_DATA_FIELD_TYPES = [
|
|
3
|
+
"string",
|
|
4
|
+
"text",
|
|
5
|
+
"date",
|
|
6
|
+
"datetime",
|
|
7
|
+
"boolean",
|
|
8
|
+
"integer",
|
|
9
|
+
"decimal",
|
|
10
|
+
"money",
|
|
11
|
+
"resource_ref",
|
|
12
|
+
"object",
|
|
13
|
+
"list",
|
|
14
|
+
];
|
|
15
|
+
export const SIGNATURE_DOCUMENT_DATA_CLASSIFICATIONS = [
|
|
16
|
+
"public",
|
|
17
|
+
"internal",
|
|
18
|
+
"confidential",
|
|
19
|
+
"restricted",
|
|
20
|
+
];
|
|
21
|
+
export const SIGNATURE_DOCUMENT_DATA_FORMATTERS = [
|
|
22
|
+
"plain",
|
|
23
|
+
"date_iso",
|
|
24
|
+
"date_local",
|
|
25
|
+
"datetime_local",
|
|
26
|
+
"boolean_yes_no",
|
|
27
|
+
"integer",
|
|
28
|
+
"decimal",
|
|
29
|
+
"money_with_currency",
|
|
30
|
+
"resource_label",
|
|
31
|
+
];
|
|
32
|
+
export const SIGNATURE_DOCUMENT_DATA_LOOKUP_MODES = [
|
|
33
|
+
"direct_subject",
|
|
34
|
+
"derived_ref",
|
|
35
|
+
"explicit_source_ref",
|
|
36
|
+
"owner_scoped_query",
|
|
37
|
+
];
|
|
38
|
+
export const SIGNATURE_DOCUMENT_DATA_STATUSES = [
|
|
39
|
+
"resolved",
|
|
40
|
+
"selection_required",
|
|
41
|
+
"missing",
|
|
42
|
+
"stale",
|
|
43
|
+
"unavailable",
|
|
44
|
+
];
|
|
45
|
+
const KNOWN_SIGNATURE_CAPABILITIES = [
|
|
46
|
+
{
|
|
47
|
+
kind: "invitation_channel",
|
|
48
|
+
key: "email",
|
|
49
|
+
label_key: "signature.invitation.channel.email",
|
|
50
|
+
description_key: "signature.invitation.channel.email.description",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
kind: "invitation_channel",
|
|
54
|
+
key: "sms",
|
|
55
|
+
label_key: "signature.invitation.channel.sms",
|
|
56
|
+
description_key: "signature.invitation.channel.sms.description",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
kind: "authentication_method",
|
|
60
|
+
key: "request_password",
|
|
61
|
+
label_key: "signature.authentication.method.password",
|
|
62
|
+
description_key: "signature.authentication.method.password.description",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
kind: "authentication_method",
|
|
66
|
+
key: "email_otp",
|
|
67
|
+
label_key: "signature.authentication.method.email_otp",
|
|
68
|
+
description_key: "signature.authentication.method.email_otp.description",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
kind: "authentication_method",
|
|
72
|
+
key: "sms_otp",
|
|
73
|
+
label_key: "signature.authentication.method.sms_otp",
|
|
74
|
+
description_key: "signature.authentication.method.sms_otp.description",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
kind: "routing_mode",
|
|
78
|
+
key: "parallel",
|
|
79
|
+
label_key: "signature.template.routing_mode.parallel",
|
|
80
|
+
description_key: "signature.template.routing_mode.parallel_help",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
kind: "routing_mode",
|
|
84
|
+
key: "sequential",
|
|
85
|
+
label_key: "signature.template.routing_mode.sequential",
|
|
86
|
+
description_key: "signature.template.routing_mode.sequential_help",
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
/**
|
|
90
|
+
* Reduces the host response to the complete, stable capability catalog.
|
|
91
|
+
* Malformed, widened, duplicate, or incomplete responses fail closed.
|
|
92
|
+
*/
|
|
93
|
+
export function projectSignatureCapabilityCatalog(value) {
|
|
94
|
+
const envelope = asRecord(value);
|
|
95
|
+
const entries = envelope?.data;
|
|
96
|
+
if (!Array.isArray(entries) ||
|
|
97
|
+
entries.length !== KNOWN_SIGNATURE_CAPABILITIES.length) {
|
|
98
|
+
return unavailableSignatureCapabilityCatalog();
|
|
99
|
+
}
|
|
100
|
+
const capabilities = new Map();
|
|
101
|
+
for (const entry of entries) {
|
|
102
|
+
const capability = projectSignatureCapability(entry);
|
|
103
|
+
if (!capability)
|
|
104
|
+
return unavailableSignatureCapabilityCatalog();
|
|
105
|
+
const identity = signatureCapabilityIdentity(capability.kind, capability.key);
|
|
106
|
+
if (capabilities.has(identity)) {
|
|
107
|
+
return unavailableSignatureCapabilityCatalog();
|
|
108
|
+
}
|
|
109
|
+
capabilities.set(identity, capability);
|
|
110
|
+
}
|
|
111
|
+
const ordered = KNOWN_SIGNATURE_CAPABILITIES.map((definition) => capabilities.get(signatureCapabilityIdentity(definition.kind, definition.key)));
|
|
112
|
+
return ordered.some((capability) => capability === undefined)
|
|
113
|
+
? unavailableSignatureCapabilityCatalog()
|
|
114
|
+
: { data: ordered };
|
|
115
|
+
}
|
|
116
|
+
export function signatureCapabilityIdentity(kind, key) {
|
|
117
|
+
return `${kind}:${key}`;
|
|
118
|
+
}
|
|
119
|
+
function projectSignatureCapability(value) {
|
|
120
|
+
const entry = asRecord(value);
|
|
121
|
+
if (!entry)
|
|
122
|
+
return null;
|
|
123
|
+
if ((entry.kind !== "invitation_channel" &&
|
|
124
|
+
entry.kind !== "authentication_method" &&
|
|
125
|
+
entry.kind !== "routing_mode") ||
|
|
126
|
+
typeof entry.key !== "string" ||
|
|
127
|
+
(entry.status !== "operational" && entry.status !== "unavailable") ||
|
|
128
|
+
typeof entry.label_key !== "string" ||
|
|
129
|
+
typeof entry.description_key !== "string") {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const definition = KNOWN_SIGNATURE_CAPABILITIES.find((candidate) => candidate.kind === entry.kind && candidate.key === entry.key);
|
|
133
|
+
if (!definition ||
|
|
134
|
+
entry.label_key !== definition.label_key ||
|
|
135
|
+
entry.description_key !== definition.description_key) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
if (entry.status === "operational") {
|
|
139
|
+
return entry.reason_code === null
|
|
140
|
+
? capabilityFromDefinition(definition, entry.status, null)
|
|
141
|
+
: null;
|
|
142
|
+
}
|
|
143
|
+
const reasonCode = unavailableReasonFor(definition);
|
|
144
|
+
return entry.reason_code === reasonCode
|
|
145
|
+
? capabilityFromDefinition(definition, entry.status, reasonCode)
|
|
146
|
+
: null;
|
|
147
|
+
}
|
|
148
|
+
function unavailableSignatureCapabilityCatalog() {
|
|
149
|
+
return {
|
|
150
|
+
data: KNOWN_SIGNATURE_CAPABILITIES.map((definition) => capabilityFromDefinition(definition, "unavailable", unavailableReasonFor(definition))),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function capabilityFromDefinition(definition, status, reasonCode) {
|
|
154
|
+
return { ...definition, status, reason_code: reasonCode };
|
|
155
|
+
}
|
|
156
|
+
function unavailableReasonFor(definition) {
|
|
157
|
+
if (definition.kind === "routing_mode") {
|
|
158
|
+
return "routing_mode_unavailable";
|
|
159
|
+
}
|
|
160
|
+
if (definition.key === "sms" || definition.key === "sms_otp") {
|
|
161
|
+
return "sms_transport_unconfigured";
|
|
162
|
+
}
|
|
163
|
+
return definition.key === "request_password"
|
|
164
|
+
? "local_authentication_unavailable"
|
|
165
|
+
: "local_delivery_unavailable";
|
|
166
|
+
}
|
|
167
|
+
function asRecord(value) {
|
|
168
|
+
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
169
|
+
? value
|
|
170
|
+
: null;
|
|
171
|
+
}
|