xlport 0.3.3 → 0.4.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/.vscode/launch.json +15 -0
- package/dist/lib/client.d.ts +5 -3
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/client.js +101 -200
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/export.types.d.ts +3 -3
- package/dist/lib/export.types.d.ts.map +1 -1
- package/dist/lib/export.types.js +1 -1
- package/dist/lib/export.types.js.map +1 -1
- package/dist/lib/import.types.d.ts +3 -3
- package/dist/lib/import.types.d.ts.map +1 -1
- package/dist/lib/shared.types.d.ts +1 -1
- package/dist/lib/shared.types.d.ts.map +1 -1
- package/package.json +15 -11
- package/tests/client/additional/data-validation/expected.xlsx +0 -0
- package/tests/client/additional/data-validation/request.json +23 -0
- package/tests/client/additional/data-validation/result.xlsx +0 -0
- package/tests/client/additional/data-validation/template.xlsx +0 -0
- package/tests/client/additional/lookup/expected.xlsx +0 -0
- package/tests/client/additional/lookup/request.json +23 -0
- package/tests/client/additional/lookup/result.xlsx +0 -0
- package/tests/client/client.e2e.spec.ts +13 -5
- package/tests/client/export/1object/expected.xlsx +0 -0
- package/tests/client/export/1table/expected.xlsx +0 -0
- package/tests/client/export/1table/request.json +1 -1
- package/tests/client/export/1table/template.xlsx +0 -0
- package/tests/client/export/thirdXlPort2Test/expected.xlsx +0 -0
- package/tests/client/export/thirdXlPort2Test/request.json +2 -0
- package/tests/client/export/v2-formats/expected.xlsx +0 -0
- package/tests/client/export/v2-formats/template.xlsx +0 -0
- package/tests/client/import/1object/expected.json +1 -10
- package/tests/client/import/1object/workbook.xlsx +0 -0
- package/tests/client/import/1table/expected.json +1 -39
- package/tests/client/import/1table/workbook.xlsx +0 -0
- package/tests/client/import/1table-10col-100rows/expected.json +1 -1306
- package/tests/client/import/1table-10col-100rows/workbook.xlsx +0 -0
- package/tests/client/import/Country Demo - Malaria Scorecard - Northern Province (2).xlsx +0 -0
- package/tests/client/import/Region 1 - Scorecard 1 - Q1_2009.xlsx +0 -0
- package/tests/client/import/v2importMultipleSheets/expected.json +1 -0
- package/tests/client/import/v2importMultipleSheets/workbook.xlsx +0 -0
- package/tests/tsconfig.json +2 -1
- package/tsconfig.json +4 -4
- package/dist/client.d.ts +0 -23
- package/dist/client.js +0 -98
- package/dist/client.js.map +0 -1
- package/dist/export.types.d.ts +0 -53
- package/dist/export.types.js +0 -3
- package/dist/export.types.js.map +0 -1
- package/dist/import.types.d.ts +0 -25
- package/dist/import.types.js +0 -11
- package/dist/import.types.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -21
- package/dist/index.js.map +0 -1
- package/dist/shared.types.d.ts +0 -1
- package/dist/shared.types.js +0 -3
- package/dist/shared.types.js.map +0 -1
- package/dist/tests/client/client.e2e.spec.d.ts +0 -1
- package/dist/tests/client/client.e2e.spec.js +0 -109
- package/dist/tests/client/client.e2e.spec.js.map +0 -1
- package/dist/tests/client/export/simple-export/request.json +0 -6
- package/dist/tests/client/import/1object/expected.json +0 -10
- package/dist/tests/client/import/1table/expected.json +0 -39
- package/dist/tests/client/import/1table-10col-100rows/expected.json +0 -1306
- package/dist/tests/client/import/multipleObjects/expected.json +0 -20
- package/dist/tests/client/import/multipleObjectsAndTables/expected.json +0 -84
- package/dist/tests/types/export/column-formatting.json +0 -151
- package/dist/tests/types/export/date.json +0 -6
- package/dist/tests/types/export/days.json +0 -7
- package/dist/tests/types/export/formats.json +0 -169
- package/dist/tests/types/export/formulas-and-lookups.json +0 -9
- package/dist/tests/types/export/multi-column-with-fixed-column.json +0 -24
- package/dist/tests/types/export/multi-sheet-column-fixed-topleft.json +0 -59
- package/dist/tests/types/export/multi-sheet-column-fixed.json +0 -59
- package/dist/tests/types/export/multi-sheet-column-simple-dash.json +0 -97
- package/dist/tests/types/export/multi-sheet-column-simple.json +0 -68
- package/dist/tests/types/export/multi-sheet-column.json +0 -68
- package/dist/tests/types/export/multi-sheet-simple.json +0 -41
- package/dist/tests/types/export/multiple-objects-and-tables.json +0 -83
- package/dist/tests/types/export/multiple-objects.json +0 -20
- package/dist/tests/types/export/multiple-tables.json +0 -88
- package/dist/tests/types/export/object.json +0 -11
- package/dist/tests/types/export/query-table-simple.json +0 -12
- package/dist/tests/types/export/query-table.json +0 -27
- package/dist/tests/types/export/sheets.json +0 -6
- package/dist/tests/types/export/table-with-calculations.json +0 -27
- package/dist/tests/types/export/table.json +0 -40
- package/dist/tests/types/export/utc.json +0 -7
- package/dist/tests/types/export.test.d.ts +0 -26
- package/dist/tests/types/export.test.js +0 -48
- package/dist/tests/types/export.test.js.map +0 -1
- package/dist/tests/types/import/large-table.json +0 -1
- package/dist/tests/types/import/multisheet.json +0 -1
- package/dist/tests/types/import/object.json +0 -1
- package/dist/tests/types/import/table.json +0 -1
- package/dist/tests/types/import.test.d.ts +0 -5
- package/dist/tests/types/import.test.js +0 -12
- package/dist/tests/types/import.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/tests/client/export/1table/test.xlsx +0 -0
- package/tests/client/export/formats/expected.xlsx +0 -0
- package/tests/client/export/formats/template.xlsx +0 -0
- package/tests/client/export/secondXlPort2Test/~$expected.xlsx +0 -0
- package/tests/client/export/thirdXlPort2Test/~$expected.xlsx +0 -0
- package/tests/client/export/thirdXlPort2Test/~$template.xlsx +0 -0
- package/tests/client/export/v2-column-formatting/~$expected.xlsx +0 -0
- package/tests/client/export/v2-column-formatting/~$template.xlsx +0 -0
- package/tests/client/import/1object/Source.xlsx +0 -0
- package/tests/client/import/1object/data.xlsx +0 -0
- package/tests/client/import/1object/request.json +0 -10
- package/tests/client/import/1table/Source.xlsx +0 -0
- package/tests/client/import/1table/data.xlsx +0 -0
- package/tests/client/import/1table/request.json +0 -15
- package/tests/client/import/1table-10col-100rows/Source.xlsx +0 -0
- package/tests/client/import/1table-10col-100rows/data.xlsx +0 -0
- package/tests/client/import/1table-10col-100rows/request.json +0 -17
- /package/tests/client/{export/lookup/lookup.xlsx → additional/lookup/template.xlsx} +0 -0
- /package/tests/client/export/{formats → v2-formats}/request.json +0 -0
- /package/tests/client/import/multipleObjects/{Source.xlsx → workbook.xlsx} +0 -0
- /package/tests/client/import/multipleObjectsAndTables/{Source.xlsx → workbook.xlsx} +0 -0
|
@@ -79,16 +79,24 @@ describe('Client', () => {
|
|
|
79
79
|
|
|
80
80
|
it('should import data - 1object', async () => {
|
|
81
81
|
const client = getClient()
|
|
82
|
-
const result = await client.importFromFile('./tests/client/import/1object/
|
|
82
|
+
const result = await client.importFromFile('./tests/client/import/1object/workbook.xlsx')
|
|
83
83
|
expect(result.status).toBe('success')
|
|
84
84
|
if (result.status === 'success') {
|
|
85
85
|
expect(result.data.properties).toEqual(import1Object.properties)
|
|
86
86
|
}
|
|
87
87
|
})
|
|
88
88
|
|
|
89
|
+
it.only('should import data - alma data', async () => {
|
|
90
|
+
const client = getClient()
|
|
91
|
+
const result = await client.importFromFile('./tests/client/import/Region 1 - Scorecard 1 - Q1_2009.xlsx')
|
|
92
|
+
expect(result.status).toBe('success')
|
|
93
|
+
// if (result.status === 'success') {
|
|
94
|
+
// expect(result.data.properties).toEqual(import1Object.properties)
|
|
95
|
+
// }
|
|
96
|
+
})
|
|
89
97
|
it('should import data - 1table', async () => {
|
|
90
98
|
const client = getClient()
|
|
91
|
-
const result = await client.importFromFile('./tests/client/import/1table/
|
|
99
|
+
const result = await client.importFromFile('./tests/client/import/1table/workbook.xlsx')
|
|
92
100
|
expect(result.status).toBe('success')
|
|
93
101
|
if (result.status === 'success') {
|
|
94
102
|
expect(result.data.tables).toEqual(import1Table.tables)
|
|
@@ -96,7 +104,7 @@ describe('Client', () => {
|
|
|
96
104
|
})
|
|
97
105
|
it('should import data - large table', async () => {
|
|
98
106
|
const client = getClient()
|
|
99
|
-
const result = await client.importFromFile('./tests/client/import/1table-10col-100rows/
|
|
107
|
+
const result = await client.importFromFile('./tests/client/import/1table-10col-100rows/workbook.xlsx')
|
|
100
108
|
expect(result.status).toBe('success')
|
|
101
109
|
if (result.status === 'success') {
|
|
102
110
|
expect(roundNumbers(result.data.tables)).toEqual(roundNumbers(importLargeTable.tables))
|
|
@@ -104,7 +112,7 @@ describe('Client', () => {
|
|
|
104
112
|
})
|
|
105
113
|
it('should import data - multipleObjects', async () => {
|
|
106
114
|
const client = getClient()
|
|
107
|
-
const result = await client.importFromFile('./tests/client/import/multipleObjects/
|
|
115
|
+
const result = await client.importFromFile('./tests/client/import/multipleObjects/workbook.xlsx')
|
|
108
116
|
expect(result.status).toBe('success')
|
|
109
117
|
if (result.status === 'success') {
|
|
110
118
|
expect(result.data.properties).toEqual(importMultipleObjects.properties)
|
|
@@ -112,7 +120,7 @@ describe('Client', () => {
|
|
|
112
120
|
})
|
|
113
121
|
it('should import data - multipleObjectsAndTables', async () => {
|
|
114
122
|
const client = getClient()
|
|
115
|
-
const result = await client.importFromFile('./tests/client/import/multipleObjectsAndTables/
|
|
123
|
+
const result = await client.importFromFile('./tests/client/import/multipleObjectsAndTables/workbook.xlsx')
|
|
116
124
|
expect(result.status).toBe('success')
|
|
117
125
|
if (result.status === 'success') {
|
|
118
126
|
expect(result.data.properties).toEqual(importMultipleObjectsAndTables.properties)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"fromTemplateSheet": "Project",
|
|
71
71
|
"tabColor": "#00FF00",
|
|
72
72
|
"data": {
|
|
73
|
+
"ProjectLabel":"Label 2",
|
|
73
74
|
"dummy": "dummy value"
|
|
74
75
|
}
|
|
75
76
|
},
|
|
@@ -78,6 +79,7 @@
|
|
|
78
79
|
"fromTemplateSheet": "Project",
|
|
79
80
|
"tabColor": "#0000FF",
|
|
80
81
|
"data": {
|
|
82
|
+
"ProjectLabel":"Label X",
|
|
81
83
|
"dummy": "dummy value"
|
|
82
84
|
}
|
|
83
85
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"properties": {
|
|
3
|
-
"Boolean": true,
|
|
4
|
-
"Float": -143242.25,
|
|
5
|
-
"Integer": 114325352,
|
|
6
|
-
"LastUpdated": "2019-01-01T00:00:00.000Z",
|
|
7
|
-
"ProjectId": "pid1",
|
|
8
|
-
"ProjectLabel": "Project Name"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
{"tables":{},"properties":{"Integer":1.14325352E8,"Float":-143242.25,"ProjectId":"pid1","LastUpdated":"2019-01-01T00:00:00.000Z","Boolean":true,"ProjectLabel":"Project Name"}}
|
|
Binary file
|
|
@@ -1,39 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"tables": {
|
|
3
|
-
"Initiatives": [
|
|
4
|
-
{
|
|
5
|
-
"Id": "uuidInitiative1",
|
|
6
|
-
"Name": "Initiative 1",
|
|
7
|
-
"StatusId": "uuidStatus1",
|
|
8
|
-
"SavingsPotential": 123.3,
|
|
9
|
-
"Achievement": 0.12,
|
|
10
|
-
"IsComplete": false,
|
|
11
|
-
"Date": "2018-04-11T00:00:00.000Z",
|
|
12
|
-
"Integer": 1,
|
|
13
|
-
"Calculated column": 146.727
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"Id": "uuidInitiative2",
|
|
17
|
-
"Name": "Initiative 2",
|
|
18
|
-
"StatusId": "uuidStatus2",
|
|
19
|
-
"SavingsPotential": null,
|
|
20
|
-
"Achievement": 0,
|
|
21
|
-
"IsComplete": true,
|
|
22
|
-
"Date": "1966-05-01T00:00:00.000Z",
|
|
23
|
-
"Integer": -246537347,
|
|
24
|
-
"Calculated column": 0
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"Id": "uuidInitiative3",
|
|
28
|
-
"Name": "Initiative 3",
|
|
29
|
-
"StatusId": "uuidStatus3",
|
|
30
|
-
"SavingsPotential": 456,
|
|
31
|
-
"Achievement": 0.2,
|
|
32
|
-
"IsComplete": false,
|
|
33
|
-
"Date": "2020-01-01T00:00:00.000Z",
|
|
34
|
-
"Integer": 1324275242,
|
|
35
|
-
"Calculated column": 542.64
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
{"tables":{"Initiatives":[{"Integer":1,"SavingsPotential":123.3,"Calculated column":146.727,"StatusId":"uuidStatus1","Id":"uuidInitiative1","Achievement":0.12,"IsComplete":false,"Date":"2018-04-11T00:00:00.000Z","Name":"Initiative 1"},{"Integer":-2.46537347E8,"SavingsPotential":null,"Calculated column":0,"StatusId":"uuidStatus2","Id":"uuidInitiative2","Achievement":0,"IsComplete":true,"Date":"1966-05-01T00:00:00.000Z","Name":"Initiative 2"},{"Integer":1.324275242E9,"SavingsPotential":456,"Calculated column":542.64,"StatusId":"uuidStatus3","Id":"uuidInitiative3","Achievement":0.2,"IsComplete":false,"Date":"2020-01-01T00:00:00.000Z","Name":"Initiative 3"}]},"properties":{}}
|
|
Binary file
|