@leapdev/app-platform 0.1.0-beta.4 → 0.1.0-beta.5

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 (142) hide show
  1. package/package.json +15 -15
  2. package/src/index.d.ts +25 -0
  3. package/src/index.js +42 -0
  4. package/src/index.js.map +1 -0
  5. package/src/lib/app-platform.d.ts +37 -0
  6. package/src/lib/app-platform.js +231 -0
  7. package/src/lib/app-platform.js.map +1 -0
  8. package/src/lib/environment/environment.d.ts +37 -0
  9. package/src/lib/environment/environment.dictionary.d.ts +4 -0
  10. package/src/lib/environment/environment.dictionary.js +30 -0
  11. package/src/lib/environment/environment.dictionary.js.map +1 -0
  12. package/src/lib/environment/environment.js +17 -0
  13. package/src/lib/environment/environment.js.map +1 -0
  14. package/src/lib/environment/{index.ts → index.d.ts} +2 -2
  15. package/src/lib/environment/index.js +9 -0
  16. package/src/lib/environment/index.js.map +1 -0
  17. package/src/lib/environment/leap/env.dev.au.config.d.ts +32 -0
  18. package/src/lib/environment/leap/env.dev.au.config.js +36 -0
  19. package/src/lib/environment/leap/env.dev.au.config.js.map +1 -0
  20. package/src/lib/environment/leap/env.live.au.config.d.ts +32 -0
  21. package/src/lib/environment/leap/env.live.au.config.js +36 -0
  22. package/src/lib/environment/leap/env.live.au.config.js.map +1 -0
  23. package/src/lib/environment/leap/env.live.ca.config.d.ts +32 -0
  24. package/src/lib/environment/leap/env.live.ca.config.js +36 -0
  25. package/src/lib/environment/leap/env.live.ca.config.js.map +1 -0
  26. package/src/lib/environment/leap/env.live.nz.config.d.ts +32 -0
  27. package/src/lib/environment/leap/env.live.nz.config.js +36 -0
  28. package/src/lib/environment/leap/env.live.nz.config.js.map +1 -0
  29. package/src/lib/environment/leap/env.live.uk.config.d.ts +32 -0
  30. package/src/lib/environment/leap/env.live.uk.config.js +36 -0
  31. package/src/lib/environment/leap/env.live.uk.config.js.map +1 -0
  32. package/src/lib/environment/leap/env.live.us.config.d.ts +32 -0
  33. package/src/lib/environment/leap/env.live.us.config.js +36 -0
  34. package/src/lib/environment/leap/env.live.us.config.js.map +1 -0
  35. package/src/lib/environment/leap/env.liveb.au.config.d.ts +32 -0
  36. package/src/lib/environment/leap/env.liveb.au.config.js +36 -0
  37. package/src/lib/environment/leap/env.liveb.au.config.js.map +1 -0
  38. package/src/lib/environment/leap/env.test.au.config.d.ts +32 -0
  39. package/src/lib/environment/leap/env.test.au.config.js +36 -0
  40. package/src/lib/environment/leap/env.test.au.config.js.map +1 -0
  41. package/src/lib/environment/leap/env.test.ca.config.d.ts +32 -0
  42. package/src/lib/environment/leap/env.test.ca.config.js +36 -0
  43. package/src/lib/environment/leap/env.test.ca.config.js.map +1 -0
  44. package/src/lib/environment/leap/env.test.nz.config.d.ts +32 -0
  45. package/src/lib/environment/leap/env.test.nz.config.js +36 -0
  46. package/src/lib/environment/leap/env.test.nz.config.js.map +1 -0
  47. package/src/lib/environment/leap/env.test.uk.config.d.ts +32 -0
  48. package/src/lib/environment/leap/env.test.uk.config.js +36 -0
  49. package/src/lib/environment/leap/env.test.uk.config.js.map +1 -0
  50. package/src/lib/environment/leap/env.test.us.config.d.ts +32 -0
  51. package/src/lib/environment/leap/env.test.us.config.js +36 -0
  52. package/src/lib/environment/leap/env.test.us.config.js.map +1 -0
  53. package/src/lib/functions/helpers.d.ts +5 -0
  54. package/src/lib/functions/helpers.js +95 -0
  55. package/src/lib/functions/helpers.js.map +1 -0
  56. package/src/lib/functions/xml.d.ts +2 -0
  57. package/src/lib/functions/xml.js +41 -0
  58. package/src/lib/functions/xml.js.map +1 -0
  59. package/src/lib/models/calc-api.model.d.ts +57 -0
  60. package/src/lib/models/calc-api.model.js +39 -0
  61. package/src/lib/models/calc-api.model.js.map +1 -0
  62. package/src/lib/models/constants/index.d.ts +28 -0
  63. package/src/lib/models/constants/index.js +32 -0
  64. package/src/lib/models/constants/index.js.map +1 -0
  65. package/src/lib/models/{index.ts → index.d.ts} +1 -1
  66. package/src/lib/models/index.js +5 -0
  67. package/src/lib/models/index.js.map +1 -0
  68. package/src/lib/models/leap-events.model.d.ts +56 -0
  69. package/src/lib/models/leap-events.model.js +71 -0
  70. package/src/lib/models/leap-events.model.js.map +1 -0
  71. package/src/lib/models/leap.model.d.ts +65 -0
  72. package/src/lib/models/leap.model.js +29 -0
  73. package/src/lib/models/leap.model.js.map +1 -0
  74. package/src/lib/models/signalr.model.d.ts +21 -0
  75. package/src/lib/models/signalr.model.js +3 -0
  76. package/src/lib/models/signalr.model.js.map +1 -0
  77. package/src/lib/services/auth/auth.service.d.ts +13 -0
  78. package/src/lib/services/auth/auth.service.js +185 -0
  79. package/src/lib/services/auth/auth.service.js.map +1 -0
  80. package/src/lib/services/calc-api/calc-api-service.interface.d.ts +4 -0
  81. package/src/lib/services/calc-api/calc-api-service.interface.js +3 -0
  82. package/src/lib/services/calc-api/calc-api-service.interface.js.map +1 -0
  83. package/src/lib/services/calc-api/calc-word.service.d.ts +10 -0
  84. package/src/lib/services/calc-api/calc-word.service.js +63 -0
  85. package/src/lib/services/calc-api/calc-word.service.js.map +1 -0
  86. package/src/lib/services/calc-api/promise-helper.function.d.ts +2 -0
  87. package/src/lib/services/calc-api/promise-helper.function.js +32 -0
  88. package/src/lib/services/calc-api/promise-helper.function.js.map +1 -0
  89. package/src/lib/services/custom-xml-part.service.d.ts +5 -0
  90. package/src/lib/services/custom-xml-part.service.js +269 -0
  91. package/src/lib/services/custom-xml-part.service.js.map +1 -0
  92. package/src/lib/services/document/document.service.d.ts +16 -0
  93. package/src/lib/services/document/document.service.js +32 -0
  94. package/src/lib/services/document/document.service.js.map +1 -0
  95. package/src/lib/services/{index.ts → index.d.ts} +5 -10
  96. package/src/lib/services/index.js +9 -0
  97. package/src/lib/services/index.js.map +1 -0
  98. package/src/lib/services/leap-events.service.d.ts +26 -0
  99. package/src/lib/services/leap-events.service.js +357 -0
  100. package/src/lib/services/leap-events.service.js.map +1 -0
  101. package/src/lib/services/logger/logger.service.d.ts +10 -0
  102. package/src/lib/services/logger/logger.service.js +39 -0
  103. package/src/lib/services/logger/logger.service.js.map +1 -0
  104. package/src/lib/services/signalr/signalr.service.d.ts +9 -0
  105. package/src/lib/services/signalr/signalr.service.js +93 -0
  106. package/src/lib/services/signalr/signalr.service.js.map +1 -0
  107. package/.eslintrc.json +0 -25
  108. package/project.json +0 -27
  109. package/src/index.ts +0 -44
  110. package/src/lib/app-platform.ts +0 -270
  111. package/src/lib/environment/environment.dictionary.ts +0 -28
  112. package/src/lib/environment/environment.ts +0 -44
  113. package/src/lib/environment/leap/env.dev.au.config.ts +0 -33
  114. package/src/lib/environment/leap/env.live.au.config.ts +0 -32
  115. package/src/lib/environment/leap/env.live.ca.config.ts +0 -32
  116. package/src/lib/environment/leap/env.live.nz.config.ts +0 -32
  117. package/src/lib/environment/leap/env.live.uk.config.ts +0 -32
  118. package/src/lib/environment/leap/env.live.us.config.ts +0 -32
  119. package/src/lib/environment/leap/env.liveb.au.config.ts +0 -32
  120. package/src/lib/environment/leap/env.test.au.config.ts +0 -33
  121. package/src/lib/environment/leap/env.test.ca.config.ts +0 -33
  122. package/src/lib/environment/leap/env.test.nz.config.ts +0 -33
  123. package/src/lib/environment/leap/env.test.uk.config.ts +0 -33
  124. package/src/lib/environment/leap/env.test.us.config.ts +0 -33
  125. package/src/lib/functions/helpers.ts +0 -100
  126. package/src/lib/functions/xml.ts +0 -41
  127. package/src/lib/models/calc-api.model.ts +0 -74
  128. package/src/lib/models/constants/index.ts +0 -29
  129. package/src/lib/models/leap-events.model.ts +0 -79
  130. package/src/lib/models/leap.model.ts +0 -78
  131. package/src/lib/models/signalr.model.ts +0 -22
  132. package/src/lib/services/auth/auth.service.ts +0 -219
  133. package/src/lib/services/calc-api/calc-api-service.interface.ts +0 -12
  134. package/src/lib/services/calc-api/calc-word.service.ts +0 -117
  135. package/src/lib/services/calc-api/promise-helper.function.ts +0 -26
  136. package/src/lib/services/custom-xml-part.service.ts +0 -340
  137. package/src/lib/services/document/document.service.ts +0 -33
  138. package/src/lib/services/leap-events.service.ts +0 -489
  139. package/src/lib/services/logger/logger.service.ts +0 -42
  140. package/src/lib/services/signalr/signalr.service.ts +0 -88
  141. package/tsconfig.json +0 -20
  142. package/tsconfig.lib.json +0 -12
@@ -1,32 +0,0 @@
1
- export const leap_live_uk = {
2
- envName: 'live',
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.leap.services',
12
- clientId: 'XKGMO3JQNSZOYDK2',
13
- redirectPath: 'index.html',
14
- },
15
- automation: 'https://office-automation-api-live.leapaws.co.uk',
16
- docsApi: 'https://api-docs.leapaws.co.uk',
17
- schemaApi: 'https://schema-api-uk-live.leap.services',
18
- leapDesignApi: {
19
- baseUrl: 'https://leapdesign.leapaws.co.uk',
20
- projectId: 'Live',
21
- },
22
- calcApi: {
23
- remote: 'https://leapcalc-uk-live.leap.services',
24
- local: 'http://localhost:9091',
25
- },
26
- docBuilderApi: {
27
- remote: 'https://doc-builder.leapaws.co.uk',
28
- local: 'http://localhost:9092',
29
- },
30
- pubSubApi: '',
31
- pubSubNotificationPublishKey: '',
32
- };
@@ -1,32 +0,0 @@
1
- export const leap_live_us = {
2
- envName: 'live',
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.leap.services',
12
- clientId: 'XKGMO3JQNSZOYDK2',
13
- redirectPath: 'index.html',
14
- },
15
- automation: 'https://office-automation-api-live.leapaws.com',
16
- docsApi: 'https://api-docs.leapaws.com',
17
- schemaApi: 'https://schema-api-us-live.leap.services',
18
- leapDesignApi: {
19
- baseUrl: 'https://leapdesign.leapaws.com',
20
- projectId: 'Live',
21
- },
22
- calcApi: {
23
- remote: 'https://leapcalc-us-live.leap.services',
24
- local: 'http://localhost:9091',
25
- },
26
- docBuilderApi: {
27
- remote: 'https://doc-builder.leapaws.com',
28
- local: 'http://localhost:9092',
29
- },
30
- pubSubApi: '',
31
- pubSubNotificationPublishKey: '',
32
- };
@@ -1,32 +0,0 @@
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
- };
@@ -1,33 +0,0 @@
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
- };
@@ -1,33 +0,0 @@
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
- };
@@ -1,33 +0,0 @@
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
- };
@@ -1,33 +0,0 @@
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
- };
@@ -1,33 +0,0 @@
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
- };
@@ -1,100 +0,0 @@
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
- }
@@ -1,41 +0,0 @@
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
- };
@@ -1,74 +0,0 @@
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
- }
@@ -1,29 +0,0 @@
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,79 +0,0 @@
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
- }
@@ -1,78 +0,0 @@
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
- };