Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions client/packages/lowcoder/src/api/licenseRequestApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import axios from "axios";

export interface LicenseRequestData {
contactData: {
companyName: string;
address: string;
registerNumber: string;
contactName: string;
contactEmail: string;
contactPhone: string;
taxId?: string;
vatId?: string;
organizationId: string;
};
licenseType: 'per-api-calls' | 'per-instance';
licenseData: {
apiCallLimit?: number;
instanceCount?: number;
currentApiUsage?: number;
lastMonthApiUsage?: number;
};
organizationId: string;
deploymentIds: string[];
}

export interface LicenseRequestResponse {
success: boolean;
message: string;
requestId?: string;
estimatedResponseTime?: string;
}

/**
* Submit a license request to flow.lowcoder.cloud
* @param data The license request data
* @returns Promise with the response
*/
export const submitLicenseRequest = async (data: LicenseRequestData): Promise<LicenseRequestResponse> => {
try {
// TODO: Replace with actual endpoint when available
const response = await axios.post('https://flow.lowcoder.cloud/api/license-requests', data, {
headers: {
'Content-Type': 'application/json',
},
timeout: 30000, // 30 second timeout
});

return response.data;
} catch (error) {
console.error('License request submission failed:', error);

// For now, simulate a successful response since the endpoint doesn't exist yet
if (axios.isAxiosError(error) && error.code === 'ECONNREFUSED') {
// Simulate successful submission for development/testing
return {
success: true,
message: 'License request submitted successfully (simulated)',
requestId: `sim-${Date.now()}`,
estimatedResponseTime: '24-48 hours',
};
}

throw new Error('Failed to submit license request. Please try again later.');
}
};

/**
* Get the status of a license request
* @param requestId The request ID
* @returns Promise with the status
*/
export const getLicenseRequestStatus = async (requestId: string): Promise<any> => {
try {
// TODO: Replace with actual endpoint when available
const response = await axios.get(`https://flow.lowcoder.cloud/api/license-requests/${requestId}`);
return response.data;
} catch (error) {
console.error('Failed to get license request status:', error);
throw new Error('Failed to get request status');
}
};
36 changes: 36 additions & 0 deletions client/packages/lowcoder/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2931,6 +2931,42 @@ export const en = {
"readMoreButton" : "Enterprise Edition Details",
"requestLicense" : "Request Enterprise Edition Licenses",
"requestLicensesBtton" : "Unlock Enterprise Features",
"licenseRequest": {
"title": "Request Enterprise Licenses",
"companyDetails": "Company Details",
"licenseSelection": "License Selection",
"reviewSubmit": "Review & Submit",
"requestSubmitted": "Request Submitted",
"companyName": "Company Name",
"address": "Address",
"registerNumber": "Register Number",
"contactPerson": "Contact Person",
"contactEmail": "Contact Email",
"contactPhone": "Contact Phone",
"taxId": "Tax ID",
"vatId": "VAT ID",
"licenseType": "License Type",
"perApiCalls": "Per API Calls",
"perInstance": "Per Instance",
"apiCallLimit": "Monthly API Call Limit",
"instanceCount": "Number of Instances",
"additionalNotes": "Additional Notes",
"currentUsage": "Current Usage",
"lastMonthUsage": "Last Month Usage",
"currentDeployments": "Current Deployments",
"payBasedOnUsage": "Pay based on API usage volume",
"payPerInstance": "Pay per deployment instance",
"thankYouMessage": "Your license request has been submitted successfully. Our team will review your request and contact you within 24-48 hours.",
"nextSteps": "Next Steps",
"nextStepsDescription": "While you wait for your license, you can:",
"reviewDocs": "Review our Enterprise Edition documentation",
"downloadRelease": "Download the latest Enterprise Edition release",
"checkInstallGuide": "Check out our installation guide",
"submitRequest": "Submit Request",
"back": "Back",
"next": "Next",
"close": "Close"
},
"AuditLogsTitle": "Audit Logs",
"AuditLogsIntroTitle": "Powerful visibility into your workspace activity",
"AuditLogsIntro1": "Audit Logs enable administrators to track exactly what happens across the entire Lowcoder platform. From user sign-ins to app modifications, every relevant action is captured and stored.",
Expand Down
Loading
Loading