@adminide-stack/extension-api 11.0.1-alpha.0 → 11.0.1-alpha.11

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 (89) hide show
  1. package/lib/connections/jsonrpc2/connection.js +507 -525
  2. package/lib/connections/jsonrpc2/connection.js.map +1 -0
  3. package/lib/connections/jsonrpc2/events.js +100 -100
  4. package/lib/connections/jsonrpc2/events.js.map +1 -0
  5. package/lib/connections/jsonrpc2/linkedMap.js +248 -246
  6. package/lib/connections/jsonrpc2/linkedMap.js.map +1 -0
  7. package/lib/connections/jsonrpc2/messages.js +36 -40
  8. package/lib/connections/jsonrpc2/messages.js.map +1 -0
  9. package/lib/connections/jsonrpc2/test-helper.js +35 -21
  10. package/lib/connections/jsonrpc2/test-helper.js.map +1 -0
  11. package/lib/connections/jsonrpc2/trace.js +70 -82
  12. package/lib/connections/jsonrpc2/trace.js.map +1 -0
  13. package/lib/connections/jsonrpc2/transport.js +56 -56
  14. package/lib/connections/jsonrpc2/transport.js.map +1 -0
  15. package/lib/connections/jsonrpc2/transports/webWorker.js +80 -88
  16. package/lib/connections/jsonrpc2/transports/webWorker.js.map +1 -0
  17. package/lib/connections/proxy/proxy.js +46 -47
  18. package/lib/connections/proxy/proxy.js.map +1 -0
  19. package/lib/connections/remote-rpc/browser-remote-rpc.js +55 -54
  20. package/lib/connections/remote-rpc/browser-remote-rpc.js.map +1 -0
  21. package/lib/connections/remote-rpc/rxjs-websockets.js +68 -68
  22. package/lib/connections/remote-rpc/rxjs-websockets.js.map +1 -0
  23. package/lib/constants/action-types.js +27 -27
  24. package/lib/constants/action-types.js.map +1 -0
  25. package/lib/constants/types.js +7 -7
  26. package/lib/constants/types.js.map +1 -0
  27. package/lib/core/expr/evaluator.js +103 -104
  28. package/lib/core/expr/evaluator.js.map +1 -0
  29. package/lib/core/expr/lexer.js +366 -361
  30. package/lib/core/expr/lexer.js.map +1 -0
  31. package/lib/core/expr/parser.js +228 -217
  32. package/lib/core/expr/parser.js.map +1 -0
  33. package/lib/core/types/ext-host-types.js +53 -54
  34. package/lib/core/types/ext-host-types.js.map +1 -0
  35. package/lib/index.js +1 -1
  36. package/lib/index.js.map +1 -0
  37. package/lib/interfaces/contributions/contribution.js +40 -40
  38. package/lib/interfaces/contributions/contribution.js.map +1 -0
  39. package/lib/interfaces/graphql.js +1 -1
  40. package/lib/interfaces/graphql.js.map +1 -0
  41. package/lib/interfaces/model.js +3 -3
  42. package/lib/interfaces/model.js.map +1 -0
  43. package/lib/interfaces/text-document.js +76 -77
  44. package/lib/interfaces/text-document.js.map +1 -0
  45. package/lib/interfaces/webview/webview.js +3 -3
  46. package/lib/interfaces/webview/webview.js.map +1 -0
  47. package/lib/middlewares/extensionController.js +9 -5
  48. package/lib/middlewares/extensionController.js.map +1 -0
  49. package/lib/protocol/client.protocol.js +2 -2
  50. package/lib/protocol/client.protocol.js.map +1 -0
  51. package/lib/protocol/common.protocol.js +50 -48
  52. package/lib/protocol/common.protocol.js.map +1 -0
  53. package/lib/protocol/editor-missing-types.js +4 -4
  54. package/lib/protocol/editor-missing-types.js.map +1 -0
  55. package/lib/protocol/proxy-identifier.js +39 -39
  56. package/lib/protocol/proxy-identifier.js.map +1 -0
  57. package/lib/protocol/rpc-logger.js +39 -43
  58. package/lib/protocol/rpc-logger.js.map +1 -0
  59. package/lib/protocol/rpc-protocol.js +736 -724
  60. package/lib/protocol/rpc-protocol.js.map +1 -0
  61. package/lib/protocol/server.protocol.js +22 -22
  62. package/lib/protocol/server.protocol.js.map +1 -0
  63. package/lib/protocol/shared/editor.js +17 -17
  64. package/lib/protocol/shared/editor.js.map +1 -0
  65. package/lib/protocol/temporary-types.js +16 -16
  66. package/lib/protocol/temporary-types.js.map +1 -0
  67. package/lib/protocol/utils/lazy-promise.js +60 -61
  68. package/lib/protocol/utils/lazy-promise.js.map +1 -0
  69. package/lib/react/components/view-component/ViewComponent.js +31 -26
  70. package/lib/react/components/view-component/ViewComponent.js.map +1 -0
  71. package/lib/react/index.js +1 -1
  72. package/lib/react/index.js.map +1 -0
  73. package/lib/react/useExtensionController.js +12 -10
  74. package/lib/react/useExtensionController.js.map +1 -0
  75. package/lib/utils/abortable-rx.js +73 -70
  76. package/lib/utils/abortable-rx.js.map +1 -0
  77. package/lib/utils/errors.js +10 -10
  78. package/lib/utils/errors.js.map +1 -0
  79. package/lib/utils/extensions.js +11 -11
  80. package/lib/utils/extensions.js.map +1 -0
  81. package/lib/utils/helper.test.js +7 -4
  82. package/lib/utils/helper.test.js.map +1 -0
  83. package/lib/utils/paths-util.js +79 -82
  84. package/lib/utils/paths-util.js.map +1 -0
  85. package/lib/utils/rxjs/combineLatestOrDefault.js +72 -70
  86. package/lib/utils/rxjs/combineLatestOrDefault.js.map +1 -0
  87. package/lib/utils/util.js +24 -25
  88. package/lib/utils/util.js.map +1 -0
  89. package/package.json +5 -5
@@ -1,13 +1,13 @@
1
- const isErrorLike = (val) => !!val && typeof val === 'object' && (!!val.stack || ('message' in val || 'code' in val)) && !('__typename' in val);
1
+ const isErrorLike = val => !!val && typeof val === 'object' && (!!val.stack || 'message' in val || 'code' in val) && !('__typename' in val);
2
2
  /**
3
3
  * Ensures a value is a proper Error, copying all properties if needed
4
4
  */
5
- const asError = (err) => {
6
- if (err instanceof Error) {
7
- return err;
8
- }
9
- if (typeof err === 'object' && err !== null) {
10
- return Object.assign(new Error(err.message), err);
11
- }
12
- return new Error(err);
13
- };export{asError,isErrorLike};
5
+ const asError = err => {
6
+ if (err instanceof Error) {
7
+ return err;
8
+ }
9
+ if (typeof err === 'object' && err !== null) {
10
+ return Object.assign(new Error(err.message), err);
11
+ }
12
+ return new Error(err);
13
+ };export{asError,isErrorLike};//# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sources":["../../src/utils/errors.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGa,MAAA,WAAW,GAAG,GAAC,IAA8B,CAAA,CACtD,GAAE,WAAc,GAAA,aAAgB,KAAA,CAAI,CAAC,GAAK,CAAA,SAAU,aAAc,GAAA,UAAa,IAAA,GAAI,KAAK,kBAAkB,GAAI;AAElH;;AAEG;AACU,MAAA,OAAO,GAAG,GAAC,IAAmB;AACvC,EAAA,IAAA,GAAO,YAAA,KAAiB,EAAA;AACpB,IAAA,OAAA,GAAA;;MAEA,OAAA,QAAe,QAAA,OAAe,KAAA,IAAS,EAAA;AACvC,IAAA,OAAA,MAAa,CAAA,MAAO,CAAA,IAAC,KAAS,CAAA,GAAA,CAAC,OAAW,CAAA,EAAA,GAAG,CAAA;;AAEjD,EAAA,OAAA,IAAW,KAAA,CAAA,GAAM,CAAA;AACrB"}
@@ -6,14 +6,14 @@ import {isErrorLike}from'./errors.js';/**
6
6
  * @returns The extension's script URL.
7
7
  */
8
8
  function getScriptURLFromExtensionManifest(extension) {
9
- if (!extension.manifest) {
10
- throw new Error(`extension ${JSON.stringify(extension.id)}: no mainfest found`);
11
- }
12
- if (isErrorLike(extension.manifest)) {
13
- throw new Error(`extension ${JSON.stringify(extension.id)}: invalid manifest: ${extension.manifest.message}`);
14
- }
15
- if (!extension.manifest.bundleURL) {
16
- throw new Error(`extension ${JSON.stringify(extension.id)}: no "url" property in manifest`);
17
- }
18
- return extension.manifest.bundleURL;
19
- }export{getScriptURLFromExtensionManifest};
9
+ if (!extension.manifest) {
10
+ throw new Error(`extension ${JSON.stringify(extension.id)}: no mainfest found`);
11
+ }
12
+ if (isErrorLike(extension.manifest)) {
13
+ throw new Error(`extension ${JSON.stringify(extension.id)}: invalid manifest: ${extension.manifest.message}`);
14
+ }
15
+ if (!extension.manifest.bundleURL) {
16
+ throw new Error(`extension ${JSON.stringify(extension.id)}: no "url" property in manifest`);
17
+ }
18
+ return extension.manifest.bundleURL;
19
+ }export{getScriptURLFromExtensionManifest};//# sourceMappingURL=extensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.js","sources":["../../src/utils/extensions.ts"],"sourcesContent":[null],"names":[],"mappings":"sCAGA;;;;;;AAMG;AACG,SAAU,iCAAiC,CAAC,SAA+B,EAAA;AAC7E,EAAA,IAAA,CAAA,SAAK,CAAA,QAAU,EAAQ;AACnB,IAAA,MAAA,IAAM,KAAI,CAAA,CAAA,UAAM,EAAA,IAAa,UAAK,CAAA,SAAU,CAAA,EAAA,CAAS,CAAC,mBAAG,CAAA,CAAA;;AAE7D,EAAA,IAAA,qBAAgB,CAAA,QAAkB,CAAA,EAAC;UACzB,IAAA,iBAAU,EAAA,IAAa,UAAK,CAAA,SAAmB,CAAA,EAAA,CAAA,CAAC,oBAAG,EAAA,kBAAiC,CAAA,OAAgB,CAAA,CAAA,CAAA;;AAE9G,EAAA,IAAA,CAAA,SAAc,CAAA,kBAAU,EAAS;AAC7B,IAAA,MAAA,IAAM,KAAI,CAAA,CAAA,UAAM,EAAA,IAAa,UAAK,CAAA,SAAU,CAAA,EAAA,CAAS,CAAC,+BAAG,CAAA,CAAA;;AAE7D,EAAA,OAAA,SAAgB,CAAA,QAAS,CAAA;AAC7B"}
@@ -4,7 +4,10 @@
4
4
  * @internal
5
5
  */
6
6
  function createBarrier() {
7
- let done;
8
- const wait = new Promise(resolve => (done = resolve));
9
- return { wait, done };
10
- }export{createBarrier};
7
+ let done;
8
+ const wait = new Promise(resolve => done = resolve);
9
+ return {
10
+ wait,
11
+ done
12
+ };
13
+ }export{createBarrier};//# sourceMappingURL=helper.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.test.js","sources":["../../src/utils/helper.test.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;AAIG;SACa,aAAa,GAAA;AACzB,EAAA,IAAA;AACA,EAAA,MAAA,IAAU,GAAA,IAAO,OAAA,CAAA,OAAqB,IAAG,IAAM,GAAA,OAAU,CAAA;AACzD,EAAA,OAAA;AACJ,IAAC,IAAA;;;"}
@@ -24,96 +24,93 @@ SOFTWARE.
24
24
  */
25
25
  const replaceRegex = new RegExp('//+', 'g');
26
26
  function resolve(...paths) {
27
- let processed = [];
28
- for (const p of paths) {
29
- if (typeof p !== 'string') {
30
- throw new TypeError('Invalid argument type to path.join: ' + (typeof p));
31
- }
32
- else if (p !== '') {
33
- if (p.charAt(0) === sep) {
34
- processed = [];
35
- }
36
- processed.push(p);
37
- }
27
+ let processed = [];
28
+ for (const p of paths) {
29
+ if (typeof p !== 'string') {
30
+ throw new TypeError('Invalid argument type to path.join: ' + typeof p);
31
+ } else if (p !== '') {
32
+ if (p.charAt(0) === sep) {
33
+ processed = [];
34
+ }
35
+ processed.push(p);
38
36
  }
39
- const resolved = normalize(processed.join(sep));
40
- if (resolved.length > 1 && resolved.charAt(resolved.length - 1) === sep) {
41
- return resolved.substr(0, resolved.length - 1);
42
- }
43
- return resolved;
37
+ }
38
+ const resolved = normalize(processed.join(sep));
39
+ if (resolved.length > 1 && resolved.charAt(resolved.length - 1) === sep) {
40
+ return resolved.substr(0, resolved.length - 1);
41
+ }
42
+ return resolved;
44
43
  }
45
44
  function relative(from, to) {
46
- let i;
47
- from = resolve(from);
48
- to = resolve(to);
49
- const fromSegments = from.split(sep);
50
- const toSegments = to.split(sep);
51
- toSegments.shift();
52
- fromSegments.shift();
53
- let upCount = 0;
54
- let downSegments = [];
55
- for (i = 0; i < fromSegments.length; i++) {
56
- const seg = fromSegments[i];
57
- if (seg === toSegments[i]) {
58
- continue;
59
- }
60
- upCount = fromSegments.length - i;
61
- break;
62
- }
63
- downSegments = toSegments.slice(i);
64
- if (fromSegments.length === 1 && fromSegments[0] === '') {
65
- upCount = 0;
66
- }
67
- if (upCount > fromSegments.length) {
68
- upCount = fromSegments.length;
69
- }
70
- let rv = '';
71
- for (i = 0; i < upCount; i++) {
72
- rv += '../';
45
+ let i;
46
+ from = resolve(from);
47
+ to = resolve(to);
48
+ const fromSegments = from.split(sep);
49
+ const toSegments = to.split(sep);
50
+ toSegments.shift();
51
+ fromSegments.shift();
52
+ let upCount = 0;
53
+ let downSegments = [];
54
+ for (i = 0; i < fromSegments.length; i++) {
55
+ const seg = fromSegments[i];
56
+ if (seg === toSegments[i]) {
57
+ continue;
73
58
  }
74
- rv += downSegments.join(sep);
75
- if (rv.length > 1 && rv.charAt(rv.length - 1) === sep) {
76
- rv = rv.substr(0, rv.length - 1);
77
- }
78
- return rv;
59
+ upCount = fromSegments.length - i;
60
+ break;
61
+ }
62
+ downSegments = toSegments.slice(i);
63
+ if (fromSegments.length === 1 && fromSegments[0] === '') {
64
+ upCount = 0;
65
+ }
66
+ if (upCount > fromSegments.length) {
67
+ upCount = fromSegments.length;
68
+ }
69
+ let rv = '';
70
+ for (i = 0; i < upCount; i++) {
71
+ rv += '../';
72
+ }
73
+ rv += downSegments.join(sep);
74
+ if (rv.length > 1 && rv.charAt(rv.length - 1) === sep) {
75
+ rv = rv.substr(0, rv.length - 1);
76
+ }
77
+ return rv;
79
78
  }
80
79
  function normalize(p) {
81
- if (p === '') {
82
- p = '.';
80
+ if (p === '') {
81
+ p = '.';
82
+ }
83
+ const absolute = p.charAt(0) === sep;
84
+ p = removeDuplicateSeparators(p);
85
+ const components = p.split(sep);
86
+ const goodComponents = [];
87
+ for (const c of components) {
88
+ if (c === '.') {
89
+ continue;
90
+ } else if (c === '..' && (absolute || !absolute && goodComponents.length > 0 && goodComponents[0] !== '..')) {
91
+ goodComponents.pop();
92
+ } else {
93
+ goodComponents.push(c);
83
94
  }
84
- const absolute = p.charAt(0) === sep;
85
- p = removeDuplicateSeparators(p);
86
- const components = p.split(sep);
87
- const goodComponents = [];
88
- for (const c of components) {
89
- if (c === '.') {
90
- continue;
91
- }
92
- else if (c === '..' && (absolute || (!absolute && goodComponents.length > 0 && goodComponents[0] !== '..'))) {
93
- goodComponents.pop();
95
+ }
96
+ if (!absolute && goodComponents.length < 2) {
97
+ switch (goodComponents.length) {
98
+ case 1:
99
+ if (goodComponents[0] === '') {
100
+ goodComponents.unshift('.');
94
101
  }
95
- else {
96
- goodComponents.push(c);
97
- }
98
- }
99
- if (!absolute && goodComponents.length < 2) {
100
- switch (goodComponents.length) {
101
- case 1:
102
- if (goodComponents[0] === '') {
103
- goodComponents.unshift('.');
104
- }
105
- break;
106
- default:
107
- goodComponents.push('.');
108
- }
109
- }
110
- p = goodComponents.join(sep);
111
- if (absolute && p.charAt(0) !== sep) {
112
- p = sep + p;
102
+ break;
103
+ default:
104
+ goodComponents.push('.');
113
105
  }
114
- return p;
106
+ }
107
+ p = goodComponents.join(sep);
108
+ if (absolute && p.charAt(0) !== sep) {
109
+ p = sep + p;
110
+ }
111
+ return p;
115
112
  }
116
113
  function removeDuplicateSeparators(p) {
117
- p = p.replace(replaceRegex, sep);
118
- return p;
119
- }export{normalize,relative,resolve};
114
+ p = p.replace(replaceRegex, sep);
115
+ return p;
116
+ }export{normalize,relative,resolve};//# sourceMappingURL=paths-util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths-util.js","sources":["../../src/utils/paths-util.ts"],"sourcesContent":[null],"names":[],"mappings":"uEAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBE;AAIF,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC;AAE3B,SAAA,OAAO,CAAC,GAAG,KAAe,EAAA;MAClC,SAAA,GAAsB,EAAA;AAC1B,EAAA,KAAA,MAAW,CAAA,IAAK,KAAA,EAAK;AACjB,IAAA,IAAA,OAAW,CAAA,KAAM,QAAA,EAAA;YACb,IAAM,SAAa,CAAA,sCAAuC,GAAA,OAAI,CAAO,CAAA;WACxE,IAAA,CAAA,KAAA,EAAA,EAAA;AAAM,MAAA,IAAA,CAAA,CAAA,MAAK,CAAA,CAAA,CAAA,KAAO,GAAG,EAAA;iBACb,GAAO,EAAA;;eAEX,CAAA,IAAA,CAAA,CAAA,CAAA;AACD;;QAEP,QAAA,GAAA,SAAA,CAAA,SAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA;MAEK,QAAA,CAAA,MAAW,GAAA,CAAA,IAAA,QAAU,CAAA,MAAU,CAAI,QAA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AAA,CAAA,EAAA;AACD,EAAA,CAAA,GAAA,CAAA,CAAA,OAAS,CAAA,YAAA,EAAA,GAAA,CAAA;AACb,EAAC,OAAA,CAAA;AAED"}
@@ -25,74 +25,76 @@ import {Observable,from,asapScheduler,zip,of}from'rxjs';/**
25
25
  * {@link defaultValue}).
26
26
  */
27
27
  function combineLatestOrDefault(observables, defaultValue) {
28
- switch (observables.length) {
29
- case 0: {
30
- // No source observables: emit an empty array and complete
31
- return of([]);
32
- }
33
- case 1: {
34
- // Only one source observable: no need to handle emission accumulation or default values
35
- return zip(...observables);
36
- }
37
- default: {
38
- return new Observable((subscriber) => {
39
- // The array of the most recent values from each input Observable.
40
- // If a source Observable has not yet emitted a value, it will be represented by the
41
- // defaultValue (if provided) or not at all (if not provided).
42
- const values = defaultValue !== undefined ? observables.map(() => defaultValue) : [];
43
- // Whether the emission of the values array has been scheduled
44
- let scheduled = false;
45
- let scheduledWork;
46
- // The number of source Observables that have not yet completed
47
- // (so that we know when to complete the output Observable)
48
- let activeObservables = observables.length;
49
- // When everything is done, clean up the values array
50
- subscriber.add(() => {
51
- values.length = 0;
52
- });
53
- // Subscribe to each source Observable. The index of the source Observable is used to
54
- // keep track of the most recent value from that Observable in the values array.
55
- for (let index = 0; index < observables.length; index++) {
56
- subscriber.add(from(observables[index]).subscribe({
57
- next: (value) => {
58
- values[index] = value;
59
- if (activeObservables === 1) {
60
- // If only one source Observable is active, emit the values array immediately
61
- // Abort any scheduled emission
62
- scheduledWork?.unsubscribe();
63
- scheduled = false;
64
- subscriber.next(values.slice());
65
- }
66
- else if (!scheduled) {
67
- scheduled = true;
68
- // Use asapScheduler to emit the values array, so that all
69
- // next values that are emitted at the same time are emitted together.
70
- // This makes tests (using expectObservable) easier to write.
71
- scheduledWork = asapScheduler.schedule(() => {
72
- if (!subscriber.closed) {
73
- subscriber.next(values.slice());
74
- scheduled = false;
75
- if (activeObservables === 0) {
76
- subscriber.complete();
77
- }
78
- }
79
- });
80
- }
81
- },
82
- error: (error) => subscriber.error(error),
83
- complete: () => {
84
- activeObservables--;
85
- if (activeObservables === 0 && !scheduled) {
86
- subscriber.complete();
87
- }
88
- },
89
- }));
28
+ switch (observables.length) {
29
+ case 0:
30
+ {
31
+ // No source observables: emit an empty array and complete
32
+ return of([]);
33
+ }
34
+ case 1:
35
+ {
36
+ // Only one source observable: no need to handle emission accumulation or default values
37
+ return zip(...observables);
38
+ }
39
+ default:
40
+ {
41
+ return new Observable(subscriber => {
42
+ // The array of the most recent values from each input Observable.
43
+ // If a source Observable has not yet emitted a value, it will be represented by the
44
+ // defaultValue (if provided) or not at all (if not provided).
45
+ const values = defaultValue !== undefined ? observables.map(() => defaultValue) : [];
46
+ // Whether the emission of the values array has been scheduled
47
+ let scheduled = false;
48
+ let scheduledWork;
49
+ // The number of source Observables that have not yet completed
50
+ // (so that we know when to complete the output Observable)
51
+ let activeObservables = observables.length;
52
+ // When everything is done, clean up the values array
53
+ subscriber.add(() => {
54
+ values.length = 0;
55
+ });
56
+ // Subscribe to each source Observable. The index of the source Observable is used to
57
+ // keep track of the most recent value from that Observable in the values array.
58
+ for (let index = 0; index < observables.length; index++) {
59
+ subscriber.add(from(observables[index]).subscribe({
60
+ next: value => {
61
+ values[index] = value;
62
+ if (activeObservables === 1) {
63
+ // If only one source Observable is active, emit the values array immediately
64
+ // Abort any scheduled emission
65
+ scheduledWork?.unsubscribe();
66
+ scheduled = false;
67
+ subscriber.next(values.slice());
68
+ } else if (!scheduled) {
69
+ scheduled = true;
70
+ // Use asapScheduler to emit the values array, so that all
71
+ // next values that are emitted at the same time are emitted together.
72
+ // This makes tests (using expectObservable) easier to write.
73
+ scheduledWork = asapScheduler.schedule(() => {
74
+ if (!subscriber.closed) {
75
+ subscriber.next(values.slice());
76
+ scheduled = false;
77
+ if (activeObservables === 0) {
78
+ subscriber.complete();
79
+ }
80
+ }
81
+ });
90
82
  }
91
- // When everything is done, clean up the values array
92
- return () => {
93
- values.length = 0;
94
- };
95
- });
96
- }
97
- }
98
- }export{combineLatestOrDefault};
83
+ },
84
+ error: error => subscriber.error(error),
85
+ complete: () => {
86
+ activeObservables--;
87
+ if (activeObservables === 0 && !scheduled) {
88
+ subscriber.complete();
89
+ }
90
+ }
91
+ }));
92
+ }
93
+ // When everything is done, clean up the values array
94
+ return () => {
95
+ values.length = 0;
96
+ };
97
+ });
98
+ }
99
+ }
100
+ }export{combineLatestOrDefault};//# sourceMappingURL=combineLatestOrDefault.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combineLatestOrDefault.js","sources":["../../../src/utils/rxjs/combineLatestOrDefault.ts"],"sourcesContent":[null],"names":[],"mappings":"wDAEA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACa,SAAA,sBAAsB,CAAI,WAAiC,EAAE,YAAgB,EAAA;AACzF,EAAA,QAAA,WAAmB,CAAA,MAAO;SACjB,CAAA;;AAED;QACJ,OAAC,EAAA,CAAA,EAAA,CAAA;;;AAGG,MAAA;;QAEJ,OAAO,GAAG,CAAA,GAAA,WAAA,CAAA;AACN;;;mBAGkE,UAAA,CAAA,UAAA,IAAA;;;;AAK9D,UAAA,MAAA,qBAA4C,KAAA,SAAA,GAAA,WAAA,CAAA,GAAA,CAAA,MAAA,YAAA,CAAA,GAAA,EAAA;;uBAEe,GAAA,KAAA;AAC3D,UAAA,IAAA,aAAqB;;AAGrB;AACI,UAAA,IAAA,iBAAO,GAAS,WAAE,CAAA,MAAA;AACtB;oBAEqF,CAAA,GAAA,CAAA,MAAA;kBACL,CAAA,MAAA,GAAA,CAAA;AAChF,WAAA,CAAA;AACI;AAEQ;AACI,UAAA,KAAA,IAAA,KAAA,GAAA,CAAA,EAAA,KAAO,GAAA,WAAc,CAAC,MAAA,EAAA,KAAA,EAAA,EAAA;AACtB,YAAA,UAAA,CAAA,GAAA,CAAA,IAAA,CAAI,WAAiB,CAAA,KAAA,CAAA,CAAA,CAAA,SAAS,CAAA;;gCAE1B,KAA+B;qCAClB,KAAA,CAAA,EAAA;;;+BAGhB,EAAA,WAAA,EAAA;mCAAU;iCACE,CAAA,MAAA,CAAA,OAAO,CAAC;qCACyC,EAAA;kCACY;;AAEtE;AACI;+CACc,CAAA,QAAM,CAAA,MAAO;0CACd,EAAA;AACT,sBAAA,UAAA,CAAA,IAAA,CAAA,MAAI,CAAiB,KAAA,EAAA,CAAA;;2CAEpB,KAAA,CAAA,EAAA;2CACJ,EAAA;AACL;;;;;AAKJ,cAAA,KAAA,EAAA,KAAA,IAAA,UAAA,CAAA,MAAmB,KAAC,CAAA;AACpB,cAAA,QAAA,EAAA,MAAA;iCACc,EAAA;qCACb,KAAA,CAAA,IAAA,CAAA,SAAA,EAAA;4BACJ,CAAA,QAAA,EAAA;AACJ;;;AAKT;AACI;AACJ,UAAA,OAAC,MAAC;AACN,YAAA,MAAG,CAAA,MAAA,GAAA,CAAA;WACN;SACJ,CAAA;AACL;;"}
package/lib/utils/util.js CHANGED
@@ -4,44 +4,43 @@ import {flatten,compact}from'lodash-es';/**
4
4
  * @param f
5
5
  */
6
6
  function tryCatchPromise(f) {
7
- try {
8
- return Promise.resolve(f());
9
- }
10
- catch (err) {
11
- return Promise.reject(err);
12
- }
7
+ try {
8
+ return Promise.resolve(f());
9
+ } catch (err) {
10
+ return Promise.reject(err);
11
+ }
13
12
  }
14
13
  /**
15
14
  * Reports whether value is a Promise.
16
15
  */
17
16
  function isPromise(value) {
18
- return typeof value.then === 'function';
17
+ return typeof value.then === 'function';
19
18
  }
20
19
  /**
21
20
  * Reports whether value is a {@link cdeops.Subscribable}.
22
21
  */
23
22
  function isSubscribable(value) {
24
- return typeof value.subscribe === 'function';
23
+ return typeof value.subscribe === 'function';
25
24
  }
26
25
  /** Flattens and compacts the argument. If it is null or if the result is empty, it returns null. */
27
26
  function flattenAndCompact(value) {
28
- if (value === null) {
29
- return null;
30
- }
31
- const merged = flatten(compact(value));
32
- return merged.length === 0 ? null : merged;
27
+ if (value === null) {
28
+ return null;
29
+ }
30
+ const merged = flatten(compact(value));
31
+ return merged.length === 0 ? null : merged;
33
32
  }
34
33
  /** generate unique id for contributions */
35
34
  function generateContributionId() {
36
- // always start with a letter (for DOM friendlyness)
37
- let idStr = String.fromCharCode(Math.floor((Math.random() * 25) + 65));
38
- do {
39
- // between numbers and characters (48 is 0 and 90 is Z (42-48 = 90)
40
- const asciCode = Math.floor((Math.random() * 42) + 48);
41
- if (asciCode < 58 || asciCode > 64) {
42
- // exclude all chars between : (58) and @ (64)
43
- idStr += String.fromCharCode(asciCode);
44
- }
45
- } while (idStr.length < 32);
46
- return (idStr);
47
- }export{flattenAndCompact,generateContributionId,isPromise,isSubscribable,tryCatchPromise};
35
+ // always start with a letter (for DOM friendlyness)
36
+ let idStr = String.fromCharCode(Math.floor(Math.random() * 25 + 65));
37
+ do {
38
+ // between numbers and characters (48 is 0 and 90 is Z (42-48 = 90)
39
+ const asciCode = Math.floor(Math.random() * 42 + 48);
40
+ if (asciCode < 58 || asciCode > 64) {
41
+ // exclude all chars between : (58) and @ (64)
42
+ idStr += String.fromCharCode(asciCode);
43
+ }
44
+ } while (idStr.length < 32);
45
+ return idStr;
46
+ }export{flattenAndCompact,generateContributionId,isPromise,isSubscribable,tryCatchPromise};//# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sources":["../../src/utils/util.ts"],"sourcesContent":[null],"names":[],"mappings":"wCAEA;;;;AAIG;AACG,SAAU,eAAe,CAAI,CAAuB,EAAA;AACtD,EAAA,IAAA;AACI,IAAA,OAAA,eAAe,CAAA,CAAA,EAAO,CAAC;IAC3B,OAAC,GAAA,EAAA;IAAC,OAAO,OAAM,CAAA,MAAA,CAAA,GAAA,CAAA;AACX;;AAER;AAGA;;AAEG,SAAA,SAAA,CAAA,KAAA,EAAA;AACH,EAAM,OAAA,OAAU,KAAS,CAAA,IAAC,KAAU,UAAA;AAChC;AACJ;AAEA;;AAEG,SAAA,cAAA,CAAA,KAAA,EAAA;AACH,EAAM,OAAA,OAAU,KAAc,CAAA,SAAC,KAAU,UAAA;AACrC;AACJ;AAGoG,SAAA,iBAAA,CAAA,KAAA,EAAA;AACpG,EAAM,IAAA,KAAA,KAAU,IAAiB,EAAA;AAC7B,IAAA,OAAS,IAAA;AACL;QACH,MAAA,GAAA,OAAA,CAAA,OAAA,CAAA,KAAA,CAAA,CAAA;SACK,MAAA,CAAM,MAAU,KAAC,QAAQ,GAAA,MAAQ;AACvC;AACJ;AAE2C,SAAA,sBAAA,GAAA;AAC3C;MACwD,KAAA,GAAA,MAAA,CAAA,YAAA,CAAA,IAAA,CAAA,KAAA,CAAA,IAAA,CAAA,MAAA,EAAA,GAAA,EAAA,GAAA,EAAA,CAAA,CAAA;KAChD;AACJ;UACuE,QAAA,GAAA,IAAA,CAAA,KAAA,CAAA,IAAA,CAAA,MAAA,EAAA,GAAA,EAAA,GAAA,EAAA,CAAA;AACnE,IAAA,IAAA,iBAAiB,QAAK,GAAM,EAAC,EAAA;;eAEqB,MAAA,CAAA,YAAA,CAAA,QAAA,CAAA;AAC9C;WACH,KAAA,CAAA,MAAA,GAAA,EAAA;AACL,EAAA,YAAc;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminide-stack/extension-api",
3
- "version": "11.0.1-alpha.0",
3
+ "version": "11.0.1-alpha.11",
4
4
  "description": "Workbench core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -21,11 +21,11 @@
21
21
  "watch": "npm run build:lib:watch"
22
22
  },
23
23
  "dependencies": {
24
- "@adminide-stack/core": "11.0.1-alpha.0",
24
+ "@adminide-stack/core": "11.0.1-alpha.11",
25
25
  "@workbench-stack/core": "3.9.7",
26
26
  "abort-controller": "^3.0.0",
27
- "cdeops": "11.0.1-alpha.0",
28
- "common": "11.0.1-alpha.0",
27
+ "cdeops": "11.0.1-alpha.11",
28
+ "common": "11.0.1-alpha.11",
29
29
  "minimatch": "^10.0.0",
30
30
  "queueing-subject": "0.3.4",
31
31
  "utility-types": "^3.10.0",
@@ -44,5 +44,5 @@
44
44
  "typescript": {
45
45
  "definition": "lib/index.d.ts"
46
46
  },
47
- "gitHead": "1039a63d71a083eff0fd649eccac68051b3b4503"
47
+ "gitHead": "f1338ddea501ce4896df1501cfca3fdcd3aacad4"
48
48
  }