@leapdev/app-platform 0.0.10-beta.0 → 0.1.0-beta.4

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 (133) hide show
  1. package/.eslintrc.json +25 -0
  2. package/package.json +15 -15
  3. package/project.json +27 -0
  4. package/src/index.ts +44 -0
  5. package/src/lib/app-platform.ts +270 -0
  6. package/src/lib/environment/environment.dictionary.ts +28 -0
  7. package/src/lib/environment/environment.ts +44 -0
  8. package/src/lib/environment/{index.d.ts → index.ts} +2 -2
  9. package/src/lib/environment/leap/env.dev.au.config.ts +33 -0
  10. package/src/lib/environment/leap/env.live.au.config.ts +32 -0
  11. package/src/lib/environment/leap/env.live.ca.config.ts +32 -0
  12. package/src/lib/environment/leap/env.live.nz.config.ts +32 -0
  13. package/src/lib/environment/leap/env.live.uk.config.ts +32 -0
  14. package/src/lib/environment/leap/env.live.us.config.ts +32 -0
  15. package/src/lib/environment/leap/env.liveb.au.config.ts +32 -0
  16. package/src/lib/environment/leap/env.test.au.config.ts +33 -0
  17. package/src/lib/environment/leap/env.test.ca.config.ts +33 -0
  18. package/src/lib/environment/leap/env.test.nz.config.ts +33 -0
  19. package/src/lib/environment/leap/env.test.uk.config.ts +33 -0
  20. package/src/lib/environment/leap/env.test.us.config.ts +33 -0
  21. package/src/lib/functions/helpers.ts +100 -0
  22. package/src/lib/functions/xml.ts +41 -0
  23. package/src/lib/models/calc-api.model.ts +74 -0
  24. package/src/lib/models/constants/index.ts +29 -0
  25. package/src/lib/models/{index.d.ts → index.ts} +1 -1
  26. package/src/lib/models/leap-events.model.ts +79 -0
  27. package/src/lib/models/leap.model.ts +78 -0
  28. package/src/lib/models/signalr.model.ts +22 -0
  29. package/src/lib/services/auth/auth.service.ts +219 -0
  30. package/src/lib/services/calc-api/calc-api-service.interface.ts +12 -0
  31. package/src/lib/services/calc-api/calc-word.service.ts +117 -0
  32. package/src/lib/services/calc-api/promise-helper.function.ts +26 -0
  33. package/src/lib/services/custom-xml-part.service.ts +340 -0
  34. package/src/lib/services/document/document.service.ts +33 -0
  35. package/src/lib/services/{index.d.ts → index.ts} +10 -5
  36. package/src/lib/services/leap-events.service.ts +489 -0
  37. package/src/lib/services/logger/logger.service.ts +42 -0
  38. package/src/lib/services/signalr/signalr.service.ts +88 -0
  39. package/tsconfig.json +20 -0
  40. package/tsconfig.lib.json +12 -0
  41. package/src/index.d.ts +0 -16
  42. package/src/index.js +0 -26
  43. package/src/index.js.map +0 -1
  44. package/src/lib/app-platform.d.ts +0 -25
  45. package/src/lib/app-platform.js +0 -163
  46. package/src/lib/app-platform.js.map +0 -1
  47. package/src/lib/environment/environment.d.ts +0 -37
  48. package/src/lib/environment/environment.dictionary.d.ts +0 -4
  49. package/src/lib/environment/environment.dictionary.js +0 -30
  50. package/src/lib/environment/environment.dictionary.js.map +0 -1
  51. package/src/lib/environment/environment.js +0 -17
  52. package/src/lib/environment/environment.js.map +0 -1
  53. package/src/lib/environment/index.js +0 -9
  54. package/src/lib/environment/index.js.map +0 -1
  55. package/src/lib/environment/leap/env.dev.au.config.d.ts +0 -32
  56. package/src/lib/environment/leap/env.dev.au.config.js +0 -36
  57. package/src/lib/environment/leap/env.dev.au.config.js.map +0 -1
  58. package/src/lib/environment/leap/env.live.au.config.d.ts +0 -32
  59. package/src/lib/environment/leap/env.live.au.config.js +0 -36
  60. package/src/lib/environment/leap/env.live.au.config.js.map +0 -1
  61. package/src/lib/environment/leap/env.live.ca.config.d.ts +0 -32
  62. package/src/lib/environment/leap/env.live.ca.config.js +0 -36
  63. package/src/lib/environment/leap/env.live.ca.config.js.map +0 -1
  64. package/src/lib/environment/leap/env.live.nz.config.d.ts +0 -32
  65. package/src/lib/environment/leap/env.live.nz.config.js +0 -36
  66. package/src/lib/environment/leap/env.live.nz.config.js.map +0 -1
  67. package/src/lib/environment/leap/env.live.uk.config.d.ts +0 -32
  68. package/src/lib/environment/leap/env.live.uk.config.js +0 -36
  69. package/src/lib/environment/leap/env.live.uk.config.js.map +0 -1
  70. package/src/lib/environment/leap/env.live.us.config.d.ts +0 -32
  71. package/src/lib/environment/leap/env.live.us.config.js +0 -36
  72. package/src/lib/environment/leap/env.live.us.config.js.map +0 -1
  73. package/src/lib/environment/leap/env.liveb.au.config.d.ts +0 -32
  74. package/src/lib/environment/leap/env.liveb.au.config.js +0 -36
  75. package/src/lib/environment/leap/env.liveb.au.config.js.map +0 -1
  76. package/src/lib/environment/leap/env.test.au.config.d.ts +0 -32
  77. package/src/lib/environment/leap/env.test.au.config.js +0 -36
  78. package/src/lib/environment/leap/env.test.au.config.js.map +0 -1
  79. package/src/lib/environment/leap/env.test.ca.config.d.ts +0 -32
  80. package/src/lib/environment/leap/env.test.ca.config.js +0 -36
  81. package/src/lib/environment/leap/env.test.ca.config.js.map +0 -1
  82. package/src/lib/environment/leap/env.test.nz.config.d.ts +0 -32
  83. package/src/lib/environment/leap/env.test.nz.config.js +0 -36
  84. package/src/lib/environment/leap/env.test.nz.config.js.map +0 -1
  85. package/src/lib/environment/leap/env.test.uk.config.d.ts +0 -32
  86. package/src/lib/environment/leap/env.test.uk.config.js +0 -36
  87. package/src/lib/environment/leap/env.test.uk.config.js.map +0 -1
  88. package/src/lib/environment/leap/env.test.us.config.d.ts +0 -32
  89. package/src/lib/environment/leap/env.test.us.config.js +0 -36
  90. package/src/lib/environment/leap/env.test.us.config.js.map +0 -1
  91. package/src/lib/functions/helpers.d.ts +0 -5
  92. package/src/lib/functions/helpers.js +0 -95
  93. package/src/lib/functions/helpers.js.map +0 -1
  94. package/src/lib/functions/xml.d.ts +0 -2
  95. package/src/lib/functions/xml.js +0 -41
  96. package/src/lib/functions/xml.js.map +0 -1
  97. package/src/lib/models/calc-api.model.d.ts +0 -57
  98. package/src/lib/models/calc-api.model.js +0 -39
  99. package/src/lib/models/calc-api.model.js.map +0 -1
  100. package/src/lib/models/constants/index.d.ts +0 -36
  101. package/src/lib/models/constants/index.js +0 -43
  102. package/src/lib/models/constants/index.js.map +0 -1
  103. package/src/lib/models/index.js +0 -5
  104. package/src/lib/models/index.js.map +0 -1
  105. package/src/lib/models/leap-events.model.d.ts +0 -56
  106. package/src/lib/models/leap-events.model.js +0 -71
  107. package/src/lib/models/leap-events.model.js.map +0 -1
  108. package/src/lib/models/leap.model.d.ts +0 -54
  109. package/src/lib/models/leap.model.js +0 -29
  110. package/src/lib/models/leap.model.js.map +0 -1
  111. package/src/lib/services/calc-api/calc-api-service.interface.d.ts +0 -6
  112. package/src/lib/services/calc-api/calc-api-service.interface.js +0 -3
  113. package/src/lib/services/calc-api/calc-api-service.interface.js.map +0 -1
  114. package/src/lib/services/calc-api/calc-word.service.d.ts +0 -12
  115. package/src/lib/services/calc-api/calc-word.service.js +0 -99
  116. package/src/lib/services/calc-api/calc-word.service.js.map +0 -1
  117. package/src/lib/services/calc-api/promise-helper.function.d.ts +0 -2
  118. package/src/lib/services/calc-api/promise-helper.function.js +0 -32
  119. package/src/lib/services/calc-api/promise-helper.function.js.map +0 -1
  120. package/src/lib/services/custom-xml-part.service.d.ts +0 -5
  121. package/src/lib/services/custom-xml-part.service.js +0 -269
  122. package/src/lib/services/custom-xml-part.service.js.map +0 -1
  123. package/src/lib/services/document/document.service.d.ts +0 -16
  124. package/src/lib/services/document/document.service.js +0 -32
  125. package/src/lib/services/document/document.service.js.map +0 -1
  126. package/src/lib/services/index.js +0 -9
  127. package/src/lib/services/index.js.map +0 -1
  128. package/src/lib/services/leap-events.service.d.ts +0 -26
  129. package/src/lib/services/leap-events.service.js +0 -357
  130. package/src/lib/services/leap-events.service.js.map +0 -1
  131. package/src/lib/services/logger/logger.service.d.ts +0 -10
  132. package/src/lib/services/logger/logger.service.js +0 -39
  133. package/src/lib/services/logger/logger.service.js.map +0 -1
@@ -0,0 +1,32 @@
1
+ export const leap_liveb_au = {
2
+ envName: 'liveb',
3
+ brand: 'LEAP',
4
+ region: 'au',
5
+ production: true,
6
+ imports: [],
7
+ keys: {
8
+ pnSubscribe: 'sub-a456f002-0095-11e2-9638-9581afc33ebf',
9
+ },
10
+ authApi: {
11
+ baseUrl: 'https://auth.leap.services',
12
+ clientId: 'XKGMO3JQNSZOYDK2',
13
+ redirectPath: 'index.html',
14
+ },
15
+ automation: 'https://office-automation-api-liveb.leapaws.com.au',
16
+ docsApi: 'https://api-docs-liveb.leapaws.com.au',
17
+ schemaApi: 'https://schema-api-au-live.leap.services',
18
+ leapDesignApi: {
19
+ baseUrl: 'https://leapdesign.leapaws.com.au',
20
+ projectId: 'Live',
21
+ },
22
+ calcApi: {
23
+ remote: 'https://leapcalc-au-live.leap.services',
24
+ local: 'http://localhost:9091',
25
+ },
26
+ docBuilderApi: {
27
+ remote: 'https://doc-builder-liveb.leapaws.com.au',
28
+ local: 'http://localhost:9092',
29
+ },
30
+ pubSubApi: '',
31
+ pubSubNotificationPublishKey: '',
32
+ };
@@ -0,0 +1,33 @@
1
+ export const leap_test_au = {
2
+ envName: 'test',
3
+ brand: 'LEAP',
4
+ region: 'au',
5
+ production: true,
6
+ imports: [],
7
+ keys: {
8
+ pnSubscribe: 'sub-a456f002-0095-11e2-9638-9581afc33ebf',
9
+ },
10
+ authApi: {
11
+ baseUrl: 'https://auth-test.leap.services',
12
+ clientId: 'OBIUNINUL9DBSR8F',
13
+ redirectPath: 'index.html',
14
+ },
15
+ automation: 'https://office-automation-api-test.leapaws.com.au',
16
+ docsApi: 'https://api-docs-test.leapaws.com.au',
17
+ schemaApi: 'https://schema-api-au-test.leap.services',
18
+ leapDesignApi: {
19
+ baseUrl: 'https://leapdesign.leapaws.com.au',
20
+ projectId: 'Test',
21
+ },
22
+ calcApi: {
23
+ remote: 'https://leapcalc-au-test.leap.services',
24
+ local: 'http://localhost:9091',
25
+ },
26
+ docBuilderApi: {
27
+ remote: 'https://doc-builder-test.leapaws.com.au',
28
+ local: 'http://localhost:9092',
29
+ },
30
+ pubSubApi: 'https://leap-pubsub.test.leapaws.com.au',
31
+ pubSubNotificationPublishKey:
32
+ 'cZDuczPU9v1Qt_v8zKzqr39ImQW8ThDy6swhtFSNhR64AzFu-tUg-w==',
33
+ };
@@ -0,0 +1,33 @@
1
+ export const leap_test_ca = {
2
+ envName: 'test',
3
+ brand: 'LEAP',
4
+ region: 'ca',
5
+ production: true,
6
+ imports: [],
7
+ keys: {
8
+ pnSubscribe: 'sub-a456f002-0095-11e2-9638-9581afc33ebf',
9
+ },
10
+ authApi: {
11
+ baseUrl: 'https://auth-test.leap.services',
12
+ clientId: 'OBIUNINUL9DBSR8F',
13
+ redirectPath: 'index.html',
14
+ },
15
+ automation: 'https://office-automation-api.test.leapaws.ca',
16
+ docsApi: 'https://api-docs.test.leapaws.ca',
17
+ schemaApi: 'https://schema-api.ca.test.leap.services',
18
+ leapDesignApi: {
19
+ baseUrl: 'https://leapdesign.leapaws.ca',
20
+ projectId: 'Test',
21
+ },
22
+ calcApi: {
23
+ remote: 'https://leapcalc.ca.test.leap.services',
24
+ local: 'http://localhost:9091',
25
+ },
26
+ docBuilderApi: {
27
+ remote: 'https://doc-builder.test.leapaws.ca',
28
+ local: 'http://localhost:9092',
29
+ },
30
+ pubSubApi: 'https://leap-pubsub.test.leapaws.ca',
31
+ pubSubNotificationPublishKey:
32
+ 'xcQIILz8R-TKSclEFH1il_zAyXjD7fVGzPWYYgA-Or6-AzFuFztkEA==',
33
+ };
@@ -0,0 +1,33 @@
1
+ export const leap_test_nz = {
2
+ envName: 'test',
3
+ brand: 'LEAP',
4
+ region: 'au',
5
+ production: true,
6
+ imports: [],
7
+ keys: {
8
+ pnSubscribe: 'sub-a456f002-0095-11e2-9638-9581afc33ebf',
9
+ },
10
+ authApi: {
11
+ baseUrl: 'https://auth-test.leap.services',
12
+ clientId: 'OBIUNINUL9DBSR8F',
13
+ redirectPath: 'index.html',
14
+ },
15
+ automation: 'https://office-automation-api-test.leapaws.com.au',
16
+ docsApi: 'https://api-docs-test.leapaws.com.au',
17
+ schemaApi: 'https://schema-api-au-test.leap.services',
18
+ leapDesignApi: {
19
+ baseUrl: 'https://leapdesign.leapaws.com.au',
20
+ projectId: 'Test',
21
+ },
22
+ calcApi: {
23
+ remote: 'https://leapcalc-au-test.leap.services',
24
+ local: 'http://localhost:9091',
25
+ },
26
+ docBuilderApi: {
27
+ remote: 'https://doc-builder-test.leapaws.com.au',
28
+ local: 'http://localhost:9092',
29
+ },
30
+ pubSubApi: 'https://leap-pubsub.test.leapaws.com.au',
31
+ pubSubNotificationPublishKey:
32
+ 'cZDuczPU9v1Qt_v8zKzqr39ImQW8ThDy6swhtFSNhR64AzFu-tUg-w==',
33
+ };
@@ -0,0 +1,33 @@
1
+ export const leap_test_uk = {
2
+ envName: 'test',
3
+ brand: 'LEAP',
4
+ region: 'uk',
5
+ production: true,
6
+ imports: [],
7
+ keys: {
8
+ pnSubscribe: 'sub-a456f002-0095-11e2-9638-9581afc33ebf',
9
+ },
10
+ authApi: {
11
+ baseUrl: 'https://auth-test.leap.services',
12
+ clientId: 'OBIUNINUL9DBSR8F',
13
+ redirectPath: 'index.html',
14
+ },
15
+ automation: 'https://office-automation-api-test.leapaws.co.uk',
16
+ docsApi: 'https://api-docs-test.leapaws.co.uk',
17
+ schemaApi: 'https://schema-api-uk-test.leap.services',
18
+ leapDesignApi: {
19
+ baseUrl: 'https://leapdesign.leapaws.co.uk',
20
+ projectId: 'Test',
21
+ },
22
+ calcApi: {
23
+ remote: 'https://leapcalc-uk-test.leap.services',
24
+ local: 'http://localhost:9091',
25
+ },
26
+ docBuilderApi: {
27
+ remote: 'https://doc-builder-test.leapaws.co.uk',
28
+ local: 'http://localhost:9092',
29
+ },
30
+ pubSubApi: 'https://leap-pubsub.test.leapaws.co.uk',
31
+ pubSubNotificationPublishKey:
32
+ '1h9GBi291HSYas4tJBA-VE5p9laQpVXFxGp9LOCjQTKFAzFupIOgZg==',
33
+ };
@@ -0,0 +1,33 @@
1
+ export const leap_test_us = {
2
+ envName: 'test',
3
+ brand: 'LEAP',
4
+ region: 'us',
5
+ production: true,
6
+ imports: [],
7
+ keys: {
8
+ pnSubscribe: 'sub-a456f002-0095-11e2-9638-9581afc33ebf',
9
+ },
10
+ authApi: {
11
+ baseUrl: 'https://auth-test.leap.services',
12
+ clientId: 'OBIUNINUL9DBSR8F',
13
+ redirectPath: 'index.html',
14
+ },
15
+ automation: 'https://office-automation-api-test.leapaws.com',
16
+ docsApi: 'https://api-docs-test.leapaws.com',
17
+ schemaApi: 'https://schema-api-us-test.leap.services',
18
+ leapDesignApi: {
19
+ baseUrl: 'https://leapdesign.leapaws.com',
20
+ projectId: 'Test',
21
+ },
22
+ calcApi: {
23
+ remote: 'https://leapcalc-us-test.leap.services',
24
+ local: 'http://localhost:9091',
25
+ },
26
+ docBuilderApi: {
27
+ remote: 'https://doc-builder-test.leapaws.com',
28
+ local: 'http://localhost:9092',
29
+ },
30
+ pubSubApi: 'https://leap-pubsub.test.leapaws.com',
31
+ pubSubNotificationPublishKey:
32
+ 'd_WIgaqxSYFgw2Lc8dHP1h0JSxCIpjw3igJjo5W3m_y-AzFuvczY0A==',
33
+ };
@@ -0,0 +1,100 @@
1
+ // String helpers
2
+ /*
3
+ * Function to convert from UTF8 to Base64 solving the Unicode Problem
4
+ * Requires: window.btoa and window.encodeURIComponent functions
5
+ * More info: http://stackoverflow.com/questions/30106476/using-javascripts-atob-to-decode-base64-doesnt-properly-decode-utf-8-strings
6
+ * Samples:
7
+ * b64EncodeUnicode('✓ à la mode'); // "4pyTIMOgIGxhIG1vZGU="
8
+ * b64EncodeUnicode('\n'); // "Cg=="
9
+ */
10
+ export function b64EncodeUnicode(str: string): string | null {
11
+ if (window && 'btoa' in window && 'encodeURIComponent' in window) {
12
+ return window.btoa(
13
+ encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => {
14
+ return String.fromCharCode(('0x' + p1) as any);
15
+ })
16
+ );
17
+ } else {
18
+ console.warn(
19
+ 'b64EncodeUnicode requirements: window.btoa and window.encodeURIComponent functions'
20
+ );
21
+ return null;
22
+ }
23
+ }
24
+
25
+ /*
26
+ * Function to convert from Base64 to UTF8 solving the Unicode Problem
27
+ * Requires window.atob and window.decodeURIComponent functions
28
+ * More info: http://stackoverflow.com/questions/30106476/using-javascripts-atob-to-decode-base64-doesnt-properly-decode-utf-8-strings
29
+ * Samples:
30
+ * b64DecodeUnicode('4pyTIMOgIGxhIG1vZGU='); // "✓ à la mode"
31
+ * b64DecodeUnicode('Cg=='); // "\n"
32
+ */
33
+ export function b64DecodeUnicode(str: string): string | null {
34
+ if (!str) {
35
+ return null;
36
+ }
37
+ if (window && 'atob' in window && 'decodeURIComponent' in window) {
38
+ return decodeURIComponent(
39
+ Array.prototype.map
40
+ .call(window.atob(str), (c) => {
41
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
42
+ })
43
+ .join('')
44
+ );
45
+ } else {
46
+ console.warn(
47
+ 'b64DecodeUnicode requirements: window.atob and window.decodeURIComponent functions'
48
+ );
49
+ return null;
50
+ }
51
+ }
52
+
53
+ // Object helpers
54
+ export function isNullOrUndefined(val: any): boolean {
55
+ return val == null || ['null', 'undefined'].includes(val.toString());
56
+ }
57
+
58
+ //LEAP office async helpers
59
+ declare let Office: any;
60
+ declare let Word: any;
61
+
62
+ export type PromisifiedFunction<T> = (...args: any[]) => Promise<T>;
63
+
64
+ export function promisifyAsync<T>(fn: Function): PromisifiedFunction<T> {
65
+ return function promisified(...args: any[]) {
66
+ return new Promise<T>((resolve, reject) => {
67
+ try {
68
+ Promise.resolve()
69
+ .then(() => {
70
+ // console.log('WORD CONTEXT SYNC BEFORE');
71
+ // Word context sync
72
+ Word.run((context: any) => {
73
+ return context.sync();
74
+ });
75
+ })
76
+ .then(() => {
77
+ fn(...args, (asyncResult: any): void => {
78
+ if (asyncResult.status === Office.AsyncResultStatus.Failed || asyncResult.error) {
79
+ reject(asyncResult.error);
80
+ } else {
81
+ resolve(asyncResult.value as T);
82
+ }
83
+ });
84
+ })
85
+ .catch((error) => {
86
+ reject(error);
87
+ })
88
+ .then(() => {
89
+ // console.log('WORD CONTEXT SYNC AFTER');
90
+ // Word context sync
91
+ Word.run((context: any) => {
92
+ return context.sync();
93
+ });
94
+ });
95
+ } catch (error) {
96
+ reject(error);
97
+ }
98
+ });
99
+ };
100
+ }
@@ -0,0 +1,41 @@
1
+ import { Builder, Parser, ParserOptions } from 'xml2js';
2
+
3
+ const getParser = (options?: ParserOptions): Parser => {
4
+ let defaultParserOptions: ParserOptions = {
5
+ explicitArray: false,
6
+ explicitRoot: false,
7
+ ignoreAttrs: true,
8
+ trim: true,
9
+ };
10
+ let parser = new Parser(options || defaultParserOptions);
11
+ return parser;
12
+ };
13
+
14
+ export const toObj = (xml: string): Promise<any> => {
15
+ return new Promise((resolve, reject) => {
16
+ if (xml) {
17
+ getParser()
18
+ .parseStringPromise(xml)
19
+ .then((result) => {
20
+ resolve(result);
21
+ })
22
+ .catch((error) => {
23
+ reject(error);
24
+ });
25
+ } else {
26
+ reject('XML is not supplied');
27
+ }
28
+ });
29
+ };
30
+
31
+ export const toXml = (
32
+ data: any,
33
+ rootTagName: string,
34
+ options?: any
35
+ ): string => {
36
+ const builder = new Builder(options);
37
+ const xmlObject = { [rootTagName]: data };
38
+ let xml = builder.buildObject(xmlObject);
39
+ xml = xml.replace(new RegExp(' & ', 'g'), ' &amp; ');
40
+ return xml;
41
+ };
@@ -0,0 +1,74 @@
1
+ export class CreateSessionRequest {
2
+ executionContext!: {
3
+ firmGUID: string;
4
+ firmJSON?: any;
5
+ matterGUID: string;
6
+ matterJSON?: any;
7
+ cardGUID?: string;
8
+ cardJSON?: any;
9
+ documentGUID?: string;
10
+ documentJSON?: any;
11
+ defaultFileId?: string;
12
+ trace?: boolean;
13
+ };
14
+
15
+ constructor(init?: Partial<CreateSessionRequest>) {
16
+ if (init) {
17
+ // noinspection TypeScriptValidateTypes
18
+ Object.assign(this, init);
19
+ }
20
+ }
21
+ }
22
+
23
+ export class EvaluatePathsRequest {
24
+ executionContext!: {
25
+ sessionId?: string;
26
+ transactionId?: string;
27
+ firmGUID?: string;
28
+ firmJSON?: any;
29
+ matterGUID?: string;
30
+ matterJSON?: any;
31
+ cardGUID?: string;
32
+ cardJSON?: any;
33
+ documentGUID?: string;
34
+ documentJSON?: any;
35
+ defaultFileId?: string;
36
+ };
37
+ paths!: string[];
38
+ parameters!: {
39
+ firmId: string;
40
+ matterId: string;
41
+ region: string;
42
+ paths: Array<string>;
43
+ };
44
+ objectId?: string;
45
+ includeDefaults: boolean = true; // Required
46
+
47
+ constructor(init?: Partial<EvaluatePathsRequest>) {
48
+ if (init) {
49
+ // noinspection TypeScriptValidateTypes
50
+ Object.assign(this, init);
51
+ }
52
+ }
53
+ }
54
+
55
+ export class EvaluatePathsResponse {
56
+ path!: string;
57
+ result: any;
58
+ status!: string;
59
+ error?: { name: string; code: string; message: string; };
60
+
61
+ constructor(init?: Partial<EvaluatePathsResponse>) {
62
+ if (init) {
63
+ // noinspection TypeScriptValidateTypes
64
+ Object.assign(this, init);
65
+ }
66
+ }
67
+ }
68
+
69
+ export enum AppPlatformId {
70
+ Word = 'word',
71
+ Web = 'web',
72
+ Desktop = 'desktop',
73
+ AppFirst = 'app-first'
74
+ }
@@ -0,0 +1,29 @@
1
+ export const constants = {
2
+ LeapWordCustomPartNamespace: 'http://LEAPWordCustomPart.com',
3
+ LeapWordCustomPartTagName: 'LEAPWordCustomPart',
4
+ LeapDocumentDataNamespace: 'http://LeapDocumentData.com',
5
+ LeapDocumentDataRootTagName: 'LeapDocumentData',
6
+ LeapModelDataNamespace: 'http://LeapModelData.com',
7
+ LeapModelDataRootTagName: 'LeapModelData',
8
+ LeapTemplateDataNamespace: 'http://LeapTemplateData.com',
9
+ LeapTemplateDataRootTagName: 'LeapTemplateData',
10
+ LeapAppDataNamespace: 'http://LeapAppData.com',
11
+ LeapAppDataRootTagName: 'LeapAppData',
12
+ LeapEventsNamespace: 'http://LeapEvents.com',
13
+ LeapEventsRootTagName: 'LeapEvents',
14
+ LeapFieldsNamespace: 'http://LEAPDocumentFields.com',
15
+ LeapFieldsRootTagName: 'LEAPFields',
16
+ LeapTableFieldsNamespace: 'http://LEAPWordTableFields.com',
17
+ LeapTableFieldsRootTagName: 'LEAPWordTableFields',
18
+ LeapAsksNamespace: 'http://LEAPAsks.com',
19
+ LeapAsksRootTagName: 'LEAPAsks',
20
+ LeapConditionalFieldsNamespace: 'http://LEAPConditionalFields.com',
21
+ LeapConditionalFieldsRootTagName: 'LEAPConditionalFields',
22
+ LeapFunctionsNamespace: 'http://LEAPFunctions.com',
23
+ LeapFunctionsRootTagName: 'LEAPFunctions',
24
+ LeapAddInNamespace: 'http://LeapAddIn.com',
25
+ LeapAddInRootTagName: 'LeapAddIn',
26
+
27
+ fourdRedirectUrl: 'fourd://authcallback.com',
28
+ tokenSecondsBeforeExpire: 30,
29
+ };
@@ -1 +1 @@
1
- export * from './calc-api.model';
1
+ export * from './calc-api.model';
@@ -0,0 +1,79 @@
1
+ export class LeapEvents {
2
+ LeapEvent: (LeapEvent | string)[] = [];
3
+ currentEventId?: string;
4
+ xmlns!: string;
5
+
6
+ constructor(init?: Partial<LeapEvents>) {
7
+ if (init) {
8
+ Object.assign(this, init);
9
+ }
10
+
11
+ if (!Array.isArray(this.LeapEvent)) {
12
+ this.LeapEvent = [];
13
+ }
14
+ }
15
+ }
16
+
17
+ export class LeapEvent {
18
+ id!: string; // Guid
19
+ correlationId!: string | null; // Guid
20
+ eventType: LeapEventType = LeapEventType.Unknown;
21
+ action: LeapEventAction = LeapEventAction.Unknown;
22
+ data: any = {};
23
+
24
+ constructor(init?: Partial<LeapEvent>) {
25
+ if (init) {
26
+ Object.assign(this, init);
27
+ }
28
+ }
29
+ }
30
+
31
+ export enum LeapEventType {
32
+ Unknown = 0,
33
+ VstoEvent = 1,
34
+ WordAppEvent = 2,
35
+ DocumentBuilderRequest = 3,
36
+ DocumentBuilderResponse = 4,
37
+ CalcApiRequest = 5,
38
+ CalcApiResponse = 6,
39
+ WordAppEventResponse = 7,
40
+ }
41
+
42
+ export enum LeapEventAction {
43
+ Unknown = 0,
44
+
45
+ Vsto_ClearDirtyFields = 10,
46
+ Vsto_UpdateDocument = 11,
47
+
48
+ WordApp_DeleteProcessedEvents = 21,
49
+ WordApp_GetMode = 22,
50
+ WordApp_GetToken = 23,
51
+ WordApp_ResetTemplate = 24,
52
+ WordApp_FindField = 25,
53
+ WordApp_InsertField = 26,
54
+ WordApp_CreateDocument = 27,
55
+
56
+ DocumentBuilder_UpdateFields = 31,
57
+ DocumentBuilder_UpdateFieldsPartial = 32,
58
+ DocumentBuilder_SetValue = 33,
59
+ DocumentBuilder_NewDefinableTable = 34,
60
+ DocumentBuilder_UpdateDefinableTable = 35,
61
+ DocumentBuilder_UpdateDefinableTableBatch = 36,
62
+ DocumentBuilder_DeleteDefinableTable = 37,
63
+
64
+ DocumentBuilder_UpdateFieldsResponse = 41,
65
+ DocumentBuilder_UpdateFieldsPartialResponse = 42,
66
+ DocumentBuilder_SetValueResponse = 43,
67
+ DocumentBuilder_NewDefinableTableResponse = 44,
68
+ DocumentBuilder_UpdateDefinableTableResponse = 45,
69
+ DocumentBuilder_UpdateDefinableTableBatchResponse = 46,
70
+ DocumentBuilder_DeleteDefinableTableResponse = 47,
71
+
72
+ Calc_EvaluatePaths = 51,
73
+ Calc_EvaluatePathsResponse = 61,
74
+
75
+ WordApp_GetModeResponse = 71,
76
+ WordApp_UpdateIfStatements = 72,
77
+ WordApp_GetTokenResponse = 73,
78
+ WordApp_ResetTemplateResponse = 74,
79
+ }
@@ -0,0 +1,78 @@
1
+ export class LeapDocumentData {
2
+ appId: string | undefined;
3
+ documentId: string | undefined;
4
+ templateId: string | undefined;
5
+ firmId: string | undefined;
6
+ matterId: string | undefined;
7
+ isCustom: string | undefined;
8
+ isPrecedent: string | undefined; // '1' | '0'
9
+ isReady?: string; // 'true' | 'false' - detect whether initModel has been triggered when creating document
10
+ action: string | undefined;
11
+ apiToken: string | undefined;
12
+ defaultTableId: string | undefined;
13
+ defaultTableOrder: string | undefined;
14
+ region: string | undefined;
15
+ mode: string | undefined; // 0 = Online, 1 = Offline
16
+ xmlns: string | undefined;
17
+ precedentClass: string | undefined;
18
+ usedByPrecedentId?: string | undefined;
19
+ usedByPrecedentName?: string | undefined;
20
+ wordStyleId?: string | undefined;
21
+ appliedWordStyleVersionId?: string | undefined;
22
+
23
+ sessionId: string | undefined;
24
+ transactionId?: string;
25
+ matterTypeId?: string; // Deprecated - to be removed when phoenix frontend changes
26
+ state?: string; // Deprecated - to be removed when phoenix frontend changes
27
+ states?: string[];
28
+ params?: any;
29
+ instanceId?: string;
30
+
31
+ requireLogout?: boolean; // Only to bypass Microsoft Approval - to be removed once ByLawyers word app gets approved
32
+
33
+ constructor(init?: Partial<LeapDocumentData>) {
34
+ if (init) {
35
+ Object.assign(this, init);
36
+ }
37
+ }
38
+ }
39
+
40
+ export enum PreviewMode {
41
+ WebPreview = 'preview-web',
42
+ DesktopPreview = 'preview-desktop',
43
+ }
44
+
45
+ export enum LeapRegion {
46
+ AU = 'au',
47
+ UK = 'uk',
48
+ US = 'us',
49
+ }
50
+
51
+ export class LeapModelData {
52
+ xmlns: string | undefined;
53
+ }
54
+
55
+ export class LeapTemplateData {
56
+ xmlns: string | undefined;
57
+ definitions: any;
58
+ settings: any;
59
+ caMatter?: any;
60
+ eNotes: any;
61
+ activeENotes: ActiveENote[] | undefined;
62
+ activeENotesCount: number | undefined;
63
+ }
64
+
65
+ export interface ActiveENote {
66
+ index: string;
67
+ note: string;
68
+ }
69
+
70
+ export type LEAPUser = {
71
+ userId: string;
72
+ email: string;
73
+ firstName: string;
74
+ lastName: string;
75
+ env: string;
76
+ countryCode: number;
77
+ region: string;
78
+ };
@@ -0,0 +1,22 @@
1
+ export type SignalRMessage<T> = {
2
+ action: string;
3
+ payload: T;
4
+ sessionId: string;
5
+ requestId: string;
6
+ source: string;
7
+ }
8
+
9
+ export type SignalRInitData = {
10
+ code: string;
11
+ codeChallenge: string;
12
+ contentModeEnabled: boolean;
13
+ country: string;
14
+ countryCode: number;
15
+ hostType: string;
16
+ hostVersion: string;
17
+ environment: string;
18
+ firmId: string;
19
+ staffId: string;
20
+ userId: string;
21
+ userName: string;
22
+ }