@cratis/arc.react 18.5.0 → 18.6.0

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 (137) hide show
  1. package/commands/for_CommandScopeImplementation/FakeCommand.ts +25 -26
  2. package/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.ts +2 -2
  3. package/dist/cjs/commands/for_CommandScopeImplementation/FakeCommand.d.ts +23 -0
  4. package/dist/cjs/commands/for_CommandScopeImplementation/FakeCommand.d.ts.map +1 -0
  5. package/dist/cjs/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts +2 -0
  6. package/dist/cjs/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts.map +1 -0
  7. package/dist/cjs/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts +2 -0
  8. package/dist/cjs/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts.map +1 -0
  9. package/dist/cjs/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts +2 -0
  10. package/dist/cjs/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts.map +1 -0
  11. package/dist/cjs/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts +2 -0
  12. package/dist/cjs/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts.map +1 -0
  13. package/dist/cjs/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts +2 -0
  14. package/dist/cjs/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts.map +1 -0
  15. package/dist/cjs/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts +2 -0
  16. package/dist/cjs/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts.map +1 -0
  17. package/dist/cjs/commands/for_useCommand/FakeCommand.d.ts +17 -0
  18. package/dist/cjs/commands/for_useCommand/FakeCommand.d.ts.map +1 -0
  19. package/dist/cjs/commands/for_useCommand/when_creating_instance.d.ts +2 -0
  20. package/dist/cjs/commands/for_useCommand/when_creating_instance.d.ts.map +1 -0
  21. package/dist/cjs/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts +2 -0
  22. package/dist/cjs/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts.map +1 -0
  23. package/dist/cjs/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts +2 -0
  24. package/dist/cjs/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
  25. package/dist/cjs/identity/for_IdentityProvider/when_refreshing_identity.d.ts +2 -0
  26. package/dist/cjs/identity/for_IdentityProvider/when_refreshing_identity.d.ts.map +1 -0
  27. package/dist/cjs/queries/for_useObservableQuery/FakeObservableQuery.d.ts +19 -0
  28. package/dist/cjs/queries/for_useObservableQuery/FakeObservableQuery.d.ts.map +1 -0
  29. package/dist/cjs/queries/for_useObservableQuery/when_creating_instance.d.ts +2 -0
  30. package/dist/cjs/queries/for_useObservableQuery/when_creating_instance.d.ts.map +1 -0
  31. package/dist/cjs/queries/for_useQuery/FakeQuery.d.ts +14 -0
  32. package/dist/cjs/queries/for_useQuery/FakeQuery.d.ts.map +1 -0
  33. package/dist/cjs/queries/for_useQuery/when_creating_instance.d.ts +2 -0
  34. package/dist/cjs/queries/for_useQuery/when_creating_instance.d.ts.map +1 -0
  35. package/dist/cjs/queries/for_useQuery/when_creating_instance_with_sorting.d.ts +2 -0
  36. package/dist/cjs/queries/for_useQuery/when_creating_instance_with_sorting.d.ts.map +1 -0
  37. package/dist/cjs/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts +2 -0
  38. package/dist/cjs/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
  39. package/dist/cjs/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts +2 -0
  40. package/dist/cjs/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts.map +1 -0
  41. package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.d.ts +23 -0
  42. package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.d.ts.map +1 -0
  43. package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.js +49 -0
  44. package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.js.map +1 -0
  45. package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts +2 -0
  46. package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts.map +1 -0
  47. package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.js +17 -0
  48. package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.js.map +1 -0
  49. package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts +2 -0
  50. package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts.map +1 -0
  51. package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.js +13 -0
  52. package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.js.map +1 -0
  53. package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts +2 -0
  54. package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts.map +1 -0
  55. package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.js +13 -0
  56. package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.js.map +1 -0
  57. package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts +2 -0
  58. package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts.map +1 -0
  59. package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.js +18 -0
  60. package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.js.map +1 -0
  61. package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts +2 -0
  62. package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts.map +1 -0
  63. package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.js +17 -0
  64. package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.js.map +1 -0
  65. package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts +2 -0
  66. package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts.map +1 -0
  67. package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.js +6 -0
  68. package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.js.map +1 -0
  69. package/dist/esm/commands/for_useCommand/FakeCommand.d.ts +17 -0
  70. package/dist/esm/commands/for_useCommand/FakeCommand.d.ts.map +1 -0
  71. package/dist/esm/commands/for_useCommand/FakeCommand.js +18 -0
  72. package/dist/esm/commands/for_useCommand/FakeCommand.js.map +1 -0
  73. package/dist/esm/commands/for_useCommand/when_creating_instance.d.ts +2 -0
  74. package/dist/esm/commands/for_useCommand/when_creating_instance.d.ts.map +1 -0
  75. package/dist/esm/commands/for_useCommand/when_creating_instance.js +28 -0
  76. package/dist/esm/commands/for_useCommand/when_creating_instance.js.map +1 -0
  77. package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts +2 -0
  78. package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts.map +1 -0
  79. package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.js +24 -0
  80. package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.js.map +1 -0
  81. package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts +2 -0
  82. package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
  83. package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.js +24 -0
  84. package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.js.map +1 -0
  85. package/dist/esm/for_Bindings/given/bindings_context.d.ts +4 -0
  86. package/dist/esm/for_Bindings/given/bindings_context.d.ts.map +1 -0
  87. package/dist/esm/for_Bindings/given/bindings_context.js +5 -0
  88. package/dist/esm/for_Bindings/given/bindings_context.js.map +1 -0
  89. package/dist/esm/for_Bindings/when_initializing_bindings.d.ts +2 -0
  90. package/dist/esm/for_Bindings/when_initializing_bindings.d.ts.map +1 -0
  91. package/dist/esm/for_Bindings/when_initializing_bindings.js +24 -0
  92. package/dist/esm/for_Bindings/when_initializing_bindings.js.map +1 -0
  93. package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.d.ts +2 -0
  94. package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.d.ts.map +1 -0
  95. package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.js +24 -0
  96. package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.js.map +1 -0
  97. package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.d.ts +2 -0
  98. package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.d.ts.map +1 -0
  99. package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.js +47 -0
  100. package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.js.map +1 -0
  101. package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.d.ts +19 -0
  102. package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.d.ts.map +1 -0
  103. package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.js +25 -0
  104. package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.js.map +1 -0
  105. package/dist/esm/queries/for_useObservableQuery/when_creating_instance.d.ts +2 -0
  106. package/dist/esm/queries/for_useObservableQuery/when_creating_instance.d.ts.map +1 -0
  107. package/dist/esm/queries/for_useObservableQuery/when_creating_instance.js +66 -0
  108. package/dist/esm/queries/for_useObservableQuery/when_creating_instance.js.map +1 -0
  109. package/dist/esm/queries/for_useQuery/FakeQuery.d.ts +14 -0
  110. package/dist/esm/queries/for_useQuery/FakeQuery.d.ts.map +1 -0
  111. package/dist/esm/queries/for_useQuery/FakeQuery.js +13 -0
  112. package/dist/esm/queries/for_useQuery/FakeQuery.js.map +1 -0
  113. package/dist/esm/queries/for_useQuery/when_creating_instance.d.ts +2 -0
  114. package/dist/esm/queries/for_useQuery/when_creating_instance.d.ts.map +1 -0
  115. package/dist/esm/queries/for_useQuery/when_creating_instance.js +48 -0
  116. package/dist/esm/queries/for_useQuery/when_creating_instance.js.map +1 -0
  117. package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.d.ts +2 -0
  118. package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.d.ts.map +1 -0
  119. package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.js +40 -0
  120. package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.js.map +1 -0
  121. package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts +2 -0
  122. package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
  123. package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.js +44 -0
  124. package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.js.map +1 -0
  125. package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts +2 -0
  126. package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts.map +1 -0
  127. package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.js +51 -0
  128. package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.js.map +1 -0
  129. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  130. package/global.d.ts +11 -0
  131. package/identity/for_IdentityProvider/when_refreshing_identity.ts +4 -3
  132. package/package.json +2 -2
  133. package/queries/for_useObservableQuery/when_creating_instance.ts +2 -2
  134. package/queries/for_useQuery/when_creating_instance.ts +6 -2
  135. package/queries/for_useQuery/when_creating_instance_with_sorting.ts +6 -4
  136. package/queries/for_useQuery/when_creating_instance_without_optional_context_values.ts +6 -2
  137. package/queries/for_useQueryWithPaging/when_creating_instance_with_paging.ts +6 -2
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
4
  import sinon from 'sinon';
5
- import { CommandResult, ICommand, PropertyChanged } from '@cratis/arc/commands';
5
+ import { CommandResult, ICommand } from '@cratis/arc/commands';
6
6
  import { PropertyDescriptor } from '@cratis/arc/reflection';
7
7
 
8
8
  /* eslint-disable */
@@ -12,6 +12,19 @@ export class FakeCommand implements ICommand {
12
12
  propertyDescriptors: PropertyDescriptor[] = [];
13
13
  private _hasChanges: boolean;
14
14
 
15
+ execute: sinon.SinonSpy;
16
+ validate: sinon.SinonSpy;
17
+ clear: sinon.SinonStub;
18
+ setApiBasePath: sinon.SinonStub;
19
+ setOrigin: sinon.SinonStub;
20
+ setHttpHeadersCallback: sinon.SinonStub;
21
+ setMicroservice: sinon.SinonStub;
22
+ setInitialValues: sinon.SinonStub;
23
+ propertyChanged: sinon.SinonStub;
24
+ onPropertyChanged: sinon.SinonStub;
25
+ revertChanges: sinon.SinonSpy;
26
+ setInitialValuesFromCurrentValues: sinon.SinonStub;
27
+
15
28
  constructor(hasChanges: boolean) {
16
29
  this._hasChanges = hasChanges;
17
30
  this.execute = sinon.fake(() => {
@@ -20,10 +33,20 @@ export class FakeCommand implements ICommand {
20
33
  resolve(CommandResult.empty);
21
34
  });
22
35
  });
23
- this.setInitialValues = sinon.stub();
36
+ this.validate = sinon.fake(() => {
37
+ return new Promise<CommandResult>(resolve => {
38
+ resolve(CommandResult.empty);
39
+ });
40
+ });
41
+ this.clear = sinon.stub();
42
+ this.setApiBasePath = sinon.stub();
43
+ this.setOrigin = sinon.stub();
44
+ this.setHttpHeadersCallback = sinon.stub();
45
+ this.setMicroservice = sinon.stub();
24
46
  this.setInitialValues = sinon.stub();
25
47
  this.propertyChanged = sinon.stub();
26
48
  this.onPropertyChanged = sinon.stub();
49
+ this.setInitialValuesFromCurrentValues = sinon.stub();
27
50
  this.revertChanges = sinon.fake(() => {
28
51
  this._hasChanges = false;
29
52
  });
@@ -32,28 +55,4 @@ export class FakeCommand implements ICommand {
32
55
  get hasChanges() {
33
56
  return this._hasChanges;
34
57
  }
35
-
36
- revertChanges(): void {
37
- throw new Error('Method not implemented.');
38
- }
39
-
40
- execute(): Promise<CommandResult> {
41
- throw new Error('Method not implemented.');
42
- }
43
- setInitialValues(values: {}): void {
44
- throw new Error('Method not implemented.');
45
- }
46
- setInitialValuesFromCurrentValues(): void {
47
- throw new Error('Method not implemented.');
48
- }
49
- propertyChanged(property: string): void {
50
- throw new Error('Method not implemented.');
51
- }
52
- onPropertyChanged(callback: PropertyChanged, thisArg: any): void {
53
- throw new Error('Method not implemented.');
54
- }
55
-
56
- setMicroservice(microservice: string) {
57
- throw new Error('Method not implemented.');
58
- }
59
58
  }
@@ -13,10 +13,10 @@ describe('when property changes on added command', () => {
13
13
  let thisArgForCallback: object = {};
14
14
 
15
15
  const command = new FakeCommand(true);
16
- command.onPropertyChanged = (callback: PropertyChanged, thisArg: object): void => {
16
+ command.onPropertyChanged.callsFake((callback: PropertyChanged, thisArg: object): void => {
17
17
  callbackToCall = callback;
18
18
  thisArgForCallback = thisArg;
19
- };
19
+ });
20
20
 
21
21
  scope.addCommand(command);
22
22
 
@@ -0,0 +1,23 @@
1
+ import sinon from 'sinon';
2
+ import { ICommand } from '@cratis/arc/commands';
3
+ import { PropertyDescriptor } from '@cratis/arc/reflection';
4
+ export declare class FakeCommand implements ICommand {
5
+ route: string;
6
+ propertyDescriptors: PropertyDescriptor[];
7
+ private _hasChanges;
8
+ execute: sinon.SinonSpy;
9
+ validate: sinon.SinonSpy;
10
+ clear: sinon.SinonStub;
11
+ setApiBasePath: sinon.SinonStub;
12
+ setOrigin: sinon.SinonStub;
13
+ setHttpHeadersCallback: sinon.SinonStub;
14
+ setMicroservice: sinon.SinonStub;
15
+ setInitialValues: sinon.SinonStub;
16
+ propertyChanged: sinon.SinonStub;
17
+ onPropertyChanged: sinon.SinonStub;
18
+ revertChanges: sinon.SinonSpy;
19
+ setInitialValuesFromCurrentValues: sinon.SinonStub;
20
+ constructor(hasChanges: boolean);
21
+ get hasChanges(): boolean;
22
+ }
23
+ //# sourceMappingURL=FakeCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FakeCommand.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/FakeCommand.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAI5D,qBAAa,WAAY,YAAW,QAAQ;IACxC,KAAK,SAAM;IACX,mBAAmB,EAAE,kBAAkB,EAAE,CAAM;IAC/C,OAAO,CAAC,WAAW,CAAU;IAE7B,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC;IACxC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC9B,iCAAiC,EAAE,KAAK,CAAC,SAAS,CAAC;gBAEvC,UAAU,EAAE,OAAO;IA2B/B,IAAI,UAAU,YAEb;CACJ"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_executing_with_three_commands_were_two_having_changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_executing_with_three_commands_were_two_having_changes.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_none_of_the_added_commands_has_changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_none_of_the_added_commands_has_changes.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_one_of_the_added_commands_has_changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_one_of_the_added_commands_has_changes.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_property_changes_on_added_command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_property_changes_on_added_command.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_property_changes_on_added_command.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_reverting_with_three_commands_were_two_having_changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_reverting_with_three_commands_were_two_having_changes.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_there_are_no_commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_there_are_no_commands.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_there_are_no_commands.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { Command, CommandValidator } from '@cratis/arc/commands';
2
+ import { PropertyDescriptor } from '@cratis/arc/reflection';
3
+ export interface FakeCommandContent {
4
+ someProperty?: string;
5
+ anotherProperty?: number;
6
+ }
7
+ export declare class FakeCommand extends Command<FakeCommandContent> {
8
+ readonly route = "/api/fake-command";
9
+ readonly validation: CommandValidator;
10
+ readonly propertyDescriptors: PropertyDescriptor[];
11
+ someProperty?: string;
12
+ anotherProperty?: number;
13
+ get requestParameters(): string[];
14
+ get properties(): string[];
15
+ constructor();
16
+ }
17
+ //# sourceMappingURL=FakeCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FakeCommand.d.ts","sourceRoot":"","sources":["../../../../commands/for_useCommand/FakeCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,qBAAa,WAAY,SAAQ,OAAO,CAAC,kBAAkB,CAAC;IACxD,QAAQ,CAAC,KAAK,uBAAuB;IACrC,QAAQ,CAAC,UAAU,EAAS,gBAAgB,CAAC;IAC7C,QAAQ,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,CAAM;IAExD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,IAAI,iBAAiB,IAAI,MAAM,EAAE,CAEhC;IAED,IAAI,UAAU,IAAI,MAAM,EAAE,CAEzB;;CAKJ"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_creating_instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_creating_instance.d.ts","sourceRoot":"","sources":["../../../../commands/for_useCommand/when_creating_instance.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_creating_instance_with_initial_values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_creating_instance_with_initial_values.d.ts","sourceRoot":"","sources":["../../../../commands/for_useCommand/when_creating_instance_with_initial_values.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_creating_instance_without_optional_context_values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_creating_instance_without_optional_context_values.d.ts","sourceRoot":"","sources":["../../../../commands/for_useCommand/when_creating_instance_without_optional_context_values.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_refreshing_identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_refreshing_identity.d.ts","sourceRoot":"","sources":["../../../../identity/for_IdentityProvider/when_refreshing_identity.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { ObservableQueryFor, QueryResult, ObservableQuerySubscription, OnNextResult } from '@cratis/arc/queries';
2
+ import { ParameterDescriptor } from '@cratis/arc/reflection';
3
+ export interface FakeObservableQueryResult {
4
+ id: string;
5
+ name: string;
6
+ }
7
+ export type SubscribeCallback = OnNextResult<QueryResult<FakeObservableQueryResult[]>>;
8
+ export declare class FakeObservableQuery extends ObservableQueryFor<FakeObservableQueryResult[]> {
9
+ readonly route = "/api/fake-observable-query";
10
+ readonly parameterDescriptors: ParameterDescriptor[];
11
+ get requiredRequestParameters(): string[];
12
+ defaultValue: FakeObservableQueryResult[];
13
+ constructor();
14
+ static subscribeCallbacks: SubscribeCallback[];
15
+ static subscriptionReturned: ObservableQuerySubscription<FakeObservableQueryResult[]>;
16
+ subscribe(callback: SubscribeCallback, args?: object): ObservableQuerySubscription<FakeObservableQueryResult[]>;
17
+ static reset(): void;
18
+ }
19
+ //# sourceMappingURL=FakeObservableQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FakeObservableQuery.d.ts","sourceRoot":"","sources":["../../../../queries/for_useObservableQuery/FakeObservableQuery.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,WAAW,yBAAyB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,WAAW,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC;AAEvF,qBAAa,mBAAoB,SAAQ,kBAAkB,CAAC,yBAAyB,EAAE,CAAC;IACpF,QAAQ,CAAC,KAAK,gCAAgC;IAC9C,QAAQ,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,CAAM;IAE1D,IAAI,yBAAyB,IAAI,MAAM,EAAE,CAExC;IAED,YAAY,EAAE,yBAAyB,EAAE,CAAM;;IAM/C,MAAM,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,CAAM;IACpD,MAAM,CAAC,oBAAoB,EAAE,2BAA2B,CAAC,yBAAyB,EAAE,CAAC,CAAC;IAGtF,SAAS,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,2BAA2B,CAAC,yBAAyB,EAAE,CAAC;IAQ/G,MAAM,CAAC,KAAK;CAGf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_creating_instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_creating_instance.d.ts","sourceRoot":"","sources":["../../../../queries/for_useObservableQuery/when_creating_instance.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import { QueryFor } from '@cratis/arc/queries';
2
+ import { ParameterDescriptor } from '@cratis/arc/reflection';
3
+ export interface FakeQueryResult {
4
+ id: string;
5
+ name: string;
6
+ }
7
+ export declare class FakeQuery extends QueryFor<FakeQueryResult[]> {
8
+ readonly route = "/api/fake-query";
9
+ readonly parameterDescriptors: ParameterDescriptor[];
10
+ get requiredRequestParameters(): string[];
11
+ defaultValue: FakeQueryResult[];
12
+ constructor();
13
+ }
14
+ //# sourceMappingURL=FakeQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FakeQuery.d.ts","sourceRoot":"","sources":["../../../../queries/for_useQuery/FakeQuery.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,SAAU,SAAQ,QAAQ,CAAC,eAAe,EAAE,CAAC;IACtD,QAAQ,CAAC,KAAK,qBAAqB;IACnC,QAAQ,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,CAAM;IAE1D,IAAI,yBAAyB,IAAI,MAAM,EAAE,CAExC;IAED,YAAY,EAAE,eAAe,EAAE,CAAM;;CAKxC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_creating_instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_creating_instance.d.ts","sourceRoot":"","sources":["../../../../queries/for_useQuery/when_creating_instance.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_creating_instance_with_sorting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_creating_instance_with_sorting.d.ts","sourceRoot":"","sources":["../../../../queries/for_useQuery/when_creating_instance_with_sorting.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_creating_instance_without_optional_context_values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_creating_instance_without_optional_context_values.d.ts","sourceRoot":"","sources":["../../../../queries/for_useQuery/when_creating_instance_without_optional_context_values.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_creating_instance_with_paging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_creating_instance_with_paging.d.ts","sourceRoot":"","sources":["../../../../queries/for_useQueryWithPaging/when_creating_instance_with_paging.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import sinon from 'sinon';
2
+ import { ICommand } from '@cratis/arc/commands';
3
+ import { PropertyDescriptor } from '@cratis/arc/reflection';
4
+ export declare class FakeCommand implements ICommand {
5
+ route: string;
6
+ propertyDescriptors: PropertyDescriptor[];
7
+ private _hasChanges;
8
+ execute: sinon.SinonSpy;
9
+ validate: sinon.SinonSpy;
10
+ clear: sinon.SinonStub;
11
+ setApiBasePath: sinon.SinonStub;
12
+ setOrigin: sinon.SinonStub;
13
+ setHttpHeadersCallback: sinon.SinonStub;
14
+ setMicroservice: sinon.SinonStub;
15
+ setInitialValues: sinon.SinonStub;
16
+ propertyChanged: sinon.SinonStub;
17
+ onPropertyChanged: sinon.SinonStub;
18
+ revertChanges: sinon.SinonSpy;
19
+ setInitialValuesFromCurrentValues: sinon.SinonStub;
20
+ constructor(hasChanges: boolean);
21
+ get hasChanges(): boolean;
22
+ }
23
+ //# sourceMappingURL=FakeCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FakeCommand.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/FakeCommand.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAI5D,qBAAa,WAAY,YAAW,QAAQ;IACxC,KAAK,SAAM;IACX,mBAAmB,EAAE,kBAAkB,EAAE,CAAM;IAC/C,OAAO,CAAC,WAAW,CAAU;IAE7B,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC;IACxC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC9B,iCAAiC,EAAE,KAAK,CAAC,SAAS,CAAC;gBAEvC,UAAU,EAAE,OAAO;IA2B/B,IAAI,UAAU,YAEb;CACJ"}
@@ -0,0 +1,49 @@
1
+ import sinon from 'sinon';
2
+ import { CommandResult } from '@cratis/arc/commands';
3
+ export class FakeCommand {
4
+ route = '';
5
+ propertyDescriptors = [];
6
+ _hasChanges;
7
+ execute;
8
+ validate;
9
+ clear;
10
+ setApiBasePath;
11
+ setOrigin;
12
+ setHttpHeadersCallback;
13
+ setMicroservice;
14
+ setInitialValues;
15
+ propertyChanged;
16
+ onPropertyChanged;
17
+ revertChanges;
18
+ setInitialValuesFromCurrentValues;
19
+ constructor(hasChanges) {
20
+ this._hasChanges = hasChanges;
21
+ this.execute = sinon.fake(() => {
22
+ this._hasChanges = false;
23
+ return new Promise(resolve => {
24
+ resolve(CommandResult.empty);
25
+ });
26
+ });
27
+ this.validate = sinon.fake(() => {
28
+ return new Promise(resolve => {
29
+ resolve(CommandResult.empty);
30
+ });
31
+ });
32
+ this.clear = sinon.stub();
33
+ this.setApiBasePath = sinon.stub();
34
+ this.setOrigin = sinon.stub();
35
+ this.setHttpHeadersCallback = sinon.stub();
36
+ this.setMicroservice = sinon.stub();
37
+ this.setInitialValues = sinon.stub();
38
+ this.propertyChanged = sinon.stub();
39
+ this.onPropertyChanged = sinon.stub();
40
+ this.setInitialValuesFromCurrentValues = sinon.stub();
41
+ this.revertChanges = sinon.fake(() => {
42
+ this._hasChanges = false;
43
+ });
44
+ }
45
+ get hasChanges() {
46
+ return this._hasChanges;
47
+ }
48
+ }
49
+ //# sourceMappingURL=FakeCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FakeCommand.js","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/FakeCommand.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAY,MAAM,sBAAsB,CAAC;AAK/D,MAAM,OAAO,WAAW;IACpB,KAAK,GAAG,EAAE,CAAC;IACX,mBAAmB,GAAyB,EAAE,CAAC;IACvC,WAAW,CAAU;IAE7B,OAAO,CAAiB;IACxB,QAAQ,CAAiB;IACzB,KAAK,CAAkB;IACvB,cAAc,CAAkB;IAChC,SAAS,CAAkB;IAC3B,sBAAsB,CAAkB;IACxC,eAAe,CAAkB;IACjC,gBAAgB,CAAkB;IAClC,eAAe,CAAkB;IACjC,iBAAiB,CAAkB;IACnC,aAAa,CAAiB;IAC9B,iCAAiC,CAAkB;IAEnD,YAAY,UAAmB;QAC3B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YAC3B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;YACzB,OAAO,IAAI,OAAO,CAAgB,OAAO,CAAC,EAAE;gBACxC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YAC5B,OAAO,IAAI,OAAO,CAAgB,OAAO,CAAC,EAAE;gBACxC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,sBAAsB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACrC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACtC,IAAI,CAAC,iCAAiC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACtD,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YACjC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAC7B,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CACJ"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_executing_with_three_commands_were_two_having_changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_executing_with_three_commands_were_two_having_changes.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { CommandScopeImplementation } from '../CommandScopeImplementation';
2
+ import { FakeCommand } from './FakeCommand';
3
+ describe('when executing with three commands were two having changes', async () => {
4
+ const scope = new CommandScopeImplementation(() => { });
5
+ const firstCommand = new FakeCommand(true);
6
+ const secondCommand = new FakeCommand(false);
7
+ const thirdCommand = new FakeCommand(true);
8
+ scope.addCommand(firstCommand);
9
+ scope.addCommand(secondCommand);
10
+ scope.addCommand(thirdCommand);
11
+ await scope.execute();
12
+ it('should call execute on first command', () => firstCommand.execute.called.should.be.true);
13
+ it('should not call execute on second command', () => secondCommand.execute.called.should.be.false);
14
+ it('should call execute on third command', () => thirdCommand.execute.called.should.be.true);
15
+ it('should not have any changes', () => scope.hasChanges.should.be.false);
16
+ });
17
+ //# sourceMappingURL=when_executing_with_three_commands_were_two_having_changes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_executing_with_three_commands_were_two_having_changes.js","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,QAAQ,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;IAC9E,MAAM,KAAK,GAAG,IAAI,0BAA0B,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAEvD,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,aAAa,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAE3C,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC/B,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAChC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAE/B,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;IAEtB,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE,CAAE,YAAY,CAAC,OAAqB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC5G,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE,CAAE,aAAa,CAAC,OAAqB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACnH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE,CAAE,YAAY,CAAC,OAAqB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC5G,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_none_of_the_added_commands_has_changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_none_of_the_added_commands_has_changes.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { CommandScopeImplementation } from '../CommandScopeImplementation';
2
+ import { FakeCommand } from './FakeCommand';
3
+ describe('when none of the added commands has changes', () => {
4
+ const scope = new CommandScopeImplementation(() => { });
5
+ const firstCommand = new FakeCommand(false);
6
+ const secondCommand = new FakeCommand(false);
7
+ const thirdCommand = new FakeCommand(false);
8
+ scope.addCommand(firstCommand);
9
+ scope.addCommand(secondCommand);
10
+ scope.addCommand(thirdCommand);
11
+ it('should not have changes', () => scope.hasChanges.should.be.false);
12
+ });
13
+ //# sourceMappingURL=when_none_of_the_added_commands_has_changes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_none_of_the_added_commands_has_changes.js","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,QAAQ,CAAC,6CAA6C,EAAE,GAAG,EAAE;IACzD,MAAM,KAAK,GAAG,IAAI,0BAA0B,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAEvD,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,aAAa,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;IAE5C,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC/B,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAChC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAE/B,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_one_of_the_added_commands_has_changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_one_of_the_added_commands_has_changes.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { CommandScopeImplementation } from '../CommandScopeImplementation';
2
+ import { FakeCommand } from './FakeCommand';
3
+ describe('when one of the added commands has changes', () => {
4
+ const scope = new CommandScopeImplementation(() => { });
5
+ const firstCommand = new FakeCommand(false);
6
+ const secondCommand = new FakeCommand(true);
7
+ const thirdCommand = new FakeCommand(false);
8
+ scope.addCommand(firstCommand);
9
+ scope.addCommand(secondCommand);
10
+ scope.addCommand(thirdCommand);
11
+ it('should have changes', () => scope.hasChanges.should.be.true);
12
+ });
13
+ //# sourceMappingURL=when_one_of_the_added_commands_has_changes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_one_of_the_added_commands_has_changes.js","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;IACxD,MAAM,KAAK,GAAG,IAAI,0BAA0B,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAEvD,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,aAAa,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;IAE5C,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC/B,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAChC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAE/B,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_property_changes_on_added_command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_property_changes_on_added_command.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_property_changes_on_added_command.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import sinon from 'sinon';
2
+ import { CommandScopeImplementation } from '../CommandScopeImplementation';
3
+ import { FakeCommand } from './FakeCommand';
4
+ describe('when property changes on added command', () => {
5
+ const setHasChanges = sinon.stub();
6
+ const scope = new CommandScopeImplementation(setHasChanges);
7
+ let callbackToCall;
8
+ let thisArgForCallback = {};
9
+ const command = new FakeCommand(true);
10
+ command.onPropertyChanged.callsFake((callback, thisArg) => {
11
+ callbackToCall = callback;
12
+ thisArgForCallback = thisArg;
13
+ });
14
+ scope.addCommand(command);
15
+ callbackToCall.call(thisArgForCallback, '');
16
+ it('should call set has changes', () => setHasChanges.called.should.be.true);
17
+ });
18
+ //# sourceMappingURL=when_property_changes_on_added_command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_property_changes_on_added_command.js","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_property_changes_on_added_command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,QAAQ,CAAC,wCAAwC,EAAE,GAAG,EAAE;IACpD,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,IAAI,0BAA0B,CAAC,aAAa,CAAC,CAAC;IAC5D,IAAI,cAA+B,CAAC;IACpC,IAAI,kBAAkB,GAAW,EAAE,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,QAAyB,EAAE,OAAe,EAAQ,EAAE;QACrF,cAAc,GAAG,QAAQ,CAAC;QAC1B,kBAAkB,GAAG,OAAO,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAE1B,cAAe,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAE7C,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACjF,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_reverting_with_three_commands_were_two_having_changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_reverting_with_three_commands_were_two_having_changes.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { CommandScopeImplementation } from '../CommandScopeImplementation';
2
+ import { FakeCommand } from './FakeCommand';
3
+ describe('when reverting with three commands were two having changes', () => {
4
+ const scope = new CommandScopeImplementation(() => { });
5
+ const firstCommand = new FakeCommand(true);
6
+ const secondCommand = new FakeCommand(false);
7
+ const thirdCommand = new FakeCommand(true);
8
+ scope.addCommand(firstCommand);
9
+ scope.addCommand(secondCommand);
10
+ scope.addCommand(thirdCommand);
11
+ scope.revertChanges();
12
+ it('should call revert on first command', () => firstCommand.revertChanges.called.should.be.true);
13
+ it('should call revert on second command', () => secondCommand.revertChanges.called.should.be.true);
14
+ it('should call revert on third command', () => thirdCommand.revertChanges.called.should.be.true);
15
+ it('should not have any changes', () => scope.hasChanges.should.be.false);
16
+ });
17
+ //# sourceMappingURL=when_reverting_with_three_commands_were_two_having_changes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_reverting_with_three_commands_were_two_having_changes.js","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,QAAQ,CAAC,4DAA4D,EAAE,GAAG,EAAE;IACxE,MAAM,KAAK,GAAG,IAAI,0BAA0B,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAEvD,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,aAAa,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAE3C,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC/B,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAChC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAE/B,KAAK,CAAC,aAAa,EAAE,CAAC;IAEtB,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE,CAAE,YAAY,CAAC,aAA2B,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACjH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE,CAAE,aAAa,CAAC,aAA2B,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACnH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE,CAAE,YAAY,CAAC,aAA2B,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACjH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_there_are_no_commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_there_are_no_commands.d.ts","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_there_are_no_commands.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { CommandScopeImplementation } from '../CommandScopeImplementation';
2
+ describe('when there are no commands', () => {
3
+ const scope = new CommandScopeImplementation(() => { });
4
+ it('should have no changes', () => scope.hasChanges.should.be.false);
5
+ });
6
+ //# sourceMappingURL=when_there_are_no_commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_there_are_no_commands.js","sourceRoot":"","sources":["../../../../commands/for_CommandScopeImplementation/when_there_are_no_commands.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,MAAM,KAAK,GAAG,IAAI,0BAA0B,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAEvD,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { Command, CommandValidator } from '@cratis/arc/commands';
2
+ import { PropertyDescriptor } from '@cratis/arc/reflection';
3
+ export interface FakeCommandContent {
4
+ someProperty?: string;
5
+ anotherProperty?: number;
6
+ }
7
+ export declare class FakeCommand extends Command<FakeCommandContent> {
8
+ readonly route = "/api/fake-command";
9
+ readonly validation: CommandValidator;
10
+ readonly propertyDescriptors: PropertyDescriptor[];
11
+ someProperty?: string;
12
+ anotherProperty?: number;
13
+ get requestParameters(): string[];
14
+ get properties(): string[];
15
+ constructor();
16
+ }
17
+ //# sourceMappingURL=FakeCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FakeCommand.d.ts","sourceRoot":"","sources":["../../../../commands/for_useCommand/FakeCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,qBAAa,WAAY,SAAQ,OAAO,CAAC,kBAAkB,CAAC;IACxD,QAAQ,CAAC,KAAK,uBAAuB;IACrC,QAAQ,CAAC,UAAU,EAAS,gBAAgB,CAAC;IAC7C,QAAQ,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,CAAM;IAExD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,IAAI,iBAAiB,IAAI,MAAM,EAAE,CAEhC;IAED,IAAI,UAAU,IAAI,MAAM,EAAE,CAEzB;;CAKJ"}