@leapdev/app-platform 0.1.0-beta.27 → 0.1.0-beta.29

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.
Files changed (26) hide show
  1. package/package.json +2 -2
  2. package/src/index.d.ts +2 -0
  3. package/src/index.js +3 -0
  4. package/src/lib/app-platform.d.ts +9 -0
  5. package/src/lib/app-platform.js +34 -35
  6. package/src/lib/domains/leap-document-data/index.d.ts +8 -0
  7. package/src/lib/domains/leap-document-data/index.js +11 -0
  8. package/src/lib/domains/leap-document-data/leap-document-data.model.d.ts +7 -0
  9. package/src/lib/domains/leap-document-data/leap-document-data.model.js +11 -0
  10. package/src/lib/domains/leap-document-data/leap-document-data.normalizer.d.ts +19 -0
  11. package/src/lib/domains/leap-document-data/leap-document-data.normalizer.js +101 -0
  12. package/src/lib/domains/leap-document-data/leap-document-data.service.d.ts +90 -0
  13. package/src/lib/domains/leap-document-data/leap-document-data.service.js +156 -0
  14. package/src/lib/models/leap.model.d.ts +3 -0
  15. package/src/lib/ports/adapters/excel-custom-xml-part.adapter.d.ts +15 -0
  16. package/src/lib/ports/adapters/excel-custom-xml-part.adapter.js +113 -0
  17. package/src/lib/ports/adapters/in-memory-custom-xml-part.adapter.d.ts +22 -0
  18. package/src/lib/ports/adapters/in-memory-custom-xml-part.adapter.js +52 -0
  19. package/src/lib/ports/adapters/word-custom-xml-part.adapter.d.ts +16 -0
  20. package/src/lib/ports/adapters/word-custom-xml-part.adapter.js +118 -0
  21. package/src/lib/ports/custom-xml-part.port.d.ts +44 -0
  22. package/src/lib/ports/custom-xml-part.port.js +2 -0
  23. package/src/lib/ports/index.d.ts +7 -0
  24. package/src/lib/ports/index.js +10 -0
  25. package/src/types.d.ts +3 -2
  26. package/src/types.js +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leapdev/app-platform",
3
- "version": "0.1.0-beta.27",
3
+ "version": "0.1.0-beta.29",
4
4
  "dependencies": {
5
5
  "tslib": "^2.3.0",
6
6
  "vkbeautify": "^0.99.3",
@@ -14,4 +14,4 @@
14
14
  "type": "commonjs",
15
15
  "main": "./src/index.js",
16
16
  "typings": "./src/index.d.ts"
17
- }
17
+ }
package/src/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { EvaluatePathsRequest } from './lib/models';
2
2
  import { HostApplicationType, LeapDocumentData } from './lib/models/leap.model';
3
3
  export * from './types';
4
+ export * from './lib/ports';
5
+ export * from './lib/domains/leap-document-data';
4
6
  export declare const initAppPlatform: (hostApplicationType: HostApplicationType, skipLeapEventsSetup?: boolean) => Promise<{
5
7
  done: boolean;
6
8
  openViaLEAP: boolean;
package/src/index.js CHANGED
@@ -4,6 +4,9 @@ exports.saveDocument = exports.setBookmarkViaSignalR = exports.openMatterViaSign
4
4
  const tslib_1 = require("tslib");
5
5
  const app_platform_1 = require("./lib/app-platform");
6
6
  tslib_1.__exportStar(require("./types"), exports);
7
+ // Export domain pattern: ports, adapters, and domain services
8
+ tslib_1.__exportStar(require("./lib/ports"), exports);
9
+ tslib_1.__exportStar(require("./lib/domains/leap-document-data"), exports);
7
10
  const appPlatform = new app_platform_1.AppPlatform();
8
11
  const initAppPlatform = (hostApplicationType, skipLeapEventsSetup = false) => {
9
12
  return appPlatform.init(hostApplicationType, skipLeapEventsSetup);
@@ -10,6 +10,11 @@ export declare class AppPlatform {
10
10
  private signalRService;
11
11
  private _openViaLEAP;
12
12
  constructor();
13
+ /**
14
+ * Get the session-scoped LeapDocumentDataService.
15
+ * Throws if init() was not called with a valid host.
16
+ */
17
+ private getLeapDocumentDataService;
13
18
  init(hostApplicationType: HostApplicationType, skipLeapEventsSetup: boolean, force?: boolean): Promise<{
14
19
  done: boolean;
15
20
  openViaLEAP: boolean;
@@ -40,6 +45,10 @@ export declare class AppPlatform {
40
45
  tables: unknown[];
41
46
  }): Promise<boolean>;
42
47
  getDocumentData(): Promise<LeapDocumentData | null>;
48
+ /**
49
+ * @deprecated Use getDocumentData() instead. The host is now determined by init().
50
+ * This method will be removed in a future version.
51
+ */
43
52
  getExcelDocumentData(): Promise<LeapDocumentData | null>;
44
53
  setDocumentData(params: {
45
54
  documentData: LeapDocumentData;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
- var _AppPlatform_authService, _AppPlatform_signalRInitData, _AppPlatform_initialized, _AppPlatform_connectedToSignalR;
2
+ var _AppPlatform_leapDocumentDataService, _AppPlatform_authService, _AppPlatform_signalRInitData, _AppPlatform_initialized, _AppPlatform_connectedToSignalR, _AppPlatform_hostApplicationType;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.AppPlatform = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const helpers_1 = require("./functions/helpers");
7
+ const leap_document_data_1 = require("./domains/leap-document-data");
7
8
  const constants_1 = require("./models/constants");
8
9
  const leap_events_model_1 = require("./models/leap-events.model");
9
10
  const leap_model_1 = require("./models/leap.model");
@@ -11,28 +12,45 @@ const services_1 = require("./services");
11
12
  const auth_service_1 = require("./services/auth/auth.service");
12
13
  const promise_helper_function_1 = require("./services/calc-api/promise-helper.function");
13
14
  const custom_xml_part_service_1 = require("./services/custom-xml-part.service");
14
- const excel_custom_xml_part_service_1 = require("./services/excel-custom-xml-part.service");
15
15
  const leap_events_service_1 = require("./services/leap-events.service");
16
16
  const signalr_service_1 = require("./services/signalr/signalr.service");
17
17
  class AppPlatform {
18
18
  constructor() {
19
+ _AppPlatform_leapDocumentDataService.set(this, null);
19
20
  this._openViaLEAP = false;
20
21
  _AppPlatform_authService.set(this, null);
21
22
  _AppPlatform_signalRInitData.set(this, null);
22
23
  _AppPlatform_initialized.set(this, false);
23
24
  _AppPlatform_connectedToSignalR.set(this, false);
25
+ _AppPlatform_hostApplicationType.set(this, null);
24
26
  this.loggerService = new services_1.LoggerService(false);
25
27
  this.leapEventsService = new leap_events_service_1.LeapEventsService();
26
28
  this.calcWordService = new services_1.CalcWordService(this.leapEventsService, this.loggerService);
27
29
  this.documentService = new services_1.DocumentService(this.leapEventsService, this.loggerService);
28
30
  this.signalRService = new signalr_service_1.SignalRService();
29
31
  }
32
+ /**
33
+ * Get the session-scoped LeapDocumentDataService.
34
+ * Throws if init() was not called with a valid host.
35
+ */
36
+ getLeapDocumentDataService() {
37
+ if (!tslib_1.__classPrivateFieldGet(this, _AppPlatform_hostApplicationType, "f")) {
38
+ throw new Error('AppPlatform.init() must be called with a valid host before accessing document data. ' +
39
+ 'Call initAppPlatform(HostApplicationType) first.');
40
+ }
41
+ if (!tslib_1.__classPrivateFieldGet(this, _AppPlatform_leapDocumentDataService, "f")) {
42
+ tslib_1.__classPrivateFieldSet(this, _AppPlatform_leapDocumentDataService, new leap_document_data_1.LeapDocumentDataService(tslib_1.__classPrivateFieldGet(this, _AppPlatform_hostApplicationType, "f")), "f");
43
+ }
44
+ return tslib_1.__classPrivateFieldGet(this, _AppPlatform_leapDocumentDataService, "f");
45
+ }
30
46
  init(hostApplicationType, skipLeapEventsSetup, force = false) {
31
47
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
32
48
  try {
33
49
  if (tslib_1.__classPrivateFieldGet(this, _AppPlatform_initialized, "f") && !force) {
34
50
  return { done: true, openViaLEAP: this._openViaLEAP };
35
51
  }
52
+ // Store host for session-scoped document data service
53
+ tslib_1.__classPrivateFieldSet(this, _AppPlatform_hostApplicationType, hostApplicationType, "f");
36
54
  let openViaLEAP = false;
37
55
  switch (hostApplicationType) {
38
56
  case leap_model_1.HostApplicationType.MicrosoftWord:
@@ -112,17 +130,8 @@ class AppPlatform {
112
130
  getHostInfo(params) {
113
131
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
114
132
  try {
115
- let documentData = null;
116
- switch (params.hostApplicationType) {
117
- case leap_model_1.HostApplicationType.MicrosoftWord: {
118
- documentData = yield this.getDocumentData();
119
- break;
120
- }
121
- case leap_model_1.HostApplicationType.MicrosoftExcel: {
122
- documentData = yield this.getExcelDocumentData();
123
- break;
124
- }
125
- }
133
+ // Use session-scoped document data service (host passed at init)
134
+ const documentData = yield this.getDocumentData();
126
135
  if (documentData && documentData.hostType) {
127
136
  return {
128
137
  hostType: documentData.hostType,
@@ -254,11 +263,8 @@ class AppPlatform {
254
263
  getDocumentData() {
255
264
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
256
265
  try {
257
- const data = yield (0, custom_xml_part_service_1.getDataByNamespace)(constants_1.constants.LeapDocumentDataNamespace);
258
- if (data) {
259
- return data;
260
- }
261
- return null;
266
+ const service = this.getLeapDocumentDataService();
267
+ return yield service.get();
262
268
  }
263
269
  catch (error) {
264
270
  this.loggerService.error(`[ERROR] Get Document Data: ${error}`);
@@ -266,16 +272,14 @@ class AppPlatform {
266
272
  }
267
273
  });
268
274
  }
275
+ /**
276
+ * @deprecated Use getDocumentData() instead. The host is now determined by init().
277
+ * This method will be removed in a future version.
278
+ */
269
279
  getExcelDocumentData() {
270
280
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
271
- try {
272
- const data = yield (0, excel_custom_xml_part_service_1.getDataByNamespace)(constants_1.constants.LeapDocumentDataNamespace);
273
- return data;
274
- }
275
- catch (error) {
276
- this.loggerService.error(`[ERROR] Get Excel Document Data: ${error}`);
277
- return null;
278
- }
281
+ this.loggerService.warn('[DEPRECATED] getExcelDocumentData() is deprecated. Use getDocumentData() instead.');
282
+ return this.getDocumentData();
279
283
  });
280
284
  }
281
285
  setDocumentData(params) {
@@ -286,14 +290,9 @@ class AppPlatform {
286
290
  this.loggerService.log(`[setDocumentData] Document not open via LEAP`);
287
291
  return false;
288
292
  }
289
- const leapDocumentDataXml = `<?xml version="1.0"?>
290
- <${constants_1.constants.LeapDocumentDataRootTagName} xmlns="${constants_1.constants.LeapDocumentDataNamespace}">
291
- ${Object.entries(documentData)
292
- .map(([key, value]) => ` <${key}>${value}</${key}>`)
293
- .join('\n')}
294
- </${constants_1.constants.LeapDocumentDataRootTagName}>`;
295
- const data = yield (0, custom_xml_part_service_1.updateXmlDataByNamespace)(constants_1.constants.LeapDocumentDataNamespace, leapDocumentDataXml, constants_1.constants.LeapDocumentDataRootTagName);
296
- return data;
293
+ const service = this.getLeapDocumentDataService();
294
+ yield service.set(documentData);
295
+ return true;
297
296
  }
298
297
  catch (error) {
299
298
  this.loggerService.error(`[ERROR] Set Document Data: ${error}`);
@@ -464,4 +463,4 @@ class AppPlatform {
464
463
  }
465
464
  }
466
465
  exports.AppPlatform = AppPlatform;
467
- _AppPlatform_authService = new WeakMap(), _AppPlatform_signalRInitData = new WeakMap(), _AppPlatform_initialized = new WeakMap(), _AppPlatform_connectedToSignalR = new WeakMap();
466
+ _AppPlatform_leapDocumentDataService = new WeakMap(), _AppPlatform_authService = new WeakMap(), _AppPlatform_signalRInitData = new WeakMap(), _AppPlatform_initialized = new WeakMap(), _AppPlatform_connectedToSignalR = new WeakMap(), _AppPlatform_hostApplicationType = new WeakMap();
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Barrel export for the LeapDocumentData domain.
3
+ *
4
+ * Domain pattern: model, normalizer, service
5
+ */
6
+ export * from './leap-document-data.model';
7
+ export * from './leap-document-data.normalizer';
8
+ export * from './leap-document-data.service';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /**
5
+ * Barrel export for the LeapDocumentData domain.
6
+ *
7
+ * Domain pattern: model, normalizer, service
8
+ */
9
+ tslib_1.__exportStar(require("./leap-document-data.model"), exports);
10
+ tslib_1.__exportStar(require("./leap-document-data.normalizer"), exports);
11
+ tslib_1.__exportStar(require("./leap-document-data.service"), exports);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Re-export the LeapDocumentData model from the main models directory.
3
+ *
4
+ * This maintains backward compatibility while establishing the domain pattern.
5
+ * Future domains should define their models here directly.
6
+ */
7
+ export { LeapDocumentData } from '../../models/leap.model';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LeapDocumentData = void 0;
4
+ /**
5
+ * Re-export the LeapDocumentData model from the main models directory.
6
+ *
7
+ * This maintains backward compatibility while establishing the domain pattern.
8
+ * Future domains should define their models here directly.
9
+ */
10
+ var leap_model_1 = require("../../models/leap.model");
11
+ Object.defineProperty(exports, "LeapDocumentData", { enumerable: true, get: function () { return leap_model_1.LeapDocumentData; } });
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Normalizer for LeapDocumentData domain.
3
+ *
4
+ * Provides type coercion and serialization for LeapDocumentData custom XML.
5
+ */
6
+ import { LeapDocumentData } from './leap-document-data.model';
7
+ /**
8
+ * Coerce raw LeapDocumentData XML (via xml2js) into typed LeapDocumentData.
9
+ * XML text nodes arrive as strings; only known fields are coerced.
10
+ */
11
+ export declare function normalizeLeapDocumentData(raw: Record<string, unknown> | null | undefined): LeapDocumentData | null;
12
+ /**
13
+ * Serialize a LeapDocumentData field value for custom XML text content.
14
+ */
15
+ export declare function serializeLeapDocumentDataValue(value: unknown): string;
16
+ /**
17
+ * Serialize LeapDocumentData to XML-ready entries.
18
+ */
19
+ export declare function serializeLeapDocumentDataEntries(documentData: LeapDocumentData): Array<[string, string]>;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /**
3
+ * Normalizer for LeapDocumentData domain.
4
+ *
5
+ * Provides type coercion and serialization for LeapDocumentData custom XML.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.serializeLeapDocumentDataEntries = exports.serializeLeapDocumentDataValue = exports.normalizeLeapDocumentData = void 0;
9
+ const tslib_1 = require("tslib");
10
+ const leap_document_data_model_1 = require("./leap-document-data.model");
11
+ /**
12
+ * Parse boolean values from XML strings.
13
+ * @param value - Raw value from XML parser
14
+ * @returns Boolean value
15
+ */
16
+ function parseBoolean(value) {
17
+ switch (typeof value) {
18
+ case 'boolean':
19
+ return value;
20
+ case 'string':
21
+ return value.toLowerCase() === 'true';
22
+ default:
23
+ return false;
24
+ }
25
+ }
26
+ /**
27
+ * Parse number values from XML strings.
28
+ * @param value - Raw value from XML parser
29
+ * @returns Parsed number or undefined
30
+ */
31
+ function parseNumber(value) {
32
+ switch (typeof value) {
33
+ case 'number':
34
+ return Number.isNaN(value) ? undefined : value;
35
+ case 'string': {
36
+ if (value.trim() === '') {
37
+ return undefined;
38
+ }
39
+ const parsed = parseInt(value, 10);
40
+ return Number.isNaN(parsed) ? undefined : parsed;
41
+ }
42
+ default:
43
+ return undefined;
44
+ }
45
+ }
46
+ /**
47
+ * Parse array values from XML (handles both arrays and single values).
48
+ */
49
+ function normalizeStates(value) {
50
+ if (value == null || value === '') {
51
+ return undefined;
52
+ }
53
+ if (Array.isArray(value)) {
54
+ return value.map((item) => String(item));
55
+ }
56
+ return [String(value)];
57
+ }
58
+ /**
59
+ * Coerce raw LeapDocumentData XML (via xml2js) into typed LeapDocumentData.
60
+ * XML text nodes arrive as strings; only known fields are coerced.
61
+ */
62
+ function normalizeLeapDocumentData(raw) {
63
+ if (!raw || typeof raw !== 'object') {
64
+ return null;
65
+ }
66
+ const { isCoauthoringDocument, requireLogout, states, server } = raw, rest = tslib_1.__rest(raw, ["isCoauthoringDocument", "requireLogout", "states", "server"]);
67
+ return new leap_document_data_model_1.LeapDocumentData(Object.assign(Object.assign({}, rest), { isCoauthoringDocument: isCoauthoringDocument === undefined || isCoauthoringDocument === ''
68
+ ? undefined
69
+ : parseBoolean(isCoauthoringDocument), requireLogout: requireLogout === undefined || requireLogout === ''
70
+ ? undefined
71
+ : parseBoolean(requireLogout), states: normalizeStates(states), server: parseNumber(server) }));
72
+ }
73
+ exports.normalizeLeapDocumentData = normalizeLeapDocumentData;
74
+ /**
75
+ * Serialize a LeapDocumentData field value for custom XML text content.
76
+ */
77
+ function serializeLeapDocumentDataValue(value) {
78
+ if (value == null) {
79
+ return '';
80
+ }
81
+ if (typeof value === 'boolean' || typeof value === 'number') {
82
+ return String(value);
83
+ }
84
+ if (Array.isArray(value)) {
85
+ return value.map((item) => String(item)).join(',');
86
+ }
87
+ if (typeof value === 'object') {
88
+ return JSON.stringify(value);
89
+ }
90
+ return String(value);
91
+ }
92
+ exports.serializeLeapDocumentDataValue = serializeLeapDocumentDataValue;
93
+ /**
94
+ * Serialize LeapDocumentData to XML-ready entries.
95
+ */
96
+ function serializeLeapDocumentDataEntries(documentData) {
97
+ return Object.entries(documentData)
98
+ .filter(([, value]) => value !== undefined)
99
+ .map(([key, value]) => [key, serializeLeapDocumentDataValue(value)]);
100
+ }
101
+ exports.serializeLeapDocumentDataEntries = serializeLeapDocumentDataEntries;
@@ -0,0 +1,90 @@
1
+ import { HostApplicationType } from '../../models/leap.model';
2
+ import { CustomXmlPartPort } from '../../ports/custom-xml-part.port';
3
+ import { LeapDocumentData } from './leap-document-data.model';
4
+ /**
5
+ * Domain service for LeapDocumentData custom XML operations.
6
+ *
7
+ * Primary usage (host-based):
8
+ * ```typescript
9
+ * const service = new LeapDocumentDataService(HostApplicationType.Word);
10
+ * const data = await service.get();
11
+ * await service.upsert({ matterId: '12345' });
12
+ * ```
13
+ *
14
+ * Testing usage (inject custom port):
15
+ * ```typescript
16
+ * const service = LeapDocumentDataService.forPort(new InMemoryCustomXmlPartAdapter());
17
+ * ```
18
+ *
19
+ * Implements item-level operations via: read → mutate → serialize → setXml.
20
+ *
21
+ * Strategy:
22
+ * - Read: getXml → parse → normalize
23
+ * - Update: getXml → parse → merge → serialize → setXml
24
+ * - Upsert: attempts update, preserves unknown nodes by merging
25
+ *
26
+ * Conflict resolution: last-write-wins at the field level.
27
+ * Unknown nodes (fields not in LeapDocumentData type) are preserved during updates.
28
+ */
29
+ export declare class LeapDocumentDataService {
30
+ private readonly xmlPort;
31
+ private readonly namespace;
32
+ private readonly rootTagName;
33
+ /**
34
+ * Create a LeapDocumentDataService for a specific Office host.
35
+ *
36
+ * Automatically selects the appropriate adapter and uses standard LeapDocumentData namespace/root.
37
+ *
38
+ * @param hostType - The Office host application type (Word or Excel)
39
+ */
40
+ constructor(hostType: HostApplicationType);
41
+ /**
42
+ * Create a LeapDocumentDataService with a custom port (for testing or advanced use cases).
43
+ *
44
+ * @param xmlPort - Custom XML part port implementation
45
+ * @param namespace - Custom XML namespace (defaults to LeapDocumentData namespace)
46
+ * @param rootTagName - Root XML tag name (defaults to LeapDocumentData root)
47
+ */
48
+ constructor(xmlPort: CustomXmlPartPort, namespace?: string, rootTagName?: string);
49
+ /**
50
+ * Create a LeapDocumentDataService with a custom port.
51
+ *
52
+ * Use this for unit testing with InMemoryCustomXmlPartAdapter or for advanced scenarios
53
+ * where you need to provide a custom port implementation.
54
+ *
55
+ * @param xmlPort - Custom XML part port implementation
56
+ * @param namespace - Optional custom namespace (defaults to LeapDocumentData namespace)
57
+ * @param rootTagName - Optional custom root tag (defaults to LeapDocumentData root)
58
+ */
59
+ static forPort(xmlPort: CustomXmlPartPort, namespace?: string, rootTagName?: string): LeapDocumentDataService;
60
+ private createAdapterForHost;
61
+ /**
62
+ * Get the current LeapDocumentData from the custom XML part.
63
+ */
64
+ get(): Promise<LeapDocumentData | null>;
65
+ /**
66
+ * Set (replace) the LeapDocumentData in the custom XML part.
67
+ *
68
+ * This performs a full replacement. Use `upsert` to preserve unknown fields.
69
+ */
70
+ set(documentData: LeapDocumentData): Promise<void>;
71
+ /**
72
+ * Upsert (update or insert) LeapDocumentData fields.
73
+ *
74
+ * Preserves unknown fields present in the existing XML part.
75
+ * If no part exists, creates one with the provided data.
76
+ */
77
+ upsert(documentData: Partial<LeapDocumentData>): Promise<void>;
78
+ /**
79
+ * Delete the LeapDocumentData custom XML part.
80
+ */
81
+ delete(): Promise<void>;
82
+ /**
83
+ * Ensure the custom XML part exists (create if missing).
84
+ */
85
+ ensurePart(): Promise<void>;
86
+ /**
87
+ * Serialize LeapDocumentData to XML string.
88
+ */
89
+ private serializeToXml;
90
+ }
@@ -0,0 +1,156 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LeapDocumentDataService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const xml_1 = require("../../functions/xml");
6
+ const constants_1 = require("../../models/constants");
7
+ const leap_model_1 = require("../../models/leap.model");
8
+ const ports_1 = require("../../ports");
9
+ const leap_document_data_model_1 = require("./leap-document-data.model");
10
+ const leap_document_data_normalizer_1 = require("./leap-document-data.normalizer");
11
+ /**
12
+ * Domain service for LeapDocumentData custom XML operations.
13
+ *
14
+ * Primary usage (host-based):
15
+ * ```typescript
16
+ * const service = new LeapDocumentDataService(HostApplicationType.Word);
17
+ * const data = await service.get();
18
+ * await service.upsert({ matterId: '12345' });
19
+ * ```
20
+ *
21
+ * Testing usage (inject custom port):
22
+ * ```typescript
23
+ * const service = LeapDocumentDataService.forPort(new InMemoryCustomXmlPartAdapter());
24
+ * ```
25
+ *
26
+ * Implements item-level operations via: read → mutate → serialize → setXml.
27
+ *
28
+ * Strategy:
29
+ * - Read: getXml → parse → normalize
30
+ * - Update: getXml → parse → merge → serialize → setXml
31
+ * - Upsert: attempts update, preserves unknown nodes by merging
32
+ *
33
+ * Conflict resolution: last-write-wins at the field level.
34
+ * Unknown nodes (fields not in LeapDocumentData type) are preserved during updates.
35
+ */
36
+ class LeapDocumentDataService {
37
+ constructor(hostTypeOrPort, namespace, rootTagName) {
38
+ // Host-based construction (primary path)
39
+ if (typeof hostTypeOrPort === 'number') {
40
+ const hostType = hostTypeOrPort;
41
+ this.xmlPort = this.createAdapterForHost(hostType);
42
+ this.namespace = constants_1.constants.LeapDocumentDataNamespace;
43
+ this.rootTagName = constants_1.constants.LeapDocumentDataRootTagName;
44
+ }
45
+ // Port injection (testing/advanced path)
46
+ else {
47
+ this.xmlPort = hostTypeOrPort;
48
+ this.namespace = namespace !== null && namespace !== void 0 ? namespace : constants_1.constants.LeapDocumentDataNamespace;
49
+ this.rootTagName = rootTagName !== null && rootTagName !== void 0 ? rootTagName : constants_1.constants.LeapDocumentDataRootTagName;
50
+ }
51
+ }
52
+ /**
53
+ * Create a LeapDocumentDataService with a custom port.
54
+ *
55
+ * Use this for unit testing with InMemoryCustomXmlPartAdapter or for advanced scenarios
56
+ * where you need to provide a custom port implementation.
57
+ *
58
+ * @param xmlPort - Custom XML part port implementation
59
+ * @param namespace - Optional custom namespace (defaults to LeapDocumentData namespace)
60
+ * @param rootTagName - Optional custom root tag (defaults to LeapDocumentData root)
61
+ */
62
+ static forPort(xmlPort, namespace, rootTagName) {
63
+ return new LeapDocumentDataService(xmlPort, namespace, rootTagName);
64
+ }
65
+ createAdapterForHost(hostType) {
66
+ switch (hostType) {
67
+ case leap_model_1.HostApplicationType.MicrosoftWord:
68
+ return new ports_1.WordCustomXmlPartAdapter();
69
+ case leap_model_1.HostApplicationType.MicrosoftExcel:
70
+ return new ports_1.ExcelCustomXmlPartAdapter();
71
+ default:
72
+ throw new Error(`Unsupported host type: ${hostType}. LeapDocumentDataService supports Word and Excel.`);
73
+ }
74
+ }
75
+ /**
76
+ * Get the current LeapDocumentData from the custom XML part.
77
+ */
78
+ get() {
79
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
+ try {
81
+ const xml = yield this.xmlPort.getXml(this.namespace);
82
+ if (!xml) {
83
+ return null;
84
+ }
85
+ const obj = yield (0, xml_1.toObj)(xml);
86
+ return (0, leap_document_data_normalizer_1.normalizeLeapDocumentData)(obj);
87
+ }
88
+ catch (error) {
89
+ console.error(`[LeapDocumentDataService] Failed to get document data: ${error}`);
90
+ return null;
91
+ }
92
+ });
93
+ }
94
+ /**
95
+ * Set (replace) the LeapDocumentData in the custom XML part.
96
+ *
97
+ * This performs a full replacement. Use `upsert` to preserve unknown fields.
98
+ */
99
+ set(documentData) {
100
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
101
+ const xml = this.serializeToXml(documentData);
102
+ yield this.xmlPort.setXml(this.namespace, xml);
103
+ });
104
+ }
105
+ /**
106
+ * Upsert (update or insert) LeapDocumentData fields.
107
+ *
108
+ * Preserves unknown fields present in the existing XML part.
109
+ * If no part exists, creates one with the provided data.
110
+ */
111
+ upsert(documentData) {
112
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
113
+ try {
114
+ const existing = yield this.get();
115
+ const merged = existing
116
+ ? new leap_document_data_model_1.LeapDocumentData(Object.assign(Object.assign({}, existing), documentData))
117
+ : new leap_document_data_model_1.LeapDocumentData(documentData);
118
+ yield this.set(merged);
119
+ }
120
+ catch (error) {
121
+ console.error(`[LeapDocumentDataService] Failed to upsert document data: ${error}`);
122
+ throw error;
123
+ }
124
+ });
125
+ }
126
+ /**
127
+ * Delete the LeapDocumentData custom XML part.
128
+ */
129
+ delete() {
130
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
131
+ yield this.xmlPort.delete(this.namespace);
132
+ });
133
+ }
134
+ /**
135
+ * Ensure the custom XML part exists (create if missing).
136
+ */
137
+ ensurePart() {
138
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
139
+ yield this.xmlPort.ensurePart(this.namespace, this.rootTagName);
140
+ });
141
+ }
142
+ /**
143
+ * Serialize LeapDocumentData to XML string.
144
+ */
145
+ serializeToXml(documentData) {
146
+ const entries = (0, leap_document_data_normalizer_1.serializeLeapDocumentDataEntries)(documentData);
147
+ const fields = entries
148
+ .map(([key, value]) => ` <${key}>${value}</${key}>`)
149
+ .join('\n');
150
+ return `<?xml version="1.0"?>
151
+ <${this.rootTagName} xmlns="${this.namespace}">
152
+ ${fields}
153
+ </${this.rootTagName}>`;
154
+ }
155
+ }
156
+ exports.LeapDocumentDataService = LeapDocumentDataService;
@@ -33,6 +33,9 @@ export declare class LeapDocumentData {
33
33
  states?: string[];
34
34
  params?: any;
35
35
  instanceId?: string;
36
+ defaultPersonInstance?: string;
37
+ documentName?: string;
38
+ server?: number;
36
39
  requireLogout?: boolean;
37
40
  constructor(init?: Partial<LeapDocumentData>);
38
41
  }
@@ -0,0 +1,15 @@
1
+ import { CustomXmlPartPort } from '../custom-xml-part.port';
2
+ /**
3
+ * Excel adapter implementing CustomXmlPartPort.
4
+ *
5
+ * Uses Office.js Excel APIs to read/write custom XML parts.
6
+ * Excel custom XML part APIs differ from Word's async callback pattern.
7
+ */
8
+ export declare class ExcelCustomXmlPartAdapter implements CustomXmlPartPort {
9
+ getXml(namespace: string): Promise<string | null>;
10
+ setXml(namespace: string, xml: string): Promise<void>;
11
+ delete(namespace: string): Promise<void>;
12
+ ensurePart(namespace: string, rootTagName: string): Promise<void>;
13
+ private getCustomXmlPartsByNamespace;
14
+ private getCustomXmlPartByNamespace;
15
+ }
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ /// <reference types="office-js" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ExcelCustomXmlPartAdapter = void 0;
5
+ const tslib_1 = require("tslib");
6
+ /**
7
+ * Excel adapter implementing CustomXmlPartPort.
8
+ *
9
+ * Uses Office.js Excel APIs to read/write custom XML parts.
10
+ * Excel custom XML part APIs differ from Word's async callback pattern.
11
+ */
12
+ class ExcelCustomXmlPartAdapter {
13
+ getXml(namespace) {
14
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
+ return Excel.run((context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
16
+ try {
17
+ const customXmlPart = yield this.getCustomXmlPartByNamespace(context, namespace);
18
+ if (!customXmlPart) {
19
+ return null;
20
+ }
21
+ const xmlResult = customXmlPart.getXml();
22
+ yield context.sync();
23
+ return xmlResult.value;
24
+ }
25
+ catch (error) {
26
+ console.error(error, `[ExcelCustomXmlPartAdapter] Failed to get XML for namespace ${namespace}`);
27
+ return null;
28
+ }
29
+ }));
30
+ });
31
+ }
32
+ setXml(namespace, xml) {
33
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
34
+ yield Excel.run((context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
35
+ if (!context.workbook) {
36
+ throw new Error('Excel workbook not available');
37
+ }
38
+ try {
39
+ // Delete existing part if present
40
+ const existingPart = yield this.getCustomXmlPartByNamespace(context, namespace);
41
+ if (existingPart) {
42
+ existingPart.delete();
43
+ yield context.sync();
44
+ }
45
+ // Add new part
46
+ const customXmlParts = context.workbook.customXmlParts;
47
+ customXmlParts.add(xml);
48
+ yield context.sync();
49
+ }
50
+ catch (error) {
51
+ console.error(error, `[ExcelCustomXmlPartAdapter] Failed to set XML for namespace ${namespace}`);
52
+ throw error;
53
+ }
54
+ }));
55
+ });
56
+ }
57
+ delete(namespace) {
58
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
+ yield Excel.run((context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
60
+ try {
61
+ const customXmlCollection = yield this.getCustomXmlPartsByNamespace(context, namespace);
62
+ if (!customXmlCollection || customXmlCollection.items.length === 0) {
63
+ return;
64
+ }
65
+ for (const part of customXmlCollection.items) {
66
+ part.delete();
67
+ }
68
+ yield context.sync();
69
+ }
70
+ catch (error) {
71
+ console.error(error, `[ExcelCustomXmlPartAdapter] Failed to delete parts for namespace ${namespace}`);
72
+ throw error;
73
+ }
74
+ }));
75
+ });
76
+ }
77
+ ensurePart(namespace, rootTagName) {
78
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
79
+ const existing = yield Excel.run((context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
80
+ return this.getCustomXmlPartByNamespace(context, namespace);
81
+ }));
82
+ if (existing) {
83
+ return;
84
+ }
85
+ // Create minimal XML part
86
+ const xml = `<?xml version="1.0"?><${rootTagName} xmlns="${namespace}"></${rootTagName}>`;
87
+ yield this.setXml(namespace, xml);
88
+ });
89
+ }
90
+ getCustomXmlPartsByNamespace(context, namespace) {
91
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
92
+ if (!context.workbook) {
93
+ return null;
94
+ }
95
+ const customXmlParts = context.workbook.customXmlParts;
96
+ const customXmlCollection = customXmlParts.getByNamespace(namespace);
97
+ customXmlCollection.load('items');
98
+ yield context.sync();
99
+ return customXmlCollection;
100
+ });
101
+ }
102
+ getCustomXmlPartByNamespace(context, namespace) {
103
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
104
+ const customXmlCollection = yield this.getCustomXmlPartsByNamespace(context, namespace);
105
+ if (customXmlCollection != null &&
106
+ customXmlCollection.items.length > 0) {
107
+ return customXmlCollection.items[0];
108
+ }
109
+ return null;
110
+ });
111
+ }
112
+ }
113
+ exports.ExcelCustomXmlPartAdapter = ExcelCustomXmlPartAdapter;
@@ -0,0 +1,22 @@
1
+ import { CustomXmlPartPort } from '../custom-xml-part.port';
2
+ /**
3
+ * In-memory adapter implementing CustomXmlPartPort for testing.
4
+ *
5
+ * Stores custom XML parts in a simple Map keyed by namespace.
6
+ * Does not perform XML validation - assumes well-formed XML.
7
+ */
8
+ export declare class InMemoryCustomXmlPartAdapter implements CustomXmlPartPort {
9
+ private parts;
10
+ getXml(namespace: string): Promise<string | null>;
11
+ setXml(namespace: string, xml: string): Promise<void>;
12
+ delete(namespace: string): Promise<void>;
13
+ ensurePart(namespace: string, rootTagName: string): Promise<void>;
14
+ /**
15
+ * Test helper: clear all stored parts.
16
+ */
17
+ clear(): void;
18
+ /**
19
+ * Test helper: get all stored parts.
20
+ */
21
+ getAllParts(): Map<string, string>;
22
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InMemoryCustomXmlPartAdapter = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /**
6
+ * In-memory adapter implementing CustomXmlPartPort for testing.
7
+ *
8
+ * Stores custom XML parts in a simple Map keyed by namespace.
9
+ * Does not perform XML validation - assumes well-formed XML.
10
+ */
11
+ class InMemoryCustomXmlPartAdapter {
12
+ constructor() {
13
+ this.parts = new Map();
14
+ }
15
+ getXml(namespace) {
16
+ var _a;
17
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
18
+ return (_a = this.parts.get(namespace)) !== null && _a !== void 0 ? _a : null;
19
+ });
20
+ }
21
+ setXml(namespace, xml) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ this.parts.set(namespace, xml);
24
+ });
25
+ }
26
+ delete(namespace) {
27
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
+ this.parts.delete(namespace);
29
+ });
30
+ }
31
+ ensurePart(namespace, rootTagName) {
32
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
33
+ if (!this.parts.has(namespace)) {
34
+ const xml = `<?xml version="1.0"?><${rootTagName} xmlns="${namespace}"></${rootTagName}>`;
35
+ this.parts.set(namespace, xml);
36
+ }
37
+ });
38
+ }
39
+ /**
40
+ * Test helper: clear all stored parts.
41
+ */
42
+ clear() {
43
+ this.parts.clear();
44
+ }
45
+ /**
46
+ * Test helper: get all stored parts.
47
+ */
48
+ getAllParts() {
49
+ return new Map(this.parts);
50
+ }
51
+ }
52
+ exports.InMemoryCustomXmlPartAdapter = InMemoryCustomXmlPartAdapter;
@@ -0,0 +1,16 @@
1
+ import { CustomXmlPartPort } from '../custom-xml-part.port';
2
+ /**
3
+ * Word adapter implementing CustomXmlPartPort.
4
+ *
5
+ * Uses Office.js Word APIs to read/write custom XML parts.
6
+ * Delegates to existing custom-xml-part.service logic where applicable.
7
+ */
8
+ export declare class WordCustomXmlPartAdapter implements CustomXmlPartPort {
9
+ getXml(namespace: string): Promise<string | null>;
10
+ setXml(namespace: string, xml: string): Promise<void>;
11
+ delete(namespace: string): Promise<void>;
12
+ ensurePart(namespace: string, rootTagName: string): Promise<void>;
13
+ private getCustomXmlPartsByNamespace;
14
+ private getCustomXmlPartByNamespace;
15
+ private deletePart;
16
+ }
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ /// <reference types="office-js" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.WordCustomXmlPartAdapter = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const helpers_1 = require("../../functions/helpers");
7
+ /**
8
+ * Word adapter implementing CustomXmlPartPort.
9
+ *
10
+ * Uses Office.js Word APIs to read/write custom XML parts.
11
+ * Delegates to existing custom-xml-part.service logic where applicable.
12
+ */
13
+ class WordCustomXmlPartAdapter {
14
+ getXml(namespace) {
15
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
16
+ const officeDocument = Office.context.document;
17
+ if (!officeDocument) {
18
+ return null;
19
+ }
20
+ try {
21
+ const customXmlPart = yield this.getCustomXmlPartByNamespace(namespace);
22
+ if (!customXmlPart) {
23
+ return null;
24
+ }
25
+ const getXmlAsync = (0, helpers_1.promisifyAsync)(customXmlPart.getXmlAsync.bind(customXmlPart));
26
+ const xml = yield getXmlAsync({});
27
+ return xml;
28
+ }
29
+ catch (error) {
30
+ console.error(error, `[WordCustomXmlPartAdapter] Failed to get XML for namespace ${namespace}`);
31
+ return null;
32
+ }
33
+ });
34
+ }
35
+ setXml(namespace, xml) {
36
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
37
+ const officeDocument = Office.context.document;
38
+ if (!officeDocument) {
39
+ throw new Error('Office document not available');
40
+ }
41
+ try {
42
+ const existingPart = yield this.getCustomXmlPartByNamespace(namespace);
43
+ if (existingPart) {
44
+ // Replace existing part by deleting and recreating
45
+ yield this.deletePart(existingPart);
46
+ }
47
+ // Add new part
48
+ const officeCustomXmlParts = officeDocument.customXmlParts;
49
+ const add = (0, helpers_1.promisifyAsync)(officeCustomXmlParts.addAsync.bind(officeCustomXmlParts));
50
+ yield add(xml, {});
51
+ }
52
+ catch (error) {
53
+ console.error(error, `[WordCustomXmlPartAdapter] Failed to set XML for namespace ${namespace}`);
54
+ throw error;
55
+ }
56
+ });
57
+ }
58
+ delete(namespace) {
59
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
60
+ try {
61
+ const parts = yield this.getCustomXmlPartsByNamespace(namespace);
62
+ if (!parts || parts.length === 0) {
63
+ return;
64
+ }
65
+ for (const part of parts) {
66
+ yield this.deletePart(part);
67
+ }
68
+ }
69
+ catch (error) {
70
+ console.error(error, `[WordCustomXmlPartAdapter] Failed to delete parts for namespace ${namespace}`);
71
+ throw error;
72
+ }
73
+ });
74
+ }
75
+ ensurePart(namespace, rootTagName) {
76
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
77
+ const existing = yield this.getCustomXmlPartByNamespace(namespace);
78
+ if (existing) {
79
+ return;
80
+ }
81
+ // Create minimal XML part
82
+ const xml = `<?xml version="1.0"?><${rootTagName} xmlns="${namespace}"></${rootTagName}>`;
83
+ yield this.setXml(namespace, xml);
84
+ });
85
+ }
86
+ getCustomXmlPartsByNamespace(namespace) {
87
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
88
+ const officeDocument = Office.context.document;
89
+ if (!officeDocument) {
90
+ return null;
91
+ }
92
+ const officeCustomXmlParts = officeDocument.customXmlParts;
93
+ return new Promise((resolve) => {
94
+ officeCustomXmlParts.getByNamespaceAsync(namespace, (result) => {
95
+ resolve(result.value);
96
+ });
97
+ });
98
+ });
99
+ }
100
+ getCustomXmlPartByNamespace(namespace) {
101
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
102
+ const customXmlParts = yield this.getCustomXmlPartsByNamespace(namespace);
103
+ if (customXmlParts != null &&
104
+ Array.isArray(customXmlParts) &&
105
+ customXmlParts.length > 0) {
106
+ return customXmlParts[0];
107
+ }
108
+ return null;
109
+ });
110
+ }
111
+ deletePart(part) {
112
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
113
+ const deleteAsync = (0, helpers_1.promisifyAsync)(part.deleteAsync.bind(part));
114
+ yield deleteAsync({});
115
+ });
116
+ }
117
+ }
118
+ exports.WordCustomXmlPartAdapter = WordCustomXmlPartAdapter;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Port (interface) for Custom XML Part operations.
3
+ *
4
+ * Domains depend on this abstraction for reading/writing whole custom XML parts.
5
+ * Word and Excel adapters implement this port to provide host-specific XML access.
6
+ *
7
+ * All operations work at the whole-part level (not node-level).
8
+ * Item-level CRUD is built in domain services: read → mutate → serialize → setXml.
9
+ */
10
+ export interface CustomXmlPartPort {
11
+ /**
12
+ * Get the XML content of a custom XML part by namespace.
13
+ *
14
+ * @param namespace - The namespace URI identifying the custom XML part
15
+ * @returns The XML string content, or null if not found
16
+ */
17
+ getXml(namespace: string): Promise<string | null>;
18
+ /**
19
+ * Set (replace or create) the XML content for a custom XML part by namespace.
20
+ *
21
+ * If a part with the given namespace exists, it is replaced.
22
+ * If no part exists, a new one is created.
23
+ *
24
+ * @param namespace - The namespace URI identifying the custom XML part
25
+ * @param xml - The complete XML content to set
26
+ */
27
+ setXml(namespace: string, xml: string): Promise<void>;
28
+ /**
29
+ * Delete all custom XML parts with the given namespace.
30
+ *
31
+ * @param namespace - The namespace URI identifying the custom XML part(s) to delete
32
+ */
33
+ delete(namespace: string): Promise<void>;
34
+ /**
35
+ * Ensure a custom XML part exists for the given namespace.
36
+ *
37
+ * If a part already exists, this is a no-op.
38
+ * If no part exists, an empty part with the given root element is created.
39
+ *
40
+ * @param namespace - The namespace URI
41
+ * @param rootTagName - The root element name for the XML part
42
+ */
43
+ ensurePart(namespace: string, rootTagName: string): Promise<void>;
44
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Barrel export for ports and adapters.
3
+ */
4
+ export * from './custom-xml-part.port';
5
+ export * from './adapters/word-custom-xml-part.adapter';
6
+ export * from './adapters/excel-custom-xml-part.adapter';
7
+ export * from './adapters/in-memory-custom-xml-part.adapter';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /**
5
+ * Barrel export for ports and adapters.
6
+ */
7
+ tslib_1.__exportStar(require("./custom-xml-part.port"), exports);
8
+ tslib_1.__exportStar(require("./adapters/word-custom-xml-part.adapter"), exports);
9
+ tslib_1.__exportStar(require("./adapters/excel-custom-xml-part.adapter"), exports);
10
+ tslib_1.__exportStar(require("./adapters/in-memory-custom-xml-part.adapter"), exports);
package/src/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import { EvaluatePathsRequest, EvaluatePathsResponse } from './lib/models';
2
- import { LeapDocumentData, HostApplicationType } from './lib/models/leap.model';
3
- export { EvaluatePathsRequest, EvaluatePathsResponse, LeapDocumentData, HostApplicationType, };
2
+ import { HostApplicationType } from './lib/models/leap.model';
3
+ export { EvaluatePathsRequest, EvaluatePathsResponse, HostApplicationType, };
4
+ export { LeapDocumentData } from './lib/domains/leap-document-data';
package/src/types.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HostApplicationType = exports.LeapDocumentData = exports.EvaluatePathsResponse = exports.EvaluatePathsRequest = void 0;
3
+ exports.LeapDocumentData = exports.HostApplicationType = exports.EvaluatePathsResponse = exports.EvaluatePathsRequest = void 0;
4
4
  const models_1 = require("./lib/models");
5
5
  Object.defineProperty(exports, "EvaluatePathsRequest", { enumerable: true, get: function () { return models_1.EvaluatePathsRequest; } });
6
6
  Object.defineProperty(exports, "EvaluatePathsResponse", { enumerable: true, get: function () { return models_1.EvaluatePathsResponse; } });
7
7
  const leap_model_1 = require("./lib/models/leap.model");
8
- Object.defineProperty(exports, "LeapDocumentData", { enumerable: true, get: function () { return leap_model_1.LeapDocumentData; } });
9
8
  Object.defineProperty(exports, "HostApplicationType", { enumerable: true, get: function () { return leap_model_1.HostApplicationType; } });
9
+ var leap_document_data_1 = require("./lib/domains/leap-document-data");
10
+ Object.defineProperty(exports, "LeapDocumentData", { enumerable: true, get: function () { return leap_document_data_1.LeapDocumentData; } });