@portalduct/react-sdk-factorcloud-legacy 1.0.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/LICENSE +21 -0
- package/README.md +271 -0
- package/dist/api/connectionSync.d.ts +51 -0
- package/dist/api/factorcloud.d.ts +13 -0
- package/dist/api/portalduct.d.ts +33 -0
- package/dist/components/ClientSelectionModal.d.ts +10 -0
- package/dist/components/ConfigModal.d.ts +10 -0
- package/dist/components/ConnectDebtorModal.d.ts +16 -0
- package/dist/components/InterestSyncModal.d.ts +5 -0
- package/dist/components/PortalIntegration.d.ts +8 -0
- package/dist/components/RequestPortalModal.d.ts +8 -0
- package/dist/components/SyncBanner.d.ts +16 -0
- package/dist/components/SyncProgressModal.d.ts +31 -0
- package/dist/components/SyncWorkflow.d.ts +15 -0
- package/dist/components/UpdateCredentialsModal.d.ts +11 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert.d.ts +8 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/avatar.d.ts +6 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/breadcrumb.d.ts +19 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/carousel.d.ts +18 -0
- package/dist/components/ui/chart.d.ts +61 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/command.d.ts +82 -0
- package/dist/components/ui/context-menu.d.ts +27 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/drawer.d.ts +22 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/input-otp.d.ts +34 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/menubar.d.ts +33 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/pagination.d.ts +28 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/resizable.d.ts +23 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +25 -0
- package/dist/components/ui/sidebar.d.ts +66 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts +5 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/toast.d.ts +15 -0
- package/dist/components/ui/toaster.d.ts +1 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/use-toast.d.ts +3 -0
- package/dist/hooks/use-customer-status.d.ts +15 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-toast.d.ts +44 -0
- package/dist/index.cjs +113 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6874 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/pages/Index.d.ts +2 -0
- package/dist/pages/NotFound.d.ts +2 -0
- package/dist/placeholder.svg +1 -0
- package/dist/sdk/index.d.ts +66 -0
- package/dist/services/orchestration.d.ts +26 -0
- package/dist/types/config.d.ts +47 -0
- package/dist/types/factorcloud.d.ts +98 -0
- package/dist/types/merged.d.ts +16 -0
- package/dist/types/portalduct.d.ts +139 -0
- package/package.json +122 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" fill="none"><rect width="1200" height="1200" fill="#EAEAEA" rx="3"/><g opacity=".5"><g opacity=".5"><path fill="#FAFAFA" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/><path stroke="#C9C9C9" stroke-width="2.418" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/></g><path stroke="url(#a)" stroke-width="2.418" d="M0-1.209h553.581" transform="scale(1 -1) rotate(45 1163.11 91.165)"/><path stroke="url(#b)" stroke-width="2.418" d="M404.846 598.671h391.726"/><path stroke="url(#c)" stroke-width="2.418" d="M599.5 795.742V404.017"/><path stroke="url(#d)" stroke-width="2.418" d="m795.717 796.597-391.441-391.44"/><path fill="#fff" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/><g clip-path="url(#e)"><path fill="#666" fill-rule="evenodd" d="M616.426 586.58h-31.434v16.176l3.553-3.554.531-.531h9.068l.074-.074 8.463-8.463h2.565l7.18 7.181V586.58Zm-15.715 14.654 3.698 3.699 1.283 1.282-2.565 2.565-1.282-1.283-5.2-5.199h-6.066l-5.514 5.514-.073.073v2.876a2.418 2.418 0 0 0 2.418 2.418h26.598a2.418 2.418 0 0 0 2.418-2.418v-8.317l-8.463-8.463-7.181 7.181-.071.072Zm-19.347 5.442v4.085a6.045 6.045 0 0 0 6.046 6.045h26.598a6.044 6.044 0 0 0 6.045-6.045v-7.108l1.356-1.355-1.282-1.283-.074-.073v-17.989h-38.689v23.43l-.146.146.146.147Z" clip-rule="evenodd"/></g><path stroke="#C9C9C9" stroke-width="2.418" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/></g><defs><linearGradient id="a" x1="554.061" x2="-.48" y1=".083" y2=".087" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="b" x1="796.912" x2="404.507" y1="599.963" y2="599.965" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="c" x1="600.792" x2="600.794" y1="403.677" y2="796.082" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="d" x1="404.85" x2="796.972" y1="403.903" y2="796.02" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><clipPath id="e"><path fill="#fff" d="M581.364 580.535h38.689v38.689h-38.689z"/></clipPath></defs></svg>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { PortalIntegration } from '../components/PortalIntegration';
|
|
2
|
+
import { SDKConfig } from '../types/config';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SDK Version
|
|
6
|
+
*/
|
|
7
|
+
export declare const SDK_VERSION = "0.1.0";
|
|
8
|
+
/**
|
|
9
|
+
* Initialize PortalSDK with configuration
|
|
10
|
+
* @param config - SDK configuration object
|
|
11
|
+
* @returns Object containing config and component
|
|
12
|
+
*/
|
|
13
|
+
export declare function initPortalSDK(config: SDKConfig): {
|
|
14
|
+
config: SDKConfig;
|
|
15
|
+
component: ({ config, onTokenExpired, trigger, onSyncComplete, onSyncError, autoStart, customerStatus, }: import('../components/SyncWorkflow').SyncWorkflowProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Sync Workflow Component (Recommended)
|
|
19
|
+
* Provides modal-based workflow for syncing invoices from portals
|
|
20
|
+
* This is the primary component you should use for integrating sync functionality
|
|
21
|
+
*/
|
|
22
|
+
export { SyncWorkflow } from '../components/SyncWorkflow';
|
|
23
|
+
export type { SyncWorkflowProps } from '../components/SyncWorkflow';
|
|
24
|
+
/**
|
|
25
|
+
* Pre-built marketing banner with CTA button that launches the sync workflow.
|
|
26
|
+
*/
|
|
27
|
+
export { SyncBanner } from '../components/SyncBanner';
|
|
28
|
+
export type { SyncBannerProps } from '../components/SyncBanner';
|
|
29
|
+
/**
|
|
30
|
+
* Full Portal Integration Component (Demo/Reference)
|
|
31
|
+
* Complete dashboard UI - primarily for internal demo purposes
|
|
32
|
+
* External applications should use SyncWorkflow instead
|
|
33
|
+
*/
|
|
34
|
+
export { PortalIntegration };
|
|
35
|
+
/**
|
|
36
|
+
* Standalone Modal Components
|
|
37
|
+
* Use these for custom integration workflows
|
|
38
|
+
*/
|
|
39
|
+
export { ConfigModal } from '../components/ConfigModal';
|
|
40
|
+
export { ConnectDebtorModal } from '../components/ConnectDebtorModal';
|
|
41
|
+
export { RequestPortalModal } from '../components/RequestPortalModal';
|
|
42
|
+
export { UpdateCredentialsModal } from '../components/UpdateCredentialsModal';
|
|
43
|
+
export { SyncProgressModal } from '../components/SyncProgressModal';
|
|
44
|
+
export { ClientSelectionModal } from '../components/ClientSelectionModal';
|
|
45
|
+
/**
|
|
46
|
+
* Type Exports
|
|
47
|
+
*/
|
|
48
|
+
export type { SDKConfig };
|
|
49
|
+
/**
|
|
50
|
+
* Export all types for external use
|
|
51
|
+
*/
|
|
52
|
+
export * from '../types/config';
|
|
53
|
+
export * from '../types/factorcloud';
|
|
54
|
+
export * from '../types/portalduct';
|
|
55
|
+
export * from '../types/merged';
|
|
56
|
+
/**
|
|
57
|
+
* API Clients for direct API access
|
|
58
|
+
*/
|
|
59
|
+
export { FactorCloudAPI } from '../api/factorcloud';
|
|
60
|
+
export { PortalDuctAPI } from '../api/portalduct';
|
|
61
|
+
export { ConnectionSyncAPI } from '../api/connectionSync';
|
|
62
|
+
/**
|
|
63
|
+
* Data Orchestration Service
|
|
64
|
+
* Handles complex data synchronization between PortalDuct and FactorCloud
|
|
65
|
+
*/
|
|
66
|
+
export { DataOrchestrationService } from '../services/orchestration';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FactorCloudAPI } from '../api/factorcloud';
|
|
2
|
+
import { PortalDuctAPI } from '../api/portalduct';
|
|
3
|
+
import { ConnectionSyncAPI } from '../api/connectionSync';
|
|
4
|
+
import { SDKConfig } from '../types/config';
|
|
5
|
+
import { FactorCloudClient, FactorCloudClientDetail } from '../types/factorcloud';
|
|
6
|
+
import { PortalDuctCompany, ResyncResponse } from '../types/portalduct';
|
|
7
|
+
import { MergedDebtor } from '../types/merged';
|
|
8
|
+
|
|
9
|
+
export declare class DataOrchestrationService {
|
|
10
|
+
private factorcloudAPI;
|
|
11
|
+
private portalductAPI;
|
|
12
|
+
private connectionSyncAPI;
|
|
13
|
+
private config;
|
|
14
|
+
constructor(config: SDKConfig);
|
|
15
|
+
getFactorCloudClients(): Promise<FactorCloudClient[]>;
|
|
16
|
+
getFactorCloudClient(clientId?: string): Promise<FactorCloudClient>;
|
|
17
|
+
ensurePortalDuctCompany(fcClient: FactorCloudClient | FactorCloudClientDetail): Promise<PortalDuctCompany>;
|
|
18
|
+
fetchMergedDebtors(fcClientId: string, pdCompanyId: string): Promise<MergedDebtor[]>;
|
|
19
|
+
private matchConnectionsToDebtors;
|
|
20
|
+
getFactorCloudAPI(): FactorCloudAPI;
|
|
21
|
+
getPortalDuctAPI(): PortalDuctAPI;
|
|
22
|
+
getConnectionSyncAPI(): ConnectionSyncAPI;
|
|
23
|
+
isCustomerActive(): Promise<boolean>;
|
|
24
|
+
triggerConnectionSync(connectionId: string): Promise<ResyncResponse>;
|
|
25
|
+
triggerConnectionVerification(connectionId: string): Promise<ResyncResponse>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface SDKConfig {
|
|
2
|
+
portalduct: {
|
|
3
|
+
bearer_token: string;
|
|
4
|
+
env_url: string;
|
|
5
|
+
customer_id: string;
|
|
6
|
+
/**
|
|
7
|
+
* Dedicated bearer token used exclusively for Supabase webhook calls.
|
|
8
|
+
*/
|
|
9
|
+
webhook_bearer_token?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Deployment environment identifier used by webhook integrations.
|
|
12
|
+
* Defaults to "sandbox" when the PortalDuct environment URL contains
|
|
13
|
+
* "sandbox" and "production" otherwise.
|
|
14
|
+
*/
|
|
15
|
+
environment?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional override for the webhook endpoint used to trigger connection syncs.
|
|
18
|
+
*/
|
|
19
|
+
sync_webhook_url?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional override for the webhook endpoint used to trigger connection verification.
|
|
22
|
+
*/
|
|
23
|
+
verify_webhook_url?: string;
|
|
24
|
+
};
|
|
25
|
+
factorcloud: {
|
|
26
|
+
bearer_token: string;
|
|
27
|
+
factorId: string;
|
|
28
|
+
env_url: string;
|
|
29
|
+
client_id?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface CustomerStatusPayload {
|
|
33
|
+
active: boolean;
|
|
34
|
+
customer?: {
|
|
35
|
+
portalduct_customer_uuid?: string | null;
|
|
36
|
+
} | null;
|
|
37
|
+
factorcloud?: {
|
|
38
|
+
bearer_token?: string | null;
|
|
39
|
+
api_url?: string | null;
|
|
40
|
+
} | null;
|
|
41
|
+
portalduct?: {
|
|
42
|
+
bearer_token?: string | null;
|
|
43
|
+
api_url?: string | null;
|
|
44
|
+
} | null;
|
|
45
|
+
}
|
|
46
|
+
export declare const isConfigComplete: (config: Partial<SDKConfig> | null) => config is SDKConfig;
|
|
47
|
+
export declare const mergeCustomerStatusWithConfig: (config: Partial<SDKConfig> | null | undefined, status: CustomerStatusPayload) => SDKConfig | null;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export interface FactorCloudClient {
|
|
2
|
+
id: string;
|
|
3
|
+
compCode: string;
|
|
4
|
+
shortCode: string;
|
|
5
|
+
companyName: string;
|
|
6
|
+
active: boolean;
|
|
7
|
+
address1: string;
|
|
8
|
+
address2: string | null;
|
|
9
|
+
city: string;
|
|
10
|
+
stateCode: string;
|
|
11
|
+
zipCode: string;
|
|
12
|
+
countryCode: string;
|
|
13
|
+
phone: string;
|
|
14
|
+
fax: string | null;
|
|
15
|
+
email: string;
|
|
16
|
+
factorName: string;
|
|
17
|
+
companyType: string;
|
|
18
|
+
ein: string | null;
|
|
19
|
+
mcNumber: string | null;
|
|
20
|
+
createdOn: string;
|
|
21
|
+
updatedOn: string;
|
|
22
|
+
industryType: string;
|
|
23
|
+
enableOverAdvances: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface FactorCloudClientDetail extends FactorCloudClient {
|
|
26
|
+
phoneAlternate: string | null;
|
|
27
|
+
ediId: string | null;
|
|
28
|
+
fedTaxNumber: string | null;
|
|
29
|
+
dunsNumber: string | null;
|
|
30
|
+
dotNumber: string | null;
|
|
31
|
+
creditLimit: number;
|
|
32
|
+
ineligibleDays: number | null;
|
|
33
|
+
termId: string;
|
|
34
|
+
termName: string;
|
|
35
|
+
currency: string;
|
|
36
|
+
creditLimitApproved: boolean;
|
|
37
|
+
achFee: number | null;
|
|
38
|
+
wireFee: number | null;
|
|
39
|
+
checkFee: number | null;
|
|
40
|
+
fuelCardFee: number | null;
|
|
41
|
+
sameDayAchFee: number | null;
|
|
42
|
+
digitalWalletFee: number | null;
|
|
43
|
+
escrowReserve: number;
|
|
44
|
+
cashReserve: number;
|
|
45
|
+
interestActive: boolean;
|
|
46
|
+
interestPrincipal: number | null;
|
|
47
|
+
interestType: string | null;
|
|
48
|
+
interestRate: number | null;
|
|
49
|
+
interestRateMinimum: number | null;
|
|
50
|
+
interestDaysPerYear: number | null;
|
|
51
|
+
negativeFeeDollarAmount: number;
|
|
52
|
+
negativeFeePercentageAmount: number | null;
|
|
53
|
+
}
|
|
54
|
+
export interface FactorCloudDebtor {
|
|
55
|
+
companyDebtorName: string;
|
|
56
|
+
companyClientName: string;
|
|
57
|
+
companyDebtorId: string;
|
|
58
|
+
companyClientId: string;
|
|
59
|
+
termId: string;
|
|
60
|
+
termName: string;
|
|
61
|
+
clientTermId: string;
|
|
62
|
+
clientTermName: string;
|
|
63
|
+
paymentTerm: number | null;
|
|
64
|
+
ineligibleDays: number | null;
|
|
65
|
+
creditLimit: number;
|
|
66
|
+
creditLimitApproved: boolean;
|
|
67
|
+
creditRating: string | null;
|
|
68
|
+
firstNoaSent: string | null;
|
|
69
|
+
lastNoaSent: string | null;
|
|
70
|
+
}
|
|
71
|
+
export interface FactorCloudAuthResponse {
|
|
72
|
+
status: string;
|
|
73
|
+
code: number;
|
|
74
|
+
token: string;
|
|
75
|
+
skip2fa: boolean;
|
|
76
|
+
bearer: string;
|
|
77
|
+
username: string;
|
|
78
|
+
authorities: Array<{
|
|
79
|
+
authority: string;
|
|
80
|
+
}>;
|
|
81
|
+
redirectUrl: string | null;
|
|
82
|
+
}
|
|
83
|
+
export interface FactorCloudClientsResponse {
|
|
84
|
+
status: string;
|
|
85
|
+
code: number;
|
|
86
|
+
companies: FactorCloudClient[];
|
|
87
|
+
}
|
|
88
|
+
export interface FactorCloudClientDetailResponse {
|
|
89
|
+
status: string;
|
|
90
|
+
code: number;
|
|
91
|
+
message: string;
|
|
92
|
+
client: FactorCloudClientDetail;
|
|
93
|
+
}
|
|
94
|
+
export interface FactorCloudDebtorsResponse {
|
|
95
|
+
status: string;
|
|
96
|
+
code: number;
|
|
97
|
+
clientDebtors: FactorCloudDebtor[];
|
|
98
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PortalDuctConnection, SyncSummary } from './portalduct';
|
|
2
|
+
|
|
3
|
+
export interface MergedDebtor {
|
|
4
|
+
factorcloudDebtorId: string;
|
|
5
|
+
factorcloudClientId: string;
|
|
6
|
+
debtorName: string;
|
|
7
|
+
creditLimit: number;
|
|
8
|
+
termName: string;
|
|
9
|
+
connection?: PortalDuctConnection;
|
|
10
|
+
status: "not_connected" | "pending" | "connected" | "deactivated";
|
|
11
|
+
portalName?: string;
|
|
12
|
+
lastSync?: string;
|
|
13
|
+
autoSyncEnabled?: boolean;
|
|
14
|
+
lastSyncSummary?: SyncSummary;
|
|
15
|
+
lastVerificationSummary?: SyncSummary;
|
|
16
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
export interface PortalDuctCompany {
|
|
2
|
+
company_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
activation_status: string;
|
|
6
|
+
tags: {
|
|
7
|
+
factorcloud_id?: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
customer_id: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PortalDuctConnection {
|
|
13
|
+
connection_id: string;
|
|
14
|
+
portal_id: string;
|
|
15
|
+
portal_name: string | null;
|
|
16
|
+
host: string;
|
|
17
|
+
last_sync: string | null;
|
|
18
|
+
created_at: string;
|
|
19
|
+
activation_status: "activated" | "pending" | "deactivated";
|
|
20
|
+
auto_sync_status: "enabled" | "disabled";
|
|
21
|
+
remark: string | null;
|
|
22
|
+
tags: {
|
|
23
|
+
factorcloud_id?: string;
|
|
24
|
+
factorcloud_debtor_id?: string;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
27
|
+
company: PortalDuctCompany;
|
|
28
|
+
}
|
|
29
|
+
export interface PortalDuctPortal {
|
|
30
|
+
portal_id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
domain: string;
|
|
33
|
+
status: string;
|
|
34
|
+
icon?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface PortalDuctAuthResponse {
|
|
37
|
+
status: string;
|
|
38
|
+
request_id: string;
|
|
39
|
+
message: string;
|
|
40
|
+
data: {
|
|
41
|
+
token: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface PortalDuctCompaniesResponse {
|
|
45
|
+
status: string;
|
|
46
|
+
request_id: string;
|
|
47
|
+
message: string;
|
|
48
|
+
data: PortalDuctCompany[];
|
|
49
|
+
}
|
|
50
|
+
export interface PortalDuctCompanyResponse {
|
|
51
|
+
status: string;
|
|
52
|
+
request_id: string;
|
|
53
|
+
message: string;
|
|
54
|
+
data: PortalDuctCompany;
|
|
55
|
+
}
|
|
56
|
+
export interface PortalDuctConnectionsResponse {
|
|
57
|
+
status: string;
|
|
58
|
+
request_id: string;
|
|
59
|
+
message: string;
|
|
60
|
+
data: PortalDuctConnection[];
|
|
61
|
+
}
|
|
62
|
+
export interface PortalDuctConnectionResponse {
|
|
63
|
+
status: string;
|
|
64
|
+
request_id: string;
|
|
65
|
+
message: string;
|
|
66
|
+
data: PortalDuctConnection;
|
|
67
|
+
}
|
|
68
|
+
export interface CreateCompanyRequest {
|
|
69
|
+
name: string;
|
|
70
|
+
email: string;
|
|
71
|
+
customer_id: string;
|
|
72
|
+
tags: {
|
|
73
|
+
factorcloud_id: string;
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface CreateConnectionRequest {
|
|
78
|
+
tags: {
|
|
79
|
+
factorcloud_id: string;
|
|
80
|
+
factorcloud_debtor_id: string;
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
};
|
|
83
|
+
company_id: string;
|
|
84
|
+
portal_id: string;
|
|
85
|
+
user_name: string;
|
|
86
|
+
password: string;
|
|
87
|
+
}
|
|
88
|
+
export interface UpdateConnectionRequest {
|
|
89
|
+
user_name?: string;
|
|
90
|
+
password?: string;
|
|
91
|
+
portal_id?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ActivationRequest {
|
|
94
|
+
activation_status: "activate" | "deactivate";
|
|
95
|
+
}
|
|
96
|
+
export interface PortalMapping {
|
|
97
|
+
mapping_id: string;
|
|
98
|
+
host: string;
|
|
99
|
+
description: string;
|
|
100
|
+
is_active: boolean;
|
|
101
|
+
portal_id: string;
|
|
102
|
+
logo: string;
|
|
103
|
+
name: string;
|
|
104
|
+
}
|
|
105
|
+
export interface PortalMappingsResponse {
|
|
106
|
+
status: string;
|
|
107
|
+
request_id: string;
|
|
108
|
+
message: string;
|
|
109
|
+
data: PortalMapping[];
|
|
110
|
+
}
|
|
111
|
+
export interface PortalMappingResponse {
|
|
112
|
+
status: string;
|
|
113
|
+
request_id: string;
|
|
114
|
+
message: string;
|
|
115
|
+
data: PortalMapping;
|
|
116
|
+
}
|
|
117
|
+
export interface CreatePortalMappingRequest {
|
|
118
|
+
customer_id: string;
|
|
119
|
+
name: string;
|
|
120
|
+
host: string;
|
|
121
|
+
}
|
|
122
|
+
export interface ResyncResponse {
|
|
123
|
+
success: boolean;
|
|
124
|
+
customerId: string;
|
|
125
|
+
connectionId: string;
|
|
126
|
+
processed: number;
|
|
127
|
+
synced: number;
|
|
128
|
+
failed: number;
|
|
129
|
+
message?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface SyncSummary {
|
|
132
|
+
processed: number;
|
|
133
|
+
synced: number;
|
|
134
|
+
failed: number;
|
|
135
|
+
/**
|
|
136
|
+
* ISO timestamp representing when the summary was captured.
|
|
137
|
+
*/
|
|
138
|
+
timestamp: string;
|
|
139
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@portalduct/react-sdk-factorcloud-legacy",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "React SDK for integrating with PortalDuct and FactorCloud APIs",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=16.16.0"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.cjs",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"*.css"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"require": "./dist/index.cjs"
|
|
21
|
+
},
|
|
22
|
+
"./react-sdk-factorcloud.css": "./dist/react-sdk-factorcloud.css"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"keywords": [
|
|
30
|
+
"react",
|
|
31
|
+
"sdk",
|
|
32
|
+
"portalduct",
|
|
33
|
+
"factorcloud",
|
|
34
|
+
"invoice",
|
|
35
|
+
"integration",
|
|
36
|
+
"api"
|
|
37
|
+
],
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"scripts": {
|
|
40
|
+
"dev": "vite",
|
|
41
|
+
"build": "vite build",
|
|
42
|
+
"build:dev": "vite build --mode development",
|
|
43
|
+
"build:lib": "vite build --config vite.config.lib.ts",
|
|
44
|
+
"lint": "eslint .",
|
|
45
|
+
"preview": "vite preview",
|
|
46
|
+
"prepublishOnly": "npm run build:lib"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@formspark/use-formspark": "^0.1.42",
|
|
50
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
51
|
+
"class-variance-authority": "^0.7.1",
|
|
52
|
+
"clsx": "^2.1.1",
|
|
53
|
+
"cmdk": "^1.1.1",
|
|
54
|
+
"date-fns": "^4.1.0",
|
|
55
|
+
"embla-carousel-react": "^8.6.0",
|
|
56
|
+
"input-otp": "^1.4.2",
|
|
57
|
+
"next-themes": "^0.4.6",
|
|
58
|
+
"react-day-picker": "^9.14.0",
|
|
59
|
+
"react-resizable-panels": "^3.0.6",
|
|
60
|
+
"recharts": "^3.7.0",
|
|
61
|
+
"sonner": "^2.0.7",
|
|
62
|
+
"tailwind-merge": "^3.5.0",
|
|
63
|
+
"tailwindcss-animate": "^1.0.7",
|
|
64
|
+
"vaul": "^1.1.2",
|
|
65
|
+
"zod": "^4.3.6"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"@hookform/resolvers": "^3.9.0",
|
|
69
|
+
"@radix-ui/react-accordion": "^1.2.0",
|
|
70
|
+
"@radix-ui/react-alert-dialog": "^1.1.1",
|
|
71
|
+
"@radix-ui/react-aspect-ratio": "^1.1.0",
|
|
72
|
+
"@radix-ui/react-avatar": "^1.1.0",
|
|
73
|
+
"@radix-ui/react-checkbox": "^1.1.1",
|
|
74
|
+
"@radix-ui/react-collapsible": "^1.1.0",
|
|
75
|
+
"@radix-ui/react-context-menu": "^2.2.1",
|
|
76
|
+
"@radix-ui/react-dialog": "^1.1.2",
|
|
77
|
+
"@radix-ui/react-dropdown-menu": "^2.1.1",
|
|
78
|
+
"@radix-ui/react-hover-card": "^1.1.1",
|
|
79
|
+
"@radix-ui/react-label": "^2.1.0",
|
|
80
|
+
"@radix-ui/react-menubar": "^1.1.1",
|
|
81
|
+
"@radix-ui/react-navigation-menu": "^1.2.0",
|
|
82
|
+
"@radix-ui/react-popover": "^1.1.1",
|
|
83
|
+
"@radix-ui/react-progress": "^1.1.0",
|
|
84
|
+
"@radix-ui/react-radio-group": "^1.2.0",
|
|
85
|
+
"@radix-ui/react-scroll-area": "^1.1.0",
|
|
86
|
+
"@radix-ui/react-select": "^2.1.1",
|
|
87
|
+
"@radix-ui/react-separator": "^1.1.0",
|
|
88
|
+
"@radix-ui/react-slider": "^1.2.0",
|
|
89
|
+
"@radix-ui/react-slot": "^1.1.0",
|
|
90
|
+
"@radix-ui/react-switch": "^1.1.0",
|
|
91
|
+
"@radix-ui/react-tabs": "^1.1.0",
|
|
92
|
+
"@radix-ui/react-toast": "^1.2.1",
|
|
93
|
+
"@radix-ui/react-toggle": "^1.1.0",
|
|
94
|
+
"@radix-ui/react-toggle-group": "^1.1.0",
|
|
95
|
+
"@radix-ui/react-tooltip": "^1.1.4",
|
|
96
|
+
"@tanstack/react-query": "^5.56.2",
|
|
97
|
+
"lucide-react": "^0.462.0",
|
|
98
|
+
"react": "^18.3.1",
|
|
99
|
+
"react-dom": "^18.3.1",
|
|
100
|
+
"react-hook-form": "^7.53.0",
|
|
101
|
+
"react-router-dom": "^6.26.2 || ^7"
|
|
102
|
+
},
|
|
103
|
+
"devDependencies": {
|
|
104
|
+
"@tailwindcss/typography": "^0.5.19",
|
|
105
|
+
"@types/node": "^20.0.0",
|
|
106
|
+
"@types/react": "^18.3.0",
|
|
107
|
+
"@types/react-dom": "^18.3.0",
|
|
108
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
109
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
110
|
+
"autoprefixer": "^10.4.27",
|
|
111
|
+
"eslint": "^8.57.0",
|
|
112
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
113
|
+
"eslint-plugin-react-refresh": "^0.4.14",
|
|
114
|
+
"globals": "^15.0.0",
|
|
115
|
+
"postcss": "^8.5.8",
|
|
116
|
+
"tailwindcss": "^3.4.17",
|
|
117
|
+
"typescript": "^5.4.0",
|
|
118
|
+
"vite": "^4.5.4",
|
|
119
|
+
"vite-plugin-css-injected-by-js": "^3.0.0",
|
|
120
|
+
"vite-plugin-dts": "^3.9.0"
|
|
121
|
+
}
|
|
122
|
+
}
|