@leapdev/app-platform 0.1.0-beta.3 → 0.1.0-beta.31

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 (105) hide show
  1. package/package.json +4 -2
  2. package/src/index.d.ts +34 -6
  3. package/src/index.js +39 -7
  4. package/src/lib/app-platform.d.ts +40 -2
  5. package/src/lib/app-platform.js +264 -29
  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/environment/environment.dictionary.js +0 -1
  15. package/src/lib/environment/environment.js +0 -1
  16. package/src/lib/environment/index.js +0 -1
  17. package/src/lib/environment/leap/env.dev.au.config.js +0 -1
  18. package/src/lib/environment/leap/env.live.au.config.js +0 -1
  19. package/src/lib/environment/leap/env.live.ca.config.js +0 -1
  20. package/src/lib/environment/leap/env.live.nz.config.js +0 -1
  21. package/src/lib/environment/leap/env.live.uk.config.js +0 -1
  22. package/src/lib/environment/leap/env.live.us.config.js +0 -1
  23. package/src/lib/environment/leap/env.liveb.au.config.js +0 -1
  24. package/src/lib/environment/leap/env.test.au.config.js +0 -1
  25. package/src/lib/environment/leap/env.test.ca.config.js +0 -1
  26. package/src/lib/environment/leap/env.test.nz.config.js +0 -1
  27. package/src/lib/environment/leap/env.test.uk.config.js +0 -1
  28. package/src/lib/environment/leap/env.test.us.config.js +0 -1
  29. package/src/lib/functions/helpers.d.ts +1 -0
  30. package/src/lib/functions/helpers.js +7 -4
  31. package/src/lib/functions/xml.js +0 -1
  32. package/src/lib/models/calc-api.model.js +0 -1
  33. package/src/lib/models/constants/index.d.ts +2 -0
  34. package/src/lib/models/constants/index.js +2 -1
  35. package/src/lib/models/index.js +0 -1
  36. package/src/lib/models/leap-events.model.d.ts +1 -0
  37. package/src/lib/models/leap-events.model.js +1 -1
  38. package/src/lib/models/leap.model.d.ts +19 -0
  39. package/src/lib/models/leap.model.js +8 -2
  40. package/src/lib/models/signalr.model.d.ts +1 -0
  41. package/src/lib/models/signalr.model.js +0 -1
  42. package/src/lib/ports/adapters/excel-custom-xml-part.adapter.d.ts +15 -0
  43. package/src/lib/ports/adapters/excel-custom-xml-part.adapter.js +113 -0
  44. package/src/lib/ports/adapters/in-memory-custom-xml-part.adapter.d.ts +22 -0
  45. package/src/lib/ports/adapters/in-memory-custom-xml-part.adapter.js +52 -0
  46. package/src/lib/ports/adapters/word-custom-xml-part.adapter.d.ts +16 -0
  47. package/src/lib/ports/adapters/word-custom-xml-part.adapter.js +118 -0
  48. package/src/lib/ports/custom-xml-part.port.d.ts +44 -0
  49. package/src/lib/ports/custom-xml-part.port.js +2 -0
  50. package/src/lib/ports/index.d.ts +7 -0
  51. package/src/lib/ports/index.js +10 -0
  52. package/src/lib/services/auth/auth.service.js +0 -1
  53. package/src/lib/services/calc-api/calc-api-service.interface.d.ts +1 -3
  54. package/src/lib/services/calc-api/calc-api-service.interface.js +0 -1
  55. package/src/lib/services/calc-api/calc-word.service.d.ts +2 -4
  56. package/src/lib/services/calc-api/calc-word.service.js +0 -37
  57. package/src/lib/services/calc-api/promise-helper.function.js +1 -2
  58. package/src/lib/services/custom-xml-part.service.d.ts +1 -1
  59. package/src/lib/services/custom-xml-part.service.js +5 -3
  60. package/src/lib/services/document/document.service.d.ts +5 -0
  61. package/src/lib/services/document/document.service.js +25 -1
  62. package/src/lib/services/excel-custom-xml-part.service.d.ts +14 -0
  63. package/src/lib/services/excel-custom-xml-part.service.js +193 -0
  64. package/src/lib/services/index.js +0 -1
  65. package/src/lib/services/leap-events.service.js +3 -4
  66. package/src/lib/services/logger/logger.service.js +0 -1
  67. package/src/lib/services/signalr/signalr.service.d.ts +11 -0
  68. package/src/lib/services/signalr/signalr.service.js +102 -56
  69. package/src/types.d.ts +4 -0
  70. package/src/types.js +10 -0
  71. package/src/index.js.map +0 -1
  72. package/src/lib/app-platform.js.map +0 -1
  73. package/src/lib/environment/environment.dictionary.js.map +0 -1
  74. package/src/lib/environment/environment.js.map +0 -1
  75. package/src/lib/environment/index.js.map +0 -1
  76. package/src/lib/environment/leap/env.dev.au.config.js.map +0 -1
  77. package/src/lib/environment/leap/env.live.au.config.js.map +0 -1
  78. package/src/lib/environment/leap/env.live.ca.config.js.map +0 -1
  79. package/src/lib/environment/leap/env.live.nz.config.js.map +0 -1
  80. package/src/lib/environment/leap/env.live.uk.config.js.map +0 -1
  81. package/src/lib/environment/leap/env.live.us.config.js.map +0 -1
  82. package/src/lib/environment/leap/env.liveb.au.config.js.map +0 -1
  83. package/src/lib/environment/leap/env.test.au.config.js.map +0 -1
  84. package/src/lib/environment/leap/env.test.ca.config.js.map +0 -1
  85. package/src/lib/environment/leap/env.test.nz.config.js.map +0 -1
  86. package/src/lib/environment/leap/env.test.uk.config.js.map +0 -1
  87. package/src/lib/environment/leap/env.test.us.config.js.map +0 -1
  88. package/src/lib/functions/helpers.js.map +0 -1
  89. package/src/lib/functions/xml.js.map +0 -1
  90. package/src/lib/models/calc-api.model.js.map +0 -1
  91. package/src/lib/models/constants/index.js.map +0 -1
  92. package/src/lib/models/index.js.map +0 -1
  93. package/src/lib/models/leap-events.model.js.map +0 -1
  94. package/src/lib/models/leap.model.js.map +0 -1
  95. package/src/lib/models/signalr.model.js.map +0 -1
  96. package/src/lib/services/auth/auth.service.js.map +0 -1
  97. package/src/lib/services/calc-api/calc-api-service.interface.js.map +0 -1
  98. package/src/lib/services/calc-api/calc-word.service.js.map +0 -1
  99. package/src/lib/services/calc-api/promise-helper.function.js.map +0 -1
  100. package/src/lib/services/custom-xml-part.service.js.map +0 -1
  101. package/src/lib/services/document/document.service.js.map +0 -1
  102. package/src/lib/services/index.js.map +0 -1
  103. package/src/lib/services/leap-events.service.js.map +0 -1
  104. package/src/lib/services/logger/logger.service.js.map +0 -1
  105. package/src/lib/services/signalr/signalr.service.js.map +0 -1
@@ -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;
@@ -27,4 +27,3 @@ exports.environment_dictionary = {
27
27
  leap_test_ca: env_test_ca_config_1.leap_test_ca,
28
28
  leap_live_ca: env_live_ca_config_1.leap_live_ca,
29
29
  };
30
- //# sourceMappingURL=environment.dictionary.js.map
@@ -14,4 +14,3 @@ class LeapEnvironment {
14
14
  }
15
15
  exports.LeapEnvironment = LeapEnvironment;
16
16
  LeapEnvironment.config = {};
17
- //# sourceMappingURL=environment.js.map
@@ -6,4 +6,3 @@ Object.defineProperty(exports, "Environment", { enumerable: true, get: function
6
6
  Object.defineProperty(exports, "LeapEnvironment", { enumerable: true, get: function () { return environment_1.LeapEnvironment; } });
7
7
  var environment_dictionary_1 = require("./environment.dictionary");
8
8
  Object.defineProperty(exports, "environment_dictionary", { enumerable: true, get: function () { return environment_dictionary_1.environment_dictionary; } });
9
- //# sourceMappingURL=index.js.map
@@ -33,4 +33,3 @@ exports.leap_dev_au = {
33
33
  pubSubApi: 'https://leap-pubsub.dev.leapaws.com.au',
34
34
  pubSubNotificationPublishKey: 'AOG98zJZyz2akUiK2JID4xK-pvN8PfXz7NYYgwyA3gw5AzFuRMrvqw==',
35
35
  };
36
- //# sourceMappingURL=env.dev.au.config.js.map
@@ -33,4 +33,3 @@ exports.leap_live_au = {
33
33
  pubSubApi: '',
34
34
  pubSubNotificationPublishKey: '',
35
35
  };
36
- //# sourceMappingURL=env.live.au.config.js.map
@@ -33,4 +33,3 @@ exports.leap_live_ca = {
33
33
  pubSubApi: '',
34
34
  pubSubNotificationPublishKey: '',
35
35
  };
36
- //# sourceMappingURL=env.live.ca.config.js.map
@@ -33,4 +33,3 @@ exports.leap_live_nz = {
33
33
  pubSubApi: '',
34
34
  pubSubNotificationPublishKey: '',
35
35
  };
36
- //# sourceMappingURL=env.live.nz.config.js.map
@@ -33,4 +33,3 @@ exports.leap_live_uk = {
33
33
  pubSubApi: '',
34
34
  pubSubNotificationPublishKey: '',
35
35
  };
36
- //# sourceMappingURL=env.live.uk.config.js.map
@@ -33,4 +33,3 @@ exports.leap_live_us = {
33
33
  pubSubApi: '',
34
34
  pubSubNotificationPublishKey: '',
35
35
  };
36
- //# sourceMappingURL=env.live.us.config.js.map
@@ -33,4 +33,3 @@ exports.leap_liveb_au = {
33
33
  pubSubApi: '',
34
34
  pubSubNotificationPublishKey: '',
35
35
  };
36
- //# sourceMappingURL=env.liveb.au.config.js.map
@@ -33,4 +33,3 @@ exports.leap_test_au = {
33
33
  pubSubApi: 'https://leap-pubsub.test.leapaws.com.au',
34
34
  pubSubNotificationPublishKey: 'cZDuczPU9v1Qt_v8zKzqr39ImQW8ThDy6swhtFSNhR64AzFu-tUg-w==',
35
35
  };
36
- //# sourceMappingURL=env.test.au.config.js.map
@@ -33,4 +33,3 @@ exports.leap_test_ca = {
33
33
  pubSubApi: 'https://leap-pubsub.test.leapaws.ca',
34
34
  pubSubNotificationPublishKey: 'xcQIILz8R-TKSclEFH1il_zAyXjD7fVGzPWYYgA-Or6-AzFuFztkEA==',
35
35
  };
36
- //# sourceMappingURL=env.test.ca.config.js.map
@@ -33,4 +33,3 @@ exports.leap_test_nz = {
33
33
  pubSubApi: 'https://leap-pubsub.test.leapaws.com.au',
34
34
  pubSubNotificationPublishKey: 'cZDuczPU9v1Qt_v8zKzqr39ImQW8ThDy6swhtFSNhR64AzFu-tUg-w==',
35
35
  };
36
- //# sourceMappingURL=env.test.nz.config.js.map
@@ -33,4 +33,3 @@ exports.leap_test_uk = {
33
33
  pubSubApi: 'https://leap-pubsub.test.leapaws.co.uk',
34
34
  pubSubNotificationPublishKey: '1h9GBi291HSYas4tJBA-VE5p9laQpVXFxGp9LOCjQTKFAzFupIOgZg==',
35
35
  };
36
- //# sourceMappingURL=env.test.uk.config.js.map
@@ -33,4 +33,3 @@ exports.leap_test_us = {
33
33
  pubSubApi: 'https://leap-pubsub.test.leapaws.com',
34
34
  pubSubNotificationPublishKey: 'd_WIgaqxSYFgw2Lc8dHP1h0JSxCIpjw3igJjo5W3m_y-AzFuvczY0A==',
35
35
  };
36
- //# sourceMappingURL=env.test.us.config.js.map
@@ -3,3 +3,4 @@ export declare function b64DecodeUnicode(str: string): string | null;
3
3
  export declare function isNullOrUndefined(val: any): boolean;
4
4
  export type PromisifiedFunction<T> = (...args: any[]) => Promise<T>;
5
5
  export declare function promisifyAsync<T>(fn: Function): PromisifiedFunction<T>;
6
+ export declare const isLD2_5: (hostVersion: string) => boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promisifyAsync = exports.isNullOrUndefined = exports.b64DecodeUnicode = exports.b64EncodeUnicode = void 0;
3
+ exports.isLD2_5 = exports.promisifyAsync = exports.isNullOrUndefined = exports.b64DecodeUnicode = exports.b64EncodeUnicode = void 0;
4
4
  // String helpers
5
5
  /*
6
6
  * Function to convert from UTF8 to Base64 solving the Unicode Problem
@@ -12,7 +12,7 @@ exports.promisifyAsync = exports.isNullOrUndefined = exports.b64DecodeUnicode =
12
12
  */
13
13
  function b64EncodeUnicode(str) {
14
14
  if (window && 'btoa' in window && 'encodeURIComponent' in window) {
15
- return window.btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => {
15
+ return window.btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (_, p1) => {
16
16
  return String.fromCharCode(('0x' + p1));
17
17
  }));
18
18
  }
@@ -47,7 +47,7 @@ function b64DecodeUnicode(str) {
47
47
  }
48
48
  }
49
49
  exports.b64DecodeUnicode = b64DecodeUnicode;
50
- // Object helpers
50
+ // Object helpers
51
51
  function isNullOrUndefined(val) {
52
52
  return val == null || ['null', 'undefined'].includes(val.toString());
53
53
  }
@@ -92,4 +92,7 @@ function promisifyAsync(fn) {
92
92
  };
93
93
  }
94
94
  exports.promisifyAsync = promisifyAsync;
95
- //# sourceMappingURL=helpers.js.map
95
+ const isLD2_5 = (hostVersion) => {
96
+ return /^2\.5(\..+)?$/.test(hostVersion);
97
+ };
98
+ exports.isLD2_5 = isLD2_5;
@@ -38,4 +38,3 @@ const toXml = (data, rootTagName, options) => {
38
38
  return xml;
39
39
  };
40
40
  exports.toXml = toXml;
41
- //# sourceMappingURL=xml.js.map
@@ -36,4 +36,3 @@ var AppPlatformId;
36
36
  AppPlatformId["Desktop"] = "desktop";
37
37
  AppPlatformId["AppFirst"] = "app-first";
38
38
  })(AppPlatformId || (exports.AppPlatformId = AppPlatformId = {}));
39
- //# sourceMappingURL=calc-api.model.js.map
@@ -23,6 +23,8 @@ export declare const constants: {
23
23
  LeapFunctionsRootTagName: string;
24
24
  LeapAddInNamespace: string;
25
25
  LeapAddInRootTagName: string;
26
+ LeapOfficeAddInDataNamespace: string;
27
+ LeapOfficeAddInDataRootTagName: string;
26
28
  fourdRedirectUrl: string;
27
29
  tokenSecondsBeforeExpire: number;
28
30
  };
@@ -26,7 +26,8 @@ exports.constants = {
26
26
  LeapFunctionsRootTagName: 'LEAPFunctions',
27
27
  LeapAddInNamespace: 'http://LeapAddIn.com',
28
28
  LeapAddInRootTagName: 'LeapAddIn',
29
+ LeapOfficeAddInDataNamespace: 'http://LeapOfficeAddInData.com',
30
+ LeapOfficeAddInDataRootTagName: 'LeapOfficeAddInData',
29
31
  fourdRedirectUrl: 'fourd://authcallback.com',
30
32
  tokenSecondsBeforeExpire: 30,
31
33
  };
32
- //# sourceMappingURL=index.js.map
@@ -2,4 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./calc-api.model"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -33,6 +33,7 @@ export declare enum LeapEventAction {
33
33
  WordApp_FindField = 25,
34
34
  WordApp_InsertField = 26,
35
35
  WordApp_CreateDocument = 27,
36
+ WordApp_SaveDocument = 28,
36
37
  DocumentBuilder_UpdateFields = 31,
37
38
  DocumentBuilder_UpdateFieldsPartial = 32,
38
39
  DocumentBuilder_SetValue = 33,
@@ -47,6 +47,7 @@ var LeapEventAction;
47
47
  LeapEventAction[LeapEventAction["WordApp_FindField"] = 25] = "WordApp_FindField";
48
48
  LeapEventAction[LeapEventAction["WordApp_InsertField"] = 26] = "WordApp_InsertField";
49
49
  LeapEventAction[LeapEventAction["WordApp_CreateDocument"] = 27] = "WordApp_CreateDocument";
50
+ LeapEventAction[LeapEventAction["WordApp_SaveDocument"] = 28] = "WordApp_SaveDocument";
50
51
  LeapEventAction[LeapEventAction["DocumentBuilder_UpdateFields"] = 31] = "DocumentBuilder_UpdateFields";
51
52
  LeapEventAction[LeapEventAction["DocumentBuilder_UpdateFieldsPartial"] = 32] = "DocumentBuilder_UpdateFieldsPartial";
52
53
  LeapEventAction[LeapEventAction["DocumentBuilder_SetValue"] = 33] = "DocumentBuilder_SetValue";
@@ -68,4 +69,3 @@ var LeapEventAction;
68
69
  LeapEventAction[LeapEventAction["WordApp_GetTokenResponse"] = 73] = "WordApp_GetTokenResponse";
69
70
  LeapEventAction[LeapEventAction["WordApp_ResetTemplateResponse"] = 74] = "WordApp_ResetTemplateResponse";
70
71
  })(LeapEventAction || (exports.LeapEventAction = LeapEventAction = {}));
71
- //# sourceMappingURL=leap-events.model.js.map
@@ -1,6 +1,8 @@
1
1
  export declare class LeapDocumentData {
2
2
  appId: string | undefined;
3
3
  documentId: string | undefined;
4
+ documentVersionId: string | undefined;
5
+ documentCreationDate: string | undefined;
4
6
  templateId: string | undefined;
5
7
  firmId: string | undefined;
6
8
  matterId: string | undefined;
@@ -14,9 +16,16 @@ export declare class LeapDocumentData {
14
16
  region: string | undefined;
15
17
  mode: string | undefined;
16
18
  xmlns: string | undefined;
19
+ precedentId: string | undefined;
17
20
  precedentClass: string | undefined;
18
21
  usedByPrecedentId?: string | undefined;
19
22
  usedByPrecedentName?: string | undefined;
23
+ wordStyleId?: string | undefined;
24
+ appliedWordStyleVersionId?: string | undefined;
25
+ officeAddInUrl?: string | undefined;
26
+ hostType: 'web' | undefined;
27
+ isCoauthoringDocument: boolean | undefined;
28
+ invoiceId?: string | undefined;
20
29
  sessionId: string | undefined;
21
30
  transactionId?: string;
22
31
  matterTypeId?: string;
@@ -24,7 +33,11 @@ export declare class LeapDocumentData {
24
33
  states?: string[];
25
34
  params?: any;
26
35
  instanceId?: string;
36
+ defaultPersonInstance?: string;
37
+ documentName?: string;
38
+ server?: number;
27
39
  requireLogout?: boolean;
40
+ documentSessionId?: string | undefined;
28
41
  constructor(init?: Partial<LeapDocumentData>);
29
42
  }
30
43
  export declare enum PreviewMode {
@@ -61,3 +74,9 @@ export type LEAPUser = {
61
74
  countryCode: number;
62
75
  region: string;
63
76
  };
77
+ export declare enum HostApplicationType {
78
+ UnknownApplication = 0,
79
+ MicrosoftExcel = 1,
80
+ MicrosoftWord = 2,
81
+ MicrosoftOutlook = 3
82
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LeapTemplateData = exports.LeapModelData = exports.LeapRegion = exports.PreviewMode = exports.LeapDocumentData = void 0;
3
+ exports.HostApplicationType = exports.LeapTemplateData = exports.LeapModelData = exports.LeapRegion = exports.PreviewMode = exports.LeapDocumentData = void 0;
4
4
  class LeapDocumentData {
5
5
  constructor(init) {
6
6
  if (init) {
@@ -26,4 +26,10 @@ exports.LeapModelData = LeapModelData;
26
26
  class LeapTemplateData {
27
27
  }
28
28
  exports.LeapTemplateData = LeapTemplateData;
29
- //# sourceMappingURL=leap.model.js.map
29
+ var HostApplicationType;
30
+ (function (HostApplicationType) {
31
+ HostApplicationType[HostApplicationType["UnknownApplication"] = 0] = "UnknownApplication";
32
+ HostApplicationType[HostApplicationType["MicrosoftExcel"] = 1] = "MicrosoftExcel";
33
+ HostApplicationType[HostApplicationType["MicrosoftWord"] = 2] = "MicrosoftWord";
34
+ HostApplicationType[HostApplicationType["MicrosoftOutlook"] = 3] = "MicrosoftOutlook";
35
+ })(HostApplicationType || (exports.HostApplicationType = HostApplicationType = {}));
@@ -18,4 +18,5 @@ export type SignalRInitData = {
18
18
  staffId: string;
19
19
  userId: string;
20
20
  userName: string;
21
+ projectId: string;
21
22
  };
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=signalr.model.js.map
@@ -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
+ }