Compare commits

...

28 Commits

Author SHA1 Message Date
3a0a713c5a Merge pull request 'update documentserver version to 9.3 in compose files' from 9.3.0-update-compose into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/93
2026-02-18 06:08:08 +00:00
496092c09f update documentserver version to 9.3 in compose files 2026-02-17 15:48:09 +07:00
c0a870458b Merge remote-tracking branch 'remotes/origin/feature/aiautofiller' into release/v9.3.0 2026-02-16 09:46:28 +03:00
35da4e1de1 update autofill plugin 2026-02-16 09:46:03 +03:00
11974256a9 Merge remote-tracking branch 'remotes/origin/feature/aiautofiller' into release/v9.3.0 2026-02-11 13:21:25 +03:00
f69fabb44a nodejs: autofill auto started on Fill mode only 2026-02-11 13:21:05 +03:00
976d7072a9 Merge remote-tracking branch 'remotes/origin/feature/aiautofiller' into release/v9.3.0 2026-02-04 13:33:42 +03:00
8272c83660 update autofill plugin 2026-02-04 13:33:12 +03:00
c73aae1c4b Merge pull request 'fix: disable autofill plugin for 'comment' mode' from feature/aiautofiller into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/document-server-integration/pulls/87
2026-01-30 08:39:00 +00:00
4340c34c23 nodejs: fix lint 2026-01-30 11:38:01 +03:00
3eff9b469b fix: disable autofill plugin for 'comment' mode 2026-01-30 11:37:20 +03:00
eabda30bf7 Merge branch 'feature/aiautofiller' into release/v9.3.0
# Conflicts:
#	.gitmodules
2026-01-21 17:18:43 +03:00
548f24aaff nodejs: update autofill plugin 2026-01-21 17:16:24 +03:00
c1ec722b9f nodejs: anonymous without ai autofill 2026-01-21 17:16:24 +03:00
92a1aff932 nodejs: plugin data update 2026-01-21 17:16:23 +03:00
4fe6e961d3 nodejs: plugin for pdf only 2026-01-21 17:16:23 +03:00
e612717b0b fix: fallback to default plugins 2026-01-21 17:16:23 +03:00
e0e0bc96bf fix(plugins): merge configs with in-line plugin config 2026-01-21 17:16:23 +03:00
c3739fb08a fix: use plugin path without build 2026-01-21 17:16:23 +03:00
c22dbea9bf chore: added additional data 2026-01-21 17:16:23 +03:00
606a14ce8f deps: bumped autofill plugin 2026-01-21 17:16:22 +03:00
4cb50c752b chore: update plugin submodule 2026-01-21 17:16:22 +03:00
c304b5f526 chore: new sample data 2026-01-21 17:16:22 +03:00
f02726d138 refactor: move data to json, build path to the plugin from config 2026-01-21 17:16:22 +03:00
85b0fdc33f chore: strict check 2026-01-21 17:16:22 +03:00
0e8c99aaab fix: do not autostart non edit mode 2026-01-21 17:16:21 +03:00
5a4b47c4bd feat: initial aiautofiller example 2026-01-21 17:16:21 +03:00
9775c8e175 nodejs: support tsv 2026-01-21 17:02:57 +03:00
11 changed files with 369 additions and 9 deletions

5
.gitmodules vendored
View File

@ -5,6 +5,11 @@
[submodule "web/documentserver-example/nodejs/public/assets/document-formats"]
path = web/documentserver-example/nodejs/public/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
branch = release/v9.3.0
[submodule "web/documentserver-example/nodejs/public/assets/plugin-aiautofill"]
path = web/documentserver-example/nodejs/public/assets/plugin-aiautofill
url = https://github.com/ONLYOFFICE/plugin-aiautofill.git
branch = develop
[submodule "web/documentserver-example/csharp-mvc/assets/document-templates"]
path = web/documentserver-example/csharp-mvc/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates

View File

@ -1,5 +1,7 @@
# Change Log
- nodejs: support tsv
## 1.15.0
- php-laravel: fix custom jwt header
- formats for ds v9.1

View File

@ -17,6 +17,7 @@
*/
// connect the necessary packages and modules
const crypto = require('crypto');
const express = require('express');
const path = require('path');
const favicon = require('serve-favicon');
@ -34,6 +35,7 @@ const documentService = require('./helpers/documentService');
const fileUtility = require('./helpers/fileUtility');
const wopiApp = require('./helpers/wopi/wopiRouting');
const users = require('./helpers/users');
const dataAutofill = require('./config/data.json');
const configServer = config.get('server');
const siteUrl = configServer.get('siteUrl');
@ -222,6 +224,18 @@ app.get('/download', (req, res) => { // define a handler for downloading files
filestream.pipe(res); // send file information to the response by streams
});
app.get('/data', (req, res) => { // define a handler for getting sample ai form data
if (!req.query.code) { // integration must validate incoming codes and generate new ones for each data request
res.sendStatus(403);
return;
}
res.send({
data: dataAutofill,
code: crypto.randomBytes(16).toString('hex'),
});
});
app.get('/history', (req, res) => {
req.DocManager = new DocManager(req, res);
if (cfgSignatureEnable && cfgSignatureUseForRequest) {
@ -1132,8 +1146,9 @@ app.get('/editor', (req, res) => { // define a handler for editing document
type = 'desktop';
}
const templatesImageUrl = req.DocManager.getTemplateImageUrl(fileUtility.getFileType(fileName));
const createUrl = req.DocManager.getCreateUrl(fileUtility.getFileType(fileName), userid, type, lang);
const fileType = fileUtility.getFileType(fileName);
const templatesImageUrl = req.DocManager.getTemplateImageUrl(fileType);
const createUrl = req.DocManager.getCreateUrl(fileType, userid, type, lang);
let templates = null;
if (createUrl != null) {
templates = [
@ -1203,6 +1218,38 @@ app.get('/editor', (req, res) => { // define a handler for editing document
user.goback.url = `${req.DocManager.getServerUrl()}/`;
}
let pluginsConfig;
if (fileType === fileUtility.fileType.pdf // pdf form only
&& userid !== 'uid-0' // users only
&& mode !== 'comment') { // form field must be editable
const baseUrl = configServer.has('exampleUrl') && configServer.get('exampleUrl')
? configServer.get('exampleUrl')
: req.DocManager.getServerUrl();
const pluginGuid = 'asc.{0616AE85-5DBE-4B6B-A0A9-455C4F1503AD}';
const pluginCode = crypto.randomBytes(16).toString('hex');
pluginsConfig = {
autostart: [...new Set([
(mode === 'fillForms' ? pluginGuid : []),
...(plugins.autostart || []),
])],
options: {
[pluginGuid]: {
code: pluginCode,
callback: `${baseUrl}/data`,
},
...(plugins.options || {}),
},
pluginsData: [...new Set([
`${baseUrl}/assets/plugin-aiautofill/config.json`,
...(plugins.pluginsData || []),
])],
};
} else {
pluginsConfig = plugins;
}
// file config data
const argss = {
apiUrl: siteUrl + configServer.get('apiUrl'),
@ -1217,7 +1264,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document
},
editor: {
type,
documentType: fileUtility.getFileType(fileName),
documentType: fileType,
key,
token: '',
callbackUrl: req.DocManager.getCallback(fileName),
@ -1248,7 +1295,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document
userInfoGroups: JSON.stringify(userInfoGroups),
fileChoiceUrl,
submitForm,
plugins: JSON.stringify(plugins),
plugins: JSON.stringify(pluginsConfig),
actionData,
fileKey: userid !== 'uid-0'
? JSON.stringify({ fileName, userAddress: req.DocManager.curUserHostAddress() }) : null,

View File

@ -0,0 +1,304 @@
{
"sellers": [
{
"name": "John Anderson",
"email": "john.anderson@example.com",
"phone": "+1-234-567-8900",
"mobile": "+1-234-567-8901",
"address": "123 Main St",
"city": "Chicago",
"state": "IL",
"zip": "60601",
"country": "USA",
"company": "Tech Solutions LLC"
},
{
"name": "Maria Garcia",
"email": "maria.garcia@ventas.es",
"phone": "+34-912-345-678",
"mobile": "+34-600-123-456",
"address": "Calle Mayor 45",
"city": "Madrid",
"state": "Madrid",
"zip": "28013",
"country": "Spain",
"company": "Soluciones Digitales SA"
}
],
"deals": [
{
"name": "Enterprise Software License",
"number": "DL-2025-001",
"date": "2025-01-15",
"closeDate": "2025-03-30",
"status": "pending",
"amount": 125000,
"currency": "USD",
"description": "Annual enterprise software license with premium support package"
},
{
"name": "Cloud Infrastructure Migration",
"number": "DL-2025-002",
"date": "2025-02-10",
"closeDate": "2025-06-15",
"status": "in_progress",
"amount": 450000,
"currency": "EUR",
"description": "Complete cloud migration service with training and support"
}
],
"buyers": [
{
"name": "Jane Mitchell",
"email": "jane.mitchell@techcorp.com",
"phone": "+1-987-654-3210",
"mobile": "+1-987-654-3211",
"address": "321 Park Avenue",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "USA",
"company": "TechCorp International",
"department": "IT"
},
{
"name": "Pierre Dubois",
"email": "p.dubois@innovatech.fr",
"phone": "+33-1-42-34-56-78",
"mobile": "+33-6-12-34-56-78",
"address": "15 Avenue des Champs-Élysées",
"city": "Paris",
"state": "Île-de-France",
"zip": "75008",
"country": "France",
"company": "InnovaTech France",
"department": "Procurement"
}
],
"companies": [
{
"name": "Acme Corporation",
"email": "info@acmecorp.com",
"phone": "+1-312-555-0100",
"website": "https://www.acmecorp.com",
"address": "456 Business Plaza",
"city": "Chicago",
"state": "IL",
"zip": "60602",
"country": "USA",
"industry": "Technology"
},
{
"name": "Global Innovations Ltd",
"email": "contact@globalinnov.co.uk",
"phone": "+44-20-7123-4567",
"website": "https://www.globalinnov.co.uk",
"address": "88 Piccadilly Street",
"city": "London",
"state": "England",
"zip": "W1J 9HF",
"country": "United Kingdom",
"industry": "Consulting"
}
],
"products": [
{
"name": "Premium Software Suite",
"sku": "SW-PREM-001",
"category": "Software",
"quantity": 100,
"price": 999.99,
"currency": "USD",
"description": "Comprehensive software package with all premium features"
},
{
"name": "Professional Laptop",
"sku": "HW-LAP-PRO-15",
"category": "Hardware",
"quantity": 50,
"price": 1499.99,
"currency": "USD",
"description": "15-inch professional laptop with high-performance specs"
},
{
"name": "Cloud Storage Plan - Business",
"sku": "CLD-STR-BIZ-1TB",
"category": "Services",
"quantity": 1,
"price": 29.99,
"currency": "USD",
"description": "1TB cloud storage with business features (monthly subscription)"
}
],
"persons": [
{
"name": "John Anderson",
"firstName": "John",
"middleName": "Michael",
"lastName": "Anderson",
"dateOfBirth": "1990-01-15",
"gender": "Male",
"title": "Senior Software Engineer",
"email": "john.anderson@example.com",
"phone": "+1-234-567-8900",
"mobile": "+1-234-567-8901",
"address": "123 Main Street, Apt 4B",
"city": "Chicago",
"state": "IL",
"zip": "60601",
"country": "USA",
"website": "johnanderson.dev"
},
{
"name": "Yuki Tanaka",
"firstName": "Yuki",
"lastName": "Tanaka",
"dateOfBirth": "1988-07-22",
"gender": "Female",
"title": "UX/UI Designer",
"email": "yuki.tanaka@design.jp",
"phone": "+81-3-1234-5678",
"mobile": "+81-90-1234-5678",
"address": "1-2-3 Shibuya",
"city": "Tokyo",
"state": "Tokyo",
"zip": "150-0002",
"country": "Japan",
"website": "yukitanaka.design"
},
{
"name": "Sarah Johnson",
"firstName": "Sarah",
"lastName": "Johnson",
"employeeId": "ACM-2019-1234",
"personalEmail": "sarah.j.personal@gmail.com",
"department": "Product Development",
"jobPosition": "Senior Product Manager",
"hireDate": "2019-03-15",
"salary": 120000,
"salaryCurrency": "USD"
},
{
"name": "Carlos Rodriguez",
"firstName": "Carlos",
"lastName": "Rodriguez",
"employeeId": "ACM-2020-5678",
"personalEmail": "carlos.rod.personal@gmail.com",
"department": "Engineering",
"jobPosition": "DevOps Engineer",
"hireDate": "2020-07-20",
"salary": 105000,
"salaryCurrency": "USD"
}
],
"invoices": [
{
"number": "INV-2025-0001",
"date": "2025-01-15",
"dueDate": "2025-02-15",
"status": "paid",
"subtotal": 10000,
"tax": 800,
"taxRate": 8,
"discount": 500,
"total": 10300,
"currency": "USD",
"notes": "Payment received on time. Thank you for your business!",
"items": [
{
"productId": "P001",
"description": "Premium Software Suite - 10 licenses",
"quantity": 10,
"unitPrice": 999.99,
"total": 9999.90
}
]
},
{
"number": "INV-2025-0002",
"date": "2025-02-01",
"dueDate": "2025-03-01",
"status": "pending",
"subtotal": 75000,
"tax": 6000,
"taxRate": 8,
"discount": 0,
"total": 81000,
"currency": "USD",
"notes": "Payment terms: Net 30 days",
"items": [
{
"productId": "P002",
"description": "Professional Laptop - 50 units",
"quantity": 50,
"unitPrice": 1499.99,
"total": 74999.50
}
]
}
],
"customers": [
{
"type": "individual",
"firstName": "Emily",
"lastName": "Chen",
"email": "emily.chen@email.com",
"phone": "+1-555-111-2222",
"dateOfBirth": "1985-09-14",
"registrationDate": "2023-01-10",
"totalOrders": 15,
"totalSpent": 4500.75,
"address": {
"street": "567 Oak Street",
"city": "Seattle",
"state": "WA",
"zip": "98101",
"country": "USA"
}
},
{
"type": "business",
"companyName": "TechStart Solutions",
"contactPerson": "Robert Kim",
"email": "robert.kim@techstart.com",
"phone": "+1-555-333-4444",
"registrationDate": "2022-06-20",
"totalOrders": 42,
"totalSpent": 125000.00,
"address": {
"street": "890 Enterprise Boulevard",
"city": "Austin",
"state": "TX",
"zip": "78701",
"country": "USA"
}
}
],
"events": [
{
"name": "Annual Tech Conference 2025",
"type": "conference",
"startDate": "2025-06-15",
"endDate": "2025-06-17",
"startTime": "09:00",
"endTime": "18:00",
"timezone": "America/New_York",
"location": {
"name": "Convention Center",
"address": "100 Convention Plaza",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "USA"
},
"capacity": 5000,
"registered": 3500,
"status": "upcoming",
"organizer": "Tech Events Inc",
"description": "Join us for the biggest tech conference of the year featuring keynotes from industry leaders.",
"ticketPrice": 299.00,
"currency": "USD",
"website": "https://techconf2025.com"
}
]
}

View File

@ -116,6 +116,7 @@ const descrUser0 = [
'Has empty role',
'Can\'t submit forms',
'Tour of tips when opening a document',
'Without AI Auto Fill Plugin',
];
const users = [

View File

@ -11,7 +11,7 @@ services:
documentserver:
container_name: documentserver
image: onlyoffice/documentserver:8.2
image: onlyoffice/documentserver:9.3
expose:
- "80"
environment:

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
documentserver:
container_name: documentserver
image: onlyoffice/documentserver:8.2
image: onlyoffice/documentserver:9.3
expose:
- "80"
environment:

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
documentserver:
container_name: documentserver
image: onlyoffice/documentserver:8.2
image: onlyoffice/documentserver:9.3
expose:
- "80"
environment:

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
documentserver:
container_name: documentserver
image: onlyoffice/documentserver:8.2
image: onlyoffice/documentserver:9.3
expose:
- "80"
environment: