@nexia/sdk 0.7.0 → 0.7.1
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/actions.d.ts +15 -0
- package/dist/actions.js +1 -0
- package/dist/host.d.ts +19 -8
- package/dist/host.js +39 -8
- package/dist/index.d.ts +3 -2
- package/dist/process.d.ts +1 -1
- package/dist/resource-composition.js +1 -1
- package/dist/resources/resource-information.d.ts +21 -0
- package/dist/shell.d.ts +33 -6
- package/package.json +2 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ActionPlacement = 'resource' | 'inspector' | 'report' | 'dashboard' | 'palette' | 'agent';
|
|
2
|
+
export type ActionTargets = 'none' | 'one' | 'many';
|
|
3
|
+
/** Core supplies target selection when a placement has no current records. */
|
|
4
|
+
export interface NxActionsProps {
|
|
5
|
+
placement: ActionPlacement;
|
|
6
|
+
resourceKey?: string;
|
|
7
|
+
actionKeys?: readonly string[];
|
|
8
|
+
currentTargets?: ReadonlyArray<{
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}>;
|
|
12
|
+
legalEntityPublicId?: string | null;
|
|
13
|
+
disabledKeys?: readonly string[];
|
|
14
|
+
onSuccess?: (actionKey: string, response: unknown) => void;
|
|
15
|
+
}
|
package/dist/actions.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/host.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { ApprovalBusinessFormRegistrar, ApprovalBusinessFormRegistry } from
|
|
|
5
5
|
import type { ContextQueryResult, PermissionsQueryResult } from './context';
|
|
6
6
|
import type { DataMigrationBackgroundOperationClient, DataMigrationRegistrar, DataMigrationRegistry } from './data-migration';
|
|
7
7
|
import type { ProcessUserTaskFormRegistrar, ProcessUserTaskFormRegistry } from './process';
|
|
8
|
-
import type { AppRouteFrameProps, AutoRegisterPackageSurfacesOptions, FormFieldErrors, InspectorActionProps, InspectorResourceActionsProps, MessageApi, MutationFormError, NxAdaptiveSplitProps, NxActionButtonProps, NxAlertProps, NxButtonProps, NxLinkButtonProps, NxIconButtonProps, NxIconLinkProps, NxCanonicalRoutePaneProps, NxCheckboxProps, NxColumnBrowserProps, NxColumnPickerProps, NxComboboxProps, NxDatePickerProps, NxDateRangePickerProps, NxDetailRowProps, NxEmptyViewProps, NxFieldGroupProps, NxFieldLegendProps, NxFieldsetProps, NxFileDropzoneProps, NxFormFieldProps, NxFormSectionProps, NxDropdownMenuProps, NxInsightFilterBarProps, NxInsightSurfaceProps, NxHelpTooltipProps, NxOverviewBandProps, InsightFilterControls, UseInsightFilterStateOptions, NxLoadingBlockProps, NxModalDialogProps, NxOrgChartProps, NxMissingRequiredReferencesAlertProps, NxPageFrameProps, NxPaginationProps, NxRadioGroupProps, NxRadioProps, NxRefreshControlProps, NxSearchFieldProps, NxSectionCardProps, SectionRowProps, NxSectionStackProps, NxResponsiveRegionProps, NxSelectProps, NxStatCardProps, NxStatusBadgeProps, NxSwitchProps, NxTabNavProps, NxTextAreaProps, NxTextInputProps, NxTooltipProps, OpenResourceWorkTab, ResourceCreateCompletion, ResourceCreateReceiverRegistration, ResourceInspectorAdapterRegistry, ResourceInspectorAdapterRegistrar, ResourceInspectorPanelProps, ResourceInspectorStackHostProps, ResourceInspectorStackProviderProps, ResourceInspectorStateProps, ResourceLinkProps, ResourceListParams, ResourceListParamsControls, ResourceListToolbarMoreMenuProps, ResourcePrimaryCellProps, ResourceRowActionsMenuProps, ResourceStatusBadgeProps, ResourceTableProps, ResourceTableSort, ResourceTextCellProps, UseRegisterListLocateActionOptions, UseResourceListParamsOptions, TabContextActionRegistration, RegisterDraftActionOptions, ToastOptions, WorkSectionProps, FavoriteTarget, WorkSurfaceLabelInput, WorkSurfaceLabels, WorkSurfaceProps } from './shell';
|
|
8
|
+
import type { AppRouteFrameProps, AutoRegisterPackageSurfacesOptions, FormFieldErrors, InspectorActionProps, InspectorResourceActionsProps, MessageApi, MutationFormError, NxAdaptiveSplitProps, NxActionButtonProps, NxAlertProps, NxButtonProps, NxLinkButtonProps, NxIconButtonProps, NxIconLinkProps, NxCanonicalRoutePaneProps, NxCheckboxProps, NxColumnBrowserProps, NxColumnPickerProps, NxComboboxProps, NxDatePickerProps, NxDateRangePickerProps, NxDetailRowProps, NxEmptyViewProps, NxFieldGroupProps, NxFieldLegendProps, NxFieldsetProps, NxFileDropzoneProps, NxFormFieldProps, NxFormSectionProps, NxDropdownMenuProps, NxInsightFilterBarProps, NxInsightSurfaceProps, NxHelpTooltipProps, NxOverviewBandProps, InsightFilterControls, UseInsightFilterStateOptions, NxLoadingBlockProps, NxModalDialogProps, NxOrgChartProps, NxMissingRequiredReferencesAlertProps, NxPageFrameProps, NxPaginationProps, NxRadioGroupProps, NxRadioProps, NxRefreshControlProps, NxSearchFieldProps, NxSectionCardProps, SectionRowProps, NxSectionStackProps, NxResponsiveRegionProps, NxSelectProps, NxStatCardProps, NxStatusBadgeProps, NxSwitchProps, NxTabNavProps, NxTextAreaProps, NxTextInputProps, NxTooltipProps, OpenResourceWorkTab, ResourceCreateCompletion, ResourceCreateReceiverRegistration, ResourceInspectorAdapterRegistry, ResourceInspectorAdapterRegistrar, ResourceInspectorPanelProps, ResourceInspectorQueryProps, ResourceInspectorStackHostProps, ResourceInspectorStackProviderProps, ResourceInspectorStateProps, ResourceLinkProps, ResourceListParams, ResourceListParamsControls, ResourceListToolbarMoreMenuProps, ResourcePrimaryCellProps, ResourceRowActionsMenuProps, ResourceStatusBadgeProps, ResourceTableProps, ResourceTableSort, ResourceTextCellProps, UseRegisterListLocateActionOptions, UseResourceListParamsOptions, TabContextActionRegistration, RegisterDraftActionOptions, ToastOptions, WorkSectionProps, FavoriteTarget, WorkSurfaceLabelInput, WorkSurfaceLabels, WorkSurfaceProps } from './shell';
|
|
9
9
|
import type { AgentComponentRenderer, AttachmentDeleteResult, AttachmentQueryResult, AttachmentUploadOptions, AttachmentUploadResult, ApprovalRoutePoliciesQueryResult, ApprovalSharedLinesQueryResult, DashboardWidgetAutoHeightRef, LegalEntityMemberListParams, LegalEntityMemberQueryResult, LegalEntityApplicabilityQueryResult, LegalEntityQueryResult, MediaUploadResult, OperatingUnitQueryResult, OperatingUnitQueryScope, OperatingUnitScopeFieldProps, OperatingUnitScopeResult, OperatingUnitSelectionResult, PartyListParams, PartyQueryResult, TrustedAssetListParams, TrustedAssetsQueryResult, UploadFileClient } from './platform';
|
|
10
10
|
import type { NxOrganizationTargetSelectorProps, NxOperatingUnitSelectorProps, OrganizationListScopeMode, OrganizationListScopeResult, OrganizationTargetQuery, OrganizationTargetQueryResult } from './organization-target';
|
|
11
11
|
import type { NxCalendarProps, NxResourceSchedulerProps, ResourceBoardProps, ResourceScheduleProps } from './resources/resource-projections';
|
|
@@ -145,6 +145,12 @@ export interface FavoriteButtonProps {
|
|
|
145
145
|
size?: 'xs' | 'sm' | 'md';
|
|
146
146
|
testId?: string;
|
|
147
147
|
}
|
|
148
|
+
export interface OpenFileOptions {
|
|
149
|
+
/** Resolve an App GET endpoint returning { href } before opening the file. */
|
|
150
|
+
resolveHref?: boolean;
|
|
151
|
+
/** Show the authorized file in a separate browser window instead of saving it. */
|
|
152
|
+
preview?: boolean;
|
|
153
|
+
}
|
|
148
154
|
export interface NexiaAppFrontendHostBindings {
|
|
149
155
|
api: AxiosInstance;
|
|
150
156
|
components: {
|
|
@@ -152,6 +158,7 @@ export interface NexiaAppFrontendHostBindings {
|
|
|
152
158
|
InspectorAction: typeof InspectorAction;
|
|
153
159
|
InspectorResourceActions: typeof InspectorResourceActions;
|
|
154
160
|
NxAdaptiveSplit: typeof NxAdaptiveSplit;
|
|
161
|
+
NxActions: ComponentType<NxActionsProps>;
|
|
155
162
|
NxActionButton: typeof NxActionButton;
|
|
156
163
|
NxAlert: typeof NxAlert;
|
|
157
164
|
NxButton: typeof NxButton;
|
|
@@ -223,6 +230,7 @@ export interface NexiaAppFrontendHostBindings {
|
|
|
223
230
|
OperatingUnitManagementSurface: ComponentType<OperatingUnitManagementSurfaceProps>;
|
|
224
231
|
OperatingUnitScopeField: typeof OperatingUnitScopeField;
|
|
225
232
|
ResourceInspectorPanel: typeof ResourceInspectorPanel;
|
|
233
|
+
ResourceInspectorQuery: typeof ResourceInspectorQuery;
|
|
226
234
|
ResourceInspectorStackHost: typeof ResourceInspectorStackHost;
|
|
227
235
|
ResourceInspectorStackProvider: typeof ResourceInspectorStackProvider;
|
|
228
236
|
ResourceInspectorState: typeof ResourceInspectorState;
|
|
@@ -289,6 +297,7 @@ export interface NexiaAppFrontendHostBindings {
|
|
|
289
297
|
useWorkTabLabel: (label: string | null | undefined) => void;
|
|
290
298
|
};
|
|
291
299
|
runtime: {
|
|
300
|
+
openFile: (href: string, options?: OpenFileOptions) => Promise<void>;
|
|
292
301
|
autoRegisterPackageSurfaces: (options: AutoRegisterPackageSurfacesOptions) => void;
|
|
293
302
|
firstFieldError: (errors: FormFieldErrors | undefined, field: string) => string | null;
|
|
294
303
|
keepPreviousResourceListData: <TData>(queryScope: readonly unknown[]) => (previousData: TData | undefined, previousQuery: {
|
|
@@ -315,6 +324,8 @@ export interface NexiaAppFrontendHostBindings {
|
|
|
315
324
|
* Core calls this once before installed App entries execute.
|
|
316
325
|
*/
|
|
317
326
|
export declare function configureNexiaAppFrontendHost(bindings: NexiaAppFrontendHostBindings): void;
|
|
327
|
+
/** The host retains authentication and file bytes outside an isolated App frame. */
|
|
328
|
+
export declare function openFile(href: string, options?: OpenFileOptions): Promise<void>;
|
|
318
329
|
/** Axios-compatible host client carrying the active shell CSRF configuration. */
|
|
319
330
|
export declare const api: AxiosInstance;
|
|
320
331
|
/**
|
|
@@ -359,6 +370,7 @@ export declare function NxColumnPicker(props: NxColumnPickerProps): ReactNode;
|
|
|
359
370
|
export declare function NxCombobox<TValue extends string | number>(props: NxComboboxProps<TValue>): ReactNode;
|
|
360
371
|
export declare function NxOperatingUnitSelector(props: NxOperatingUnitSelectorProps): ReactNode;
|
|
361
372
|
export declare function NxOrganizationTargetSelector(props: NxOrganizationTargetSelectorProps): ReactNode;
|
|
373
|
+
export declare function NxActions(props: NxActionsProps): ReactNode;
|
|
362
374
|
export declare function NxDatePicker(props: NxDatePickerProps): ReactNode;
|
|
363
375
|
export declare function NxDateRangePicker(props: NxDateRangePickerProps): ReactNode;
|
|
364
376
|
export declare function NxDetailRow(props: NxDetailRowProps): ReactNode;
|
|
@@ -407,6 +419,7 @@ export declare function NxTextInput(props: NxTextInputProps): ReactNode;
|
|
|
407
419
|
export declare function NxTooltip(props: NxTooltipProps): ReactNode;
|
|
408
420
|
export declare function OperatingUnitScopeField(props: OperatingUnitScopeFieldProps): ReactNode;
|
|
409
421
|
export declare function OperatingUnitManagementSurface(props: OperatingUnitManagementSurfaceProps): ReactNode;
|
|
422
|
+
export declare function ResourceInspectorQuery<T>(props: ResourceInspectorQueryProps<T>): ReactNode;
|
|
410
423
|
export declare function ResourceInspectorPanel(props: ResourceInspectorPanelProps): ReactNode;
|
|
411
424
|
export declare function ResourceInspectorStackHost(props: ResourceInspectorStackHostProps): ReactNode;
|
|
412
425
|
export declare function ResourceInspectorStackProvider(props: ResourceInspectorStackProviderProps): ReactNode;
|
|
@@ -579,14 +592,11 @@ export declare function useWorkTabLabel(label: string | null | undefined): void;
|
|
|
579
592
|
export declare function useWorkSurfaceLabels(input: WorkSurfaceLabelInput): WorkSurfaceLabels;
|
|
580
593
|
export declare function autoRegisterPackageSurfaces(options: AutoRegisterPackageSurfacesOptions): void;
|
|
581
594
|
/**
|
|
582
|
-
*
|
|
583
|
-
*
|
|
584
|
-
*
|
|
585
|
-
* each generated registration module then registers its lazy inspector loader.
|
|
586
|
-
* Keeping the convention in the SDK means an App never needs to maintain a
|
|
587
|
-
* growing list of side-effect imports in its entry point.
|
|
595
|
+
* Retains legacy eager registration modules and registers optional resource
|
|
596
|
+
* contract `resourceInspector: { type, load }` declarations. Contracts contain
|
|
597
|
+
* lightweight metadata; implementations are loaded only by the registry.
|
|
588
598
|
*/
|
|
589
|
-
export declare function autoRegisterPackageResourceInspectors(modules: Record<string, unknown>): void;
|
|
599
|
+
export declare function autoRegisterPackageResourceInspectors(modules: Record<string, unknown>, resourceContracts?: Record<string, unknown>): void;
|
|
590
600
|
export declare function firstFieldError(errors: FormFieldErrors | undefined, field: string): string | null;
|
|
591
601
|
export declare function withoutFieldError(errors: FormFieldErrors, field: string): FormFieldErrors;
|
|
592
602
|
export declare function parseMutationFormError(input: MutationFormErrorInput): MutationFormError;
|
|
@@ -610,3 +620,4 @@ export declare const resourceCreateDestinationRegistry: Pick<ResourceCreateDesti
|
|
|
610
620
|
export declare const resourceInspectorAdapterRegistry: ResourceInspectorAdapterRegistrar;
|
|
611
621
|
/** Shared spreadsheet editor; the caller owns document persistence. */
|
|
612
622
|
export declare function NxSpreadsheetEditor(props: NxSpreadsheetEditorProps): ReactNode;
|
|
623
|
+
import type { NxActionsProps } from './actions';
|
package/dist/host.js
CHANGED
|
@@ -15,6 +15,10 @@ function host() {
|
|
|
15
15
|
}
|
|
16
16
|
return activeHost;
|
|
17
17
|
}
|
|
18
|
+
/** The host retains authentication and file bytes outside an isolated App frame. */
|
|
19
|
+
export function openFile(href, options) {
|
|
20
|
+
return host().runtime.openFile(href, options);
|
|
21
|
+
}
|
|
18
22
|
const apiProxyTarget = axios.create();
|
|
19
23
|
/** Axios-compatible host client carrying the active shell CSRF configuration. */
|
|
20
24
|
export const api = new Proxy(apiProxyTarget, {
|
|
@@ -234,6 +238,9 @@ export function NxOperatingUnitSelector(props) {
|
|
|
234
238
|
export function NxOrganizationTargetSelector(props) {
|
|
235
239
|
return render(host().components.NxOrganizationTargetSelector, props);
|
|
236
240
|
}
|
|
241
|
+
export function NxActions(props) {
|
|
242
|
+
return render(host().components.NxActions, props);
|
|
243
|
+
}
|
|
237
244
|
export function NxDatePicker(props) {
|
|
238
245
|
return render(host().components.NxDatePicker, props);
|
|
239
246
|
}
|
|
@@ -370,6 +377,9 @@ export function OperatingUnitScopeField(props) {
|
|
|
370
377
|
export function OperatingUnitManagementSurface(props) {
|
|
371
378
|
return render(host().components.OperatingUnitManagementSurface, props);
|
|
372
379
|
}
|
|
380
|
+
export function ResourceInspectorQuery(props) {
|
|
381
|
+
return render((host().components.ResourceInspectorQuery), props);
|
|
382
|
+
}
|
|
373
383
|
export function ResourceInspectorPanel(props) {
|
|
374
384
|
return render(host().components.ResourceInspectorPanel, props);
|
|
375
385
|
}
|
|
@@ -727,19 +737,40 @@ export function autoRegisterPackageSurfaces(options) {
|
|
|
727
737
|
host().runtime.autoRegisterPackageSurfaces(options);
|
|
728
738
|
}
|
|
729
739
|
/**
|
|
730
|
-
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
* each generated registration module then registers its lazy inspector loader.
|
|
734
|
-
* Keeping the convention in the SDK means an App never needs to maintain a
|
|
735
|
-
* growing list of side-effect imports in its entry point.
|
|
740
|
+
* Retains legacy eager registration modules and registers optional resource
|
|
741
|
+
* contract `resourceInspector: { type, load }` declarations. Contracts contain
|
|
742
|
+
* lightweight metadata; implementations are loaded only by the registry.
|
|
736
743
|
*/
|
|
737
|
-
export function autoRegisterPackageResourceInspectors(modules) {
|
|
744
|
+
export function autoRegisterPackageResourceInspectors(modules, resourceContracts = {}) {
|
|
738
745
|
const pattern = /^\.\/resources\/[^/]+\/inspector\/register-[^/]+-inspector\.ts$/;
|
|
739
746
|
for (const path of Object.keys(modules)) {
|
|
740
|
-
if (!pattern.test(path))
|
|
747
|
+
if (!pattern.test(path))
|
|
741
748
|
throw new Error(`Invalid package inspector registration path [${path}].`);
|
|
749
|
+
}
|
|
750
|
+
const registrations = new Map();
|
|
751
|
+
for (const [path, module] of Object.entries(resourceContracts)) {
|
|
752
|
+
if (!/^\.\/resources\/[^/]+\/[a-zA-Z0-9-]+-resource-contract\.ts$/.test(path)
|
|
753
|
+
|| module === null || typeof module !== 'object') {
|
|
754
|
+
throw new Error(`Invalid Inspector resource contract [${path}].`);
|
|
755
|
+
}
|
|
756
|
+
const declaration = module.resourceInspector;
|
|
757
|
+
if (declaration === undefined)
|
|
758
|
+
continue;
|
|
759
|
+
if (declaration === null || typeof declaration !== 'object') {
|
|
760
|
+
throw new Error(`Invalid Inspector declaration [${path}].`);
|
|
742
761
|
}
|
|
762
|
+
const { type, load } = declaration;
|
|
763
|
+
if (typeof type !== 'string' || type.trim() !== type || type === '' || typeof load !== 'function'
|
|
764
|
+
|| !Object.entries(module).some(([key, value]) => key.endsWith('ResourceType') && value === type)) {
|
|
765
|
+
throw new Error(`Invalid Inspector identity or loader [${path}].`);
|
|
766
|
+
}
|
|
767
|
+
if (registrations.has(type))
|
|
768
|
+
throw new Error(`Duplicate Inspector declaration [${type}].`);
|
|
769
|
+
registrations.set(type, load);
|
|
770
|
+
}
|
|
771
|
+
// Validate the complete new declaration set before mutating the registry.
|
|
772
|
+
for (const [type, load] of registrations) {
|
|
773
|
+
host().registries.resourceInspectorAdapterRegistry.register(type, load);
|
|
743
774
|
}
|
|
744
775
|
}
|
|
745
776
|
export function firstFieldError(errors, field) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { ResourceListFilterableEntry, ResourceListSchema, } from "./resources/resource-list";
|
|
2
2
|
export { draftStringField } from './resources/draft-field';
|
|
3
3
|
export { defineResourceInformationSchema, resourceInformationValue, } from "./resources/resource-information";
|
|
4
|
-
export type { NxResourceInformationFormProps, NxResourceInformationViewProps, ResourceFormLegalEntity, ResourceFormBinding, NxResourceFormLegalEntityFieldProps, ResourceInformationControlProjection, ResourceInformationControlSlot, ResourceInformationCustomProjection, ResourceInformationEditProjection, ResourceInformationEditRenderContext, ResourceInformationField, ResourceInformationFieldSpan, ResourceInformationMode, ResourceInformationReadOnlyProjection, ResourceInformationRequirement, ResourceInformationSchema, ResourceInformationSection, ResourceInformationTranslator, ResourceInformationValue, } from "./resources/resource-information";
|
|
4
|
+
export type { NxResourceInformationFormProps, NxResourceInformationViewProps, ResourceFormLegalEntity, ResourceFormBinding, ResourceFormSaved, AppFormSaveBinding, NxResourceFormLegalEntityFieldProps, ResourceInformationControlProjection, ResourceInformationControlSlot, ResourceInformationCustomProjection, ResourceInformationEditProjection, ResourceInformationEditRenderContext, ResourceInformationField, ResourceInformationFieldSpan, ResourceInformationMode, ResourceInformationReadOnlyProjection, ResourceInformationRequirement, ResourceInformationSchema, ResourceInformationSection, ResourceInformationTranslator, ResourceInformationValue, } from "./resources/resource-information";
|
|
5
5
|
export type { DatasetImportConfirmationSummary, DatasetImportPlanChoice, DatasetImportPlanSection, ResourceImportPreview, ResourceImportPreviewRow, ResourceImportResponse, ResourceImportRun, ResourceImportRunStatus, ResourceImportSummary, ResourceTransferFormat, ResourceTransferMessage, ResourceTransferMeta, NxResourceImportDialogProps, NxResourceTransferActionsProps, NxDatasetImportWorkspaceProps, NxInlineResourceCreateProps, NxDatasetExportWorkspaceProps, } from "./resources/resource-transfer";
|
|
6
6
|
export type { NxCalendarActionBinding, NxCalendarActionCommand, NxCalendarActionResult, NxCalendarInteraction, NxCalendarOccurrence, NxCalendarProps, NxCalendarRange, NxCalendarSelection, NxCalendarTemporalRange, NxCalendarView, NxResourceSchedulerActionBinding, NxResourceSchedulerActionCommand, NxResourceSchedulerActionResult, NxResourceSchedulerInteraction, NxResourceSchedulerOccurrence, NxResourceSchedulerProps, NxResourceSchedulerResource, NxResourceSchedulerSelection, NxResourceSchedulerView, ResourceBoardCard, ResourceBoardLabels, ResourceBoardLane, ResourceBoardLoadState, ResourceBoardMoveCommand, ResourceBoardMutationResult, ResourceBoardProjection, ResourceBoardProps, ResourceBoardSummaryField, ResourceProjectionReference, ResourceScheduleActionBinding, ResourceScheduleActionCommand, ResourceScheduleDatePair, ResourceScheduleDateSemantics, ResourceScheduleDependency, ResourceScheduleDependencyType, ResourceScheduleInteraction, ResourceScheduleItem, ResourceScheduleItemType, ResourceScheduleLoadState, ResourceScheduleMutationResult, ResourceScheduleProjection, ResourceScheduleProps, ResourceScheduleTimeUnit, ResourceScheduleView, } from "./resources/resource-projections";
|
|
7
7
|
export type { ContextQueryResult, ContextResponse, LegalEntityContext, PermissionsQueryResult, PermissionsResponse, TenantContext, UserContext, WorkspaceContext, } from "./context";
|
|
@@ -36,8 +36,9 @@ export type { ApprovalActor, ApprovalBodySnapshot, ApprovalBusinessFormControlle
|
|
|
36
36
|
export { APPROVAL_STATES, APPROVAL_STEP_KINDS } from "./approval";
|
|
37
37
|
export type { BpmnEditorDocument, BpmnEditorElement, BpmnEditorNodeType, BpmnEditorProcess, DmnEditorDocument, DmnEditorHitPolicy, DmnEditorInputClause, DmnEditorOutputClause, DmnEditorRule, DmnEditorValueType, ProcessUserTaskFormController, ProcessUserTaskFormRegistrar, ProcessUserTaskFormRegistration, ProcessUserTaskFormRegistry, ProcessUserTaskFormSlotPropsV1, ProcessUserTaskFormWidgetLoader, ProcessUserTaskResourceRef, } from "./process";
|
|
38
38
|
export { DMN_EDITOR_HIT_POLICIES } from "./process";
|
|
39
|
-
export type { AppRouteFrameProps, AppRoutePrefetchContext, AppRoutePrefetcher, AutoRegisterPackageSurfacesOptions, PackageSurfaceLoader, PackageSurfaceOverride, PackageSurfaceOverrideRegistration, FormFieldErrors, InspectorActionProps, InspectorResourceActionsProps, ListLocateRecord, MessageApi, MutationFormError, NxCanonicalRoutePaneProps, NxActionKind, NxIconButtonProps, NxComboboxOption, NxComboboxProps, NxRefreshControlProps, NxColumnBrowserLabels, NxColumnBrowserProps, NxColumnNode, NxColumnPickerLabels, NxColumnPickerProps, NxDatePickerLabels, NxDatePickerProps, NxDateRangePickerProps, NxDateRangeValue, NxDropdownMenuItem, NxHelpTooltipProps, InsightFilterControls, InsightFilterState, InsightQueryLike, InsightRangePreset, UseInsightFilterStateOptions, NxOverviewBandCard, NxSelectOption, NxStatDelta, NxStatDeltaDirection, NxStatDeltaTone, NxTabNavItem, NxTabNavProps, NxTooltipAlign, NxTooltipProps, NxTooltipSide, OpenResourceWorkTab, OpenResourceWorkTabOptions, ResourceCreateCompletion, ResourceCreateCompletionInput, ResourceCreateContinuationTarget, ResourceCreateReceiverRegistration, ResourceInspectorAdapter, ResourceInspectorAdapterLoader, ResourceInspectorAdapterProps, ResourceInspectorAdapterRegistry, ResourceInspectorPanelProps, ResourceInspectorStack, ResourceInspectorStackHostProps, ResourceInspectorStackProviderProps, ResourceInspectorStateProps, ResourceLinkProps, ResourceListFilters, ResourceListFilterValue, ResourceListFooterConfig, ResourceListParams, ResourceListParamsControls, ResourceListRefreshConfig, ResourceListToolbarConfig, ResourceListToolbarMoreMenuProps, ResourceListToolbarViewOption, ResourcePrimaryCellProps, ResourceActionDescriptor, ResourceRef, ResourceRowActionsMenuProps, ResourceStatusBadgeProps, ResourceTableColumn, ResourceTableAccess, ResourceTableDensity, ResourceTableProps, ResourceTableStyle, ResourceTableSummaryRow, ResourceTableSort, TabContextActionContext, TabContextActionRegistration, DraftFieldBinding, RegisterDraftActionOptions, TabContextActionResult, ResourceTextCellProps, ToastOptions, ToastSource, UseRegisterListLocateActionOptions, UseResourceListParamsOptions, WorkSectionProps, FavoriteTarget, WorkTabRef, WorkSurfaceAction, WorkSurfaceLabelInput, WorkSurfaceLabels, WorkSurfaceProps, } from "./shell";
|
|
39
|
+
export type { AppRouteFrameProps, AppRoutePrefetchContext, AppRoutePrefetcher, AutoRegisterPackageSurfacesOptions, PackageSurfaceLoader, PackageSurfaceOverride, PackageSurfaceOverrideRegistration, FormFieldErrors, InspectorActionProps, InspectorResourceActionsProps, ListLocateRecord, MessageApi, MutationFormError, NxCanonicalRoutePaneProps, NxActionKind, NxIconButtonProps, NxComboboxOption, NxComboboxProps, NxRefreshControlProps, NxColumnBrowserLabels, NxColumnBrowserProps, NxColumnNode, NxColumnPickerLabels, NxColumnPickerProps, NxDatePickerLabels, NxDatePickerProps, NxDateRangePickerProps, NxDateRangeValue, NxDropdownMenuItem, NxHelpTooltipProps, InsightFilterControls, InsightFilterState, InsightQueryLike, InsightRangePreset, UseInsightFilterStateOptions, NxOverviewBandCard, NxSelectOption, NxStatDelta, NxStatDeltaDirection, NxStatDeltaTone, NxTabNavItem, NxTabNavProps, NxTooltipAlign, NxTooltipProps, NxTooltipSide, OpenResourceWorkTab, OpenResourceWorkTabOptions, ResourceCreateCompletion, ResourceCreateCompletionInput, ResourceCreateContinuationTarget, ResourceCreateReceiverRegistration, ResourceInspectorAdapter, ResourceInspectorAdapterLoader, ResourceInspectorAdapterProps, ResourceInspectorQueryProps, ResourceInspectorAdapterRegistry, ResourceInspectorPanelProps, ResourceInspectorStack, ResourceInspectorStackHostProps, ResourceInspectorStackProviderProps, ResourceInspectorStateProps, ResourceLinkProps, ResourceListFilters, ResourceListFilterValue, ResourceListFooterConfig, ResourceListParams, ResourceListParamsControls, ResourceListRefreshConfig, ResourceListToolbarConfig, ResourceListToolbarMoreMenuProps, ResourceListToolbarViewOption, ResourcePrimaryCellProps, ResourceActionDescriptor, ResourceRef, ResourceRowActionsMenuProps, ResourceStatusBadgeProps, ResourceTableColumn, ResourceTableAccess, ResourceTableDensity, ResourceTableProps, ResourceTableStyle, ResourceTableSummaryRow, ResourceTableSort, TabContextActionContext, TabContextActionRegistration, DraftFieldBinding, RegisterDraftActionOptions, TabContextActionResult, ResourceTextCellProps, ToastOptions, ToastSource, UseRegisterListLocateActionOptions, UseResourceListParamsOptions, WorkSectionProps, FavoriteTarget, WorkTabRef, WorkSurfaceAction, WorkSurfaceLabelInput, WorkSurfaceLabels, WorkSurfaceProps, } from "./shell";
|
|
40
40
|
export { FavoriteButton } from "./host";
|
|
41
41
|
export type { FavoriteButtonProps } from "./host";
|
|
42
42
|
export { createSpreadsheetWorkbook } from "./spreadsheet";
|
|
43
43
|
export type { SpreadsheetWorkbook, SpreadsheetWorksheet, SpreadsheetCell, NxSpreadsheetEditorProps } from "./spreadsheet";
|
|
44
|
+
export type { ActionPlacement, ActionTargets, NxActionsProps } from './actions';
|
package/dist/process.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface ProcessUserTaskFormController {
|
|
|
61
61
|
/** Current widget validity; widgets re-register when this value changes. */
|
|
62
62
|
readonly canSubmit: boolean;
|
|
63
63
|
/** Build the App-owned input that Core forwards to the server-side handler. */
|
|
64
|
-
buildInput: () => Record<string, unknown
|
|
64
|
+
buildInput: () => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
65
65
|
}
|
|
66
66
|
/** Versioned props for the closed `process.user_task.form` host slot. */
|
|
67
67
|
export interface ProcessUserTaskFormSlotPropsV1 {
|
|
@@ -111,7 +111,7 @@ export function parseCompositionSpec(value) {
|
|
|
111
111
|
if (sources.length === 1 && relationships.length !== 0)
|
|
112
112
|
fail('relationship_not_allowed', 'relationships', 'Single-source Resource Composition cannot declare relationships.');
|
|
113
113
|
const parsedRelationships = parseGraphRelationships(relationships, aliases);
|
|
114
|
-
const timezone = identifier(root.timezone, 'timezone', /^[A-Za-z_]+(?:\/[A-Za-z_+-]+)
|
|
114
|
+
const timezone = identifier(root.timezone, 'timezone', /^(?:UTC|[A-Za-z_]+(?:\/[A-Za-z_+-]+)+)$/);
|
|
115
115
|
const fields = boundedList(root.fields, 'fields').map((value, index) => {
|
|
116
116
|
node(`fields.${index}`);
|
|
117
117
|
const item = plainObject(value, `fields.${index}`);
|
|
@@ -122,7 +122,26 @@ export interface NxResourceInformationFormProps<TViewContext, TEditContext> {
|
|
|
122
122
|
emptyValue: ReactNode;
|
|
123
123
|
testIdPrefix?: string;
|
|
124
124
|
}
|
|
125
|
+
export interface ResourceFormSaved {
|
|
126
|
+
action: "create" | "update";
|
|
127
|
+
/** Unmodified business response; decode it using the owning App contract. */
|
|
128
|
+
response: Readonly<Record<string, unknown>>;
|
|
129
|
+
submittedValues: Readonly<Record<string, unknown>>;
|
|
130
|
+
currentValues: Readonly<Record<string, unknown>>;
|
|
131
|
+
}
|
|
132
|
+
/** Explicit App action associated with a page form; grants no execution authority. */
|
|
133
|
+
export interface AppFormSaveBinding {
|
|
134
|
+
key: string;
|
|
135
|
+
/** Fixed record/scope arguments. Form fields must not overwrite these keys. */
|
|
136
|
+
arguments: Readonly<Record<string, unknown>>;
|
|
137
|
+
/** Decode the App response, preserve newer input, and refresh human-owned queries. */
|
|
138
|
+
onSaved: (result: Omit<ResourceFormSaved, "action">) => void | Promise<void>;
|
|
139
|
+
}
|
|
125
140
|
export interface ResourceFormBinding {
|
|
141
|
+
/** Local identity for a form without a Resource. Requires explicit scopeKey; do not combine with resourceKey/resourceId/onSaved. */
|
|
142
|
+
formKey?: string;
|
|
143
|
+
/** Only for a formKey-based page; pairs an explicit server action with this form. */
|
|
144
|
+
saveAction?: AppFormSaveBinding;
|
|
126
145
|
/** Omit identity inside a declared Resource route; the host supplies it. */
|
|
127
146
|
resourceKey?: string;
|
|
128
147
|
resourceId?: string | null;
|
|
@@ -130,6 +149,8 @@ export interface ResourceFormBinding {
|
|
|
130
149
|
scopeKey?: string;
|
|
131
150
|
effect: "draft" | "autosave";
|
|
132
151
|
disabled?: boolean;
|
|
152
|
+
/** Host-confirmed external save for this mounted form; never performs a write. */
|
|
153
|
+
onSaved?: (result: ResourceFormSaved) => void | Promise<void>;
|
|
133
154
|
/** Pure cross-field preflight; return rejected keys before any value writer runs. */
|
|
134
155
|
validateBatch?: (values: Readonly<Record<string, unknown>>) => readonly string[];
|
|
135
156
|
}
|
package/dist/shell.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ComponentType, FieldsetHTMLAttributes, FormEvent, HTMLAttributes, InputHTMLAttributes, ReactElement, ReactNode, TextareaHTMLAttributes } from "react";
|
|
2
|
-
import type { QueryClient } from "@tanstack/react-query";
|
|
2
|
+
import type { QueryClient, UseQueryResult } from "@tanstack/react-query";
|
|
3
3
|
import type { PermissionsResponse } from "./context";
|
|
4
4
|
import type { ResourcePickerRevalidation, ResourceReferenceIdentity } from "./resource-reference";
|
|
5
5
|
import type { ResourceListSchema } from "./resources/resource-list";
|
|
6
|
-
import type { ResourceFormBinding } from "./resources/resource-information";
|
|
6
|
+
import type { AppFormSaveBinding, ResourceFormBinding, ResourceFormSaved } from "./resources/resource-information";
|
|
7
7
|
import type { ResourceTransferMeta } from "./resources/resource-transfer";
|
|
8
8
|
/** A server-authorized, durable favorite identity. */
|
|
9
9
|
export type FavoriteTarget = {
|
|
@@ -195,6 +195,14 @@ export interface NxPaginationProps {
|
|
|
195
195
|
disabled?: boolean;
|
|
196
196
|
className?: string;
|
|
197
197
|
}
|
|
198
|
+
/** Authorized query presentation shared by record Inspectors. */
|
|
199
|
+
export interface ResourceInspectorQueryProps<T> {
|
|
200
|
+
query: Pick<UseQueryResult<T>, "data" | "error" | "isError" | "isLoading" | "refetch">;
|
|
201
|
+
canView: (record: T) => boolean;
|
|
202
|
+
actions?: (record: T) => ReactNode;
|
|
203
|
+
children: (record: T) => ReactNode;
|
|
204
|
+
testId?: string;
|
|
205
|
+
}
|
|
198
206
|
export interface ResourceInspectorPanelProps {
|
|
199
207
|
testId?: string;
|
|
200
208
|
badges?: ReactNode;
|
|
@@ -778,6 +786,8 @@ export interface NxFormFieldProps {
|
|
|
778
786
|
/** Does not block Save; marks information needed before the resource is ready to use. */
|
|
779
787
|
readinessRequired?: boolean;
|
|
780
788
|
compact?: boolean;
|
|
789
|
+
/** Keep an editable field in the same label/value grid as NxDetailRow. */
|
|
790
|
+
layout?: "stack" | "row";
|
|
781
791
|
className?: string;
|
|
782
792
|
}
|
|
783
793
|
export interface NxFormSectionProps {
|
|
@@ -1225,19 +1235,30 @@ export interface DraftFieldBinding {
|
|
|
1225
1235
|
parse: (input: unknown) => unknown;
|
|
1226
1236
|
apply: (value: unknown) => void;
|
|
1227
1237
|
}
|
|
1228
|
-
export
|
|
1238
|
+
export type RegisterDraftActionOptions = {
|
|
1239
|
+
onSaved?: (result: ResourceFormSaved) => void | Promise<void>;
|
|
1229
1240
|
actionType: string;
|
|
1230
1241
|
label: string;
|
|
1231
1242
|
description?: string;
|
|
1232
|
-
resourceKey: string;
|
|
1233
|
-
resourceId: string | null;
|
|
1234
1243
|
/** Local form context identity (for example tenant and selected create owner); never grants authority. */
|
|
1235
1244
|
scopeKey?: string;
|
|
1236
1245
|
enabled: boolean;
|
|
1237
1246
|
fields: Record<string, DraftFieldBinding>;
|
|
1238
1247
|
/** Return invalid field keys for App-owned cross-field constraints, before any writer runs. */
|
|
1239
1248
|
validateBatch?: (values: Readonly<Record<string, unknown>>) => readonly string[];
|
|
1240
|
-
}
|
|
1249
|
+
} & ({
|
|
1250
|
+
resourceKey: string;
|
|
1251
|
+
resourceId: string | null;
|
|
1252
|
+
formKey?: never;
|
|
1253
|
+
saveAction?: never;
|
|
1254
|
+
} | {
|
|
1255
|
+
formKey: string;
|
|
1256
|
+
scopeKey: string;
|
|
1257
|
+
resourceKey?: never;
|
|
1258
|
+
resourceId?: never;
|
|
1259
|
+
onSaved?: never;
|
|
1260
|
+
saveAction?: AppFormSaveBinding;
|
|
1261
|
+
});
|
|
1241
1262
|
export interface WorkSurfaceLabelInput {
|
|
1242
1263
|
action: WorkSurfaceAction;
|
|
1243
1264
|
resourceLabel: string;
|
|
@@ -1350,6 +1371,8 @@ export type PackageSurfaceLoader = () => Promise<{
|
|
|
1350
1371
|
* surface is pulled into the package entry chunk and code-splitting is lost.
|
|
1351
1372
|
*/
|
|
1352
1373
|
export interface PackageSurfaceOverrideRegistration {
|
|
1374
|
+
/** Explicit mode for a page without Resource route metadata; never grants API authority. */
|
|
1375
|
+
mode?: 'list' | 'read' | 'create' | 'edit';
|
|
1353
1376
|
load: PackageSurfaceLoader;
|
|
1354
1377
|
routePrefetcher?: AppRoutePrefetcher;
|
|
1355
1378
|
}
|
|
@@ -1359,6 +1382,10 @@ export interface AutoRegisterPackageSurfacesOptions {
|
|
|
1359
1382
|
appKey?: string;
|
|
1360
1383
|
overview?: PackageSurfaceLoader;
|
|
1361
1384
|
surfaces: Record<string, () => Promise<unknown>>;
|
|
1385
|
+
/** Lazy App-owned resource contract modules, keyed by their glob paths.
|
|
1386
|
+
* When supplied, it replaces the host's installed-contract lookup for this
|
|
1387
|
+
* registration, so isolated/revised Apps never mix installed metadata. */
|
|
1388
|
+
resourceContracts?: Record<string, () => Promise<unknown>>;
|
|
1362
1389
|
overrides?: Record<string, PackageSurfaceOverride>;
|
|
1363
1390
|
}
|
|
1364
1391
|
export interface AppRoutePrefetchContext {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexia/sdk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Frontend contracts for Nexia App Packages",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "node scripts/build.mjs",
|
|
33
33
|
"prepack": "npm run build",
|
|
34
|
-
"test": "npm run build && node tests/WireValuesTest.mjs && node tests/ResourceCompositionFrontendContractsTest.mjs && node tests/
|
|
34
|
+
"test": "npm run build && node tests/WireValuesTest.mjs && node tests/ResourceCompositionFrontendContractsTest.mjs && node scripts/organization-target-contract.mjs && node tests/ResourceInspectorRegistrationTest.mjs && node tests/SettingsPrimitivesTest.mjs",
|
|
35
35
|
"test:wire-values": "node tests/WireValuesTest.mjs",
|
|
36
36
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
37
37
|
"test:resource-composition": "pnpm run build && node tests/ResourceCompositionFrontendContractsTest.mjs",
|