@cratis/arc.react 18.4.3 → 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.
- package/commands/for_CommandScopeImplementation/FakeCommand.ts +25 -26
- package/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.ts +2 -2
- package/dist/cjs/commands/for_CommandScopeImplementation/FakeCommand.d.ts +23 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/FakeCommand.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts.map +1 -0
- package/dist/cjs/commands/for_useCommand/FakeCommand.d.ts +17 -0
- package/dist/cjs/commands/for_useCommand/FakeCommand.d.ts.map +1 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance.d.ts +2 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance.d.ts.map +1 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts +2 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts.map +1 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts +2 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
- package/dist/cjs/identity/IdentityProvider.d.ts +8 -1
- package/dist/cjs/identity/IdentityProvider.d.ts.map +1 -1
- package/dist/cjs/identity/IdentityProvider.js +14 -5
- package/dist/cjs/identity/IdentityProvider.js.map +1 -1
- package/dist/cjs/identity/for_IdentityProvider/when_refreshing_identity.d.ts +2 -0
- package/dist/cjs/identity/for_IdentityProvider/when_refreshing_identity.d.ts.map +1 -0
- package/dist/cjs/identity/useIdentity.d.ts +2 -0
- package/dist/cjs/identity/useIdentity.d.ts.map +1 -1
- package/dist/cjs/identity/useIdentity.js +8 -5
- package/dist/cjs/identity/useIdentity.js.map +1 -1
- package/dist/cjs/queries/for_useObservableQuery/FakeObservableQuery.d.ts +19 -0
- package/dist/cjs/queries/for_useObservableQuery/FakeObservableQuery.d.ts.map +1 -0
- package/dist/cjs/queries/for_useObservableQuery/when_creating_instance.d.ts +2 -0
- package/dist/cjs/queries/for_useObservableQuery/when_creating_instance.d.ts.map +1 -0
- package/dist/cjs/queries/for_useQuery/FakeQuery.d.ts +14 -0
- package/dist/cjs/queries/for_useQuery/FakeQuery.d.ts.map +1 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance.d.ts +2 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance.d.ts.map +1 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance_with_sorting.d.ts +2 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance_with_sorting.d.ts.map +1 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts +2 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
- package/dist/cjs/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts +2 -0
- package/dist/cjs/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts.map +1 -0
- package/dist/cjs/queries/useObservableQuery.js +1 -1
- package/dist/cjs/queries/useObservableQuery.js.map +1 -1
- package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.d.ts +23 -0
- package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.js +49 -0
- package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.js +17 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.js +13 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.js +13 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.js +18 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.js +17 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.js +6 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.js.map +1 -0
- package/dist/esm/commands/for_useCommand/FakeCommand.d.ts +17 -0
- package/dist/esm/commands/for_useCommand/FakeCommand.d.ts.map +1 -0
- package/dist/esm/commands/for_useCommand/FakeCommand.js +18 -0
- package/dist/esm/commands/for_useCommand/FakeCommand.js.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance.d.ts +2 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance.d.ts.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance.js +28 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance.js.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts +2 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.js +24 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.js.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts +2 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.js +24 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.js.map +1 -0
- package/dist/esm/for_Bindings/given/bindings_context.d.ts +4 -0
- package/dist/esm/for_Bindings/given/bindings_context.d.ts.map +1 -0
- package/dist/esm/for_Bindings/given/bindings_context.js +5 -0
- package/dist/esm/for_Bindings/given/bindings_context.js.map +1 -0
- package/dist/esm/for_Bindings/when_initializing_bindings.d.ts +2 -0
- package/dist/esm/for_Bindings/when_initializing_bindings.d.ts.map +1 -0
- package/dist/esm/for_Bindings/when_initializing_bindings.js +24 -0
- package/dist/esm/for_Bindings/when_initializing_bindings.js.map +1 -0
- package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.d.ts +2 -0
- package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.d.ts.map +1 -0
- package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.js +24 -0
- package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.js.map +1 -0
- package/dist/esm/identity/IdentityProvider.d.ts +8 -1
- package/dist/esm/identity/IdentityProvider.d.ts.map +1 -1
- package/dist/esm/identity/IdentityProvider.js +14 -5
- package/dist/esm/identity/IdentityProvider.js.map +1 -1
- package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.d.ts +2 -0
- package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.d.ts.map +1 -0
- package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.js +47 -0
- package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.js.map +1 -0
- package/dist/esm/identity/useIdentity.d.ts +2 -0
- package/dist/esm/identity/useIdentity.d.ts.map +1 -1
- package/dist/esm/identity/useIdentity.js +8 -5
- package/dist/esm/identity/useIdentity.js.map +1 -1
- package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.d.ts +19 -0
- package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.d.ts.map +1 -0
- package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.js +25 -0
- package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.js.map +1 -0
- package/dist/esm/queries/for_useObservableQuery/when_creating_instance.d.ts +2 -0
- package/dist/esm/queries/for_useObservableQuery/when_creating_instance.d.ts.map +1 -0
- package/dist/esm/queries/for_useObservableQuery/when_creating_instance.js +66 -0
- package/dist/esm/queries/for_useObservableQuery/when_creating_instance.js.map +1 -0
- package/dist/esm/queries/for_useQuery/FakeQuery.d.ts +14 -0
- package/dist/esm/queries/for_useQuery/FakeQuery.d.ts.map +1 -0
- package/dist/esm/queries/for_useQuery/FakeQuery.js +13 -0
- package/dist/esm/queries/for_useQuery/FakeQuery.js.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance.d.ts +2 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance.d.ts.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance.js +48 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance.js.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.d.ts +2 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.d.ts.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.js +40 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.js.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts +2 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.js +44 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.js.map +1 -0
- package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts +2 -0
- package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts.map +1 -0
- package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.js +51 -0
- package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.js.map +1 -0
- package/dist/esm/queries/useObservableQuery.js +1 -1
- package/dist/esm/queries/useObservableQuery.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/global.d.ts +11 -0
- package/identity/IdentityProvider.tsx +23 -6
- package/identity/for_IdentityProvider/when_refreshing_identity.ts +4 -3
- package/identity/useIdentity.ts +29 -5
- package/package.json +2 -2
- package/queries/for_useObservableQuery/FakeObservableQuery.ts +43 -0
- package/queries/for_useObservableQuery/when_creating_instance.ts +97 -0
- package/queries/for_useQuery/when_creating_instance.ts +6 -2
- package/queries/for_useQuery/when_creating_instance_with_sorting.ts +6 -4
- package/queries/for_useQuery/when_creating_instance_without_optional_context_values.ts +6 -2
- package/queries/for_useQueryWithPaging/when_creating_instance_with_paging.ts +6 -2
- package/queries/useObservableQuery.ts +1 -1
|
@@ -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
|
|
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.
|
|
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
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"when_creating_instance.d.ts","sourceRoot":"","sources":["../../../../commands/for_useCommand/when_creating_instance.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
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":""}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Constructor } from '@cratis/fundamentals';
|
|
2
3
|
import { IIdentity } from '@cratis/arc/identity';
|
|
3
4
|
import { GetHttpHeaders } from '@cratis/arc';
|
|
4
|
-
|
|
5
|
+
type IdentityContextValue = {
|
|
6
|
+
identity: IIdentity;
|
|
7
|
+
detailsConstructor?: Constructor;
|
|
8
|
+
};
|
|
9
|
+
export declare const IdentityProviderContext: React.Context<IdentityContextValue>;
|
|
5
10
|
export interface IdentityProviderProps {
|
|
6
11
|
children?: JSX.Element | JSX.Element[];
|
|
7
12
|
httpHeadersCallback?: GetHttpHeaders;
|
|
13
|
+
detailsType?: Constructor;
|
|
8
14
|
}
|
|
9
15
|
export declare const IdentityProvider: (props: IdentityProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
10
17
|
//# sourceMappingURL=IdentityProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityProvider.d.ts","sourceRoot":"","sources":["../../../identity/IdentityProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAe7C,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"IdentityProvider.d.ts","sourceRoot":"","sources":["../../../identity/IdentityProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAe7C,KAAK,oBAAoB,GAAG;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,kBAAkB,CAAC,EAAE,WAAW,CAAC;CACpC,CAAC;AAMF,eAAO,MAAM,uBAAuB,qCAAiE,CAAC;AAEtG,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACvC,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,WAAW,CAAC,EAAE,WAAW,CAAA;CAC5B;AAED,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,4CAyC5D,CAAC"}
|
|
@@ -16,10 +16,13 @@ const defaultIdentityContext = {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
const
|
|
19
|
+
const defaultContextValue = {
|
|
20
|
+
identity: defaultIdentityContext
|
|
21
|
+
};
|
|
22
|
+
const IdentityProviderContext = React.createContext(defaultContextValue);
|
|
20
23
|
const IdentityProvider = (props) => {
|
|
21
24
|
const arc = React.useContext(ArcContext.ArcContext);
|
|
22
|
-
const [context, setContext] = React.useState(
|
|
25
|
+
const [context, setContext] = React.useState(defaultContextValue);
|
|
23
26
|
const wrapRefresh = (identity) => {
|
|
24
27
|
const originalRefresh = identity.refresh.bind(identity);
|
|
25
28
|
return {
|
|
@@ -28,7 +31,10 @@ const IdentityProvider = (props) => {
|
|
|
28
31
|
return new Promise(resolve => {
|
|
29
32
|
originalRefresh().then(newIdentity => {
|
|
30
33
|
const wrappedIdentity = wrapRefresh(newIdentity);
|
|
31
|
-
setContext(
|
|
34
|
+
setContext({
|
|
35
|
+
identity: wrappedIdentity,
|
|
36
|
+
detailsConstructor: props.detailsType
|
|
37
|
+
});
|
|
32
38
|
resolve(wrappedIdentity);
|
|
33
39
|
});
|
|
34
40
|
});
|
|
@@ -39,9 +45,12 @@ const IdentityProvider = (props) => {
|
|
|
39
45
|
identity.IdentityProvider.setHttpHeadersCallback(props.httpHeadersCallback);
|
|
40
46
|
identity.IdentityProvider.setApiBasePath(arc.apiBasePath ?? '');
|
|
41
47
|
identity.IdentityProvider.setOrigin(arc.origin ?? '');
|
|
42
|
-
identity.IdentityProvider.getCurrent().then(identity => {
|
|
48
|
+
identity.IdentityProvider.getCurrent(props.detailsType).then(identity => {
|
|
43
49
|
const wrappedIdentity = wrapRefresh(identity);
|
|
44
|
-
setContext(
|
|
50
|
+
setContext({
|
|
51
|
+
identity: wrappedIdentity,
|
|
52
|
+
detailsConstructor: props.detailsType
|
|
53
|
+
});
|
|
45
54
|
});
|
|
46
55
|
}, []);
|
|
47
56
|
return (jsxRuntime.jsx(IdentityProviderContext.Provider, { value: context, children: props.children }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityProvider.js","sources":["../../../identity/IdentityProvider.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport { useState, useEffect, useContext } from 'react';\nimport { IIdentity } from '@cratis/arc/identity';\nimport { IdentityProvider as RootIdentityProvider } from '@cratis/arc/identity';\nimport { GetHttpHeaders } from '@cratis/arc';\nimport { ArcContext } from '../ArcContext';\n\nconst defaultIdentityContext: IIdentity = {\n id: '',\n name: '',\n details: {},\n isSet: false,\n refresh: () => {\n return new Promise((resolve, reject) => {\n reject('Not implemented');\n });\n }\n};\n\nexport const IdentityProviderContext = React.createContext<
|
|
1
|
+
{"version":3,"file":"IdentityProvider.js","sources":["../../../identity/IdentityProvider.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport { useState, useEffect, useContext } from 'react';\nimport { Constructor } from '@cratis/fundamentals';\nimport { IIdentity } from '@cratis/arc/identity';\nimport { IdentityProvider as RootIdentityProvider } from '@cratis/arc/identity';\nimport { GetHttpHeaders } from '@cratis/arc';\nimport { ArcContext } from '../ArcContext';\n\nconst defaultIdentityContext: IIdentity = {\n id: '',\n name: '',\n details: {},\n isSet: false,\n refresh: () => {\n return new Promise((resolve, reject) => {\n reject('Not implemented');\n });\n }\n};\n\ntype IdentityContextValue = {\n identity: IIdentity;\n detailsConstructor?: Constructor;\n};\n\nconst defaultContextValue: IdentityContextValue = {\n identity: defaultIdentityContext\n};\n\nexport const IdentityProviderContext = React.createContext<IdentityContextValue>(defaultContextValue);\n\nexport interface IdentityProviderProps {\n children?: JSX.Element | JSX.Element[],\n httpHeadersCallback?: GetHttpHeaders,\n detailsType?: Constructor\n}\n\nexport const IdentityProvider = (props: IdentityProviderProps) => {\n const arc = useContext(ArcContext);\n const [context, setContext] = useState<IdentityContextValue>(defaultContextValue);\n\n const wrapRefresh = (identity: IIdentity): IIdentity => {\n const originalRefresh = identity.refresh.bind(identity);\n return {\n ...identity,\n refresh: () => {\n return new Promise<IIdentity>(resolve => {\n originalRefresh().then(newIdentity => {\n const wrappedIdentity = wrapRefresh(newIdentity);\n setContext({\n identity: wrappedIdentity,\n detailsConstructor: props.detailsType\n });\n resolve(wrappedIdentity);\n });\n });\n }\n };\n };\n\n useEffect(() => {\n RootIdentityProvider.setHttpHeadersCallback(props.httpHeadersCallback!);\n RootIdentityProvider.setApiBasePath(arc.apiBasePath ?? '');\n RootIdentityProvider.setOrigin(arc.origin ?? '');\n RootIdentityProvider.getCurrent(props.detailsType).then(identity => {\n const wrappedIdentity = wrapRefresh(identity);\n setContext({\n identity: wrappedIdentity,\n detailsConstructor: props.detailsType\n });\n });\n }, []);\n\n return (\n <IdentityProviderContext.Provider value={context}>\n {props.children}\n </IdentityProviderContext.Provider>\n );\n};\n"],"names":["useContext","ArcContext","useState","useEffect","RootIdentityProvider","_jsx"],"mappings":";;;;;;;AAWA,MAAM,sBAAsB,GAAc;AACtC,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,MAAK;QACV,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;YACnC,MAAM,CAAC,iBAAiB,CAAC;AAC7B,QAAA,CAAC,CAAC;IACN;CACH;AAOD,MAAM,mBAAmB,GAAyB;AAC9C,IAAA,QAAQ,EAAE;CACb;AAEM,MAAM,uBAAuB,GAAG,KAAK,CAAC,aAAa,CAAuB,mBAAmB;AAQ7F,MAAM,gBAAgB,GAAG,CAAC,KAA4B,KAAI;AAC7D,IAAA,MAAM,GAAG,GAAGA,gBAAU,CAACC,qBAAU,CAAC;IAClC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAGC,cAAQ,CAAuB,mBAAmB,CAAC;AAEjF,IAAA,MAAM,WAAW,GAAG,CAAC,QAAmB,KAAe;QACnD,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;QACvD,OAAO;AACH,YAAA,GAAG,QAAQ;YACX,OAAO,EAAE,MAAK;AACV,gBAAA,OAAO,IAAI,OAAO,CAAY,OAAO,IAAG;AACpC,oBAAA,eAAe,EAAE,CAAC,IAAI,CAAC,WAAW,IAAG;AACjC,wBAAA,MAAM,eAAe,GAAG,WAAW,CAAC,WAAW,CAAC;AAChD,wBAAA,UAAU,CAAC;AACP,4BAAA,QAAQ,EAAE,eAAe;4BACzB,kBAAkB,EAAE,KAAK,CAAC;AAC7B,yBAAA,CAAC;wBACF,OAAO,CAAC,eAAe,CAAC;AAC5B,oBAAA,CAAC,CAAC;AACN,gBAAA,CAAC,CAAC;YACN;SACH;AACL,IAAA,CAAC;IAEDC,eAAS,CAAC,MAAK;AACX,QAAAC,yBAAoB,CAAC,sBAAsB,CAAC,KAAK,CAAC,mBAAoB,CAAC;QACvEA,yBAAoB,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;QAC1DA,yBAAoB,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;AAChD,QAAAA,yBAAoB,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAG;AAC/D,YAAA,MAAM,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC;AAC7C,YAAA,UAAU,CAAC;AACP,gBAAA,QAAQ,EAAE,eAAe;gBACzB,kBAAkB,EAAE,KAAK,CAAC;AAC7B,aAAA,CAAC;AACN,QAAA,CAAC,CAAC;IACN,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,QACIC,cAAA,CAAC,uBAAuB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,OAAO,YAC3C,KAAK,CAAC,QAAQ,EAAA,CACgB;AAE3C;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when_refreshing_identity.d.ts","sourceRoot":"","sources":["../../../../identity/for_IdentityProvider/when_refreshing_identity.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Constructor } from '@cratis/fundamentals';
|
|
1
2
|
import { IIdentity } from '@cratis/arc/identity';
|
|
2
3
|
export declare function useIdentity<TDetails = object>(defaultDetails?: TDetails | undefined | null): IIdentity<TDetails>;
|
|
4
|
+
export declare function useIdentity<TDetails = object>(type: Constructor<TDetails>, defaultDetails?: TDetails | undefined | null): IIdentity<TDetails>;
|
|
3
5
|
//# sourceMappingURL=useIdentity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIdentity.d.ts","sourceRoot":"","sources":["../../../identity/useIdentity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIdentity.d.ts","sourceRoot":"","sources":["../../../identity/useIdentity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAOjD,wBAAgB,WAAW,CAAC,QAAQ,GAAG,MAAM,EAAE,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAQlH,wBAAgB,WAAW,CAAC,QAAQ,GAAG,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var IdentityProvider = require('./IdentityProvider.js');
|
|
5
5
|
|
|
6
|
-
function useIdentity(defaultDetails) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
function useIdentity(typeOrDefaultDetails, defaultDetails) {
|
|
7
|
+
const contextValue = React.useContext(IdentityProvider.IdentityProviderContext);
|
|
8
|
+
const identity = contextValue.identity;
|
|
9
|
+
const isConstructor = typeof typeOrDefaultDetails === 'function';
|
|
10
|
+
const actualDefaultDetails = isConstructor ? defaultDetails : typeOrDefaultDetails;
|
|
11
|
+
if (identity.isSet === false && actualDefaultDetails !== undefined) {
|
|
12
|
+
identity.details = actualDefaultDetails;
|
|
10
13
|
}
|
|
11
|
-
return
|
|
14
|
+
return identity;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
exports.useIdentity = useIdentity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIdentity.js","sources":["../../../identity/useIdentity.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport { IdentityProviderContext } from './IdentityProvider';\nimport { IIdentity } from '@cratis/arc/identity';\n\n/**\n * Hook to get the identity context.\n * @param defaultDetails Optional default details to use if the context is not set.\n * @returns An identity context.\n */\nexport function useIdentity<TDetails = object>(defaultDetails?: TDetails | undefined | null): IIdentity<TDetails> {\n const
|
|
1
|
+
{"version":3,"file":"useIdentity.js","sources":["../../../identity/useIdentity.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport { Constructor } from '@cratis/fundamentals';\nimport { IdentityProviderContext } from './IdentityProvider';\nimport { IIdentity } from '@cratis/arc/identity';\n\n/**\n * Hook to get the identity context.\n * @param defaultDetails Optional default details to use if the context is not set.\n * @returns An identity context.\n */\nexport function useIdentity<TDetails = object>(defaultDetails?: TDetails | undefined | null): IIdentity<TDetails>;\n\n/**\n * Hook to get the identity context with type-safe deserialization.\n * @param type Constructor for the details type to enable type-safe deserialization.\n * @param defaultDetails Optional default details to use if the context is not set.\n * @returns An identity context.\n */\nexport function useIdentity<TDetails = object>(type: Constructor<TDetails>, defaultDetails?: TDetails | undefined | null): IIdentity<TDetails>;\n\nexport function useIdentity<TDetails = object>(\n typeOrDefaultDetails?: Constructor<TDetails> | TDetails | undefined | null,\n defaultDetails?: TDetails | undefined | null\n): IIdentity<TDetails> {\n const contextValue = React.useContext(IdentityProviderContext);\n const identity = contextValue.identity as IIdentity<TDetails>;\n \n // Determine if first argument is a Constructor or default details\n // Constructors are functions, but regular functions would be unusual here.\n // We rely on the type system and developer intent - if a function is passed, \n // it's expected to be a constructor class.\n const isConstructor = typeof typeOrDefaultDetails === 'function';\n const actualDefaultDetails = isConstructor ? defaultDetails : typeOrDefaultDetails;\n \n if (identity.isSet === false && actualDefaultDetails !== undefined) {\n identity.details = actualDefaultDetails!;\n }\n \n return identity;\n}\n"],"names":["IdentityProviderContext"],"mappings":";;;;;AAuBM,SAAU,WAAW,CACvB,oBAA0E,EAC1E,cAA4C,EAAA;IAE5C,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAACA,wCAAuB,CAAC;AAC9D,IAAA,MAAM,QAAQ,GAAG,YAAY,CAAC,QAA+B;AAM7D,IAAA,MAAM,aAAa,GAAG,OAAO,oBAAoB,KAAK,UAAU;IAChE,MAAM,oBAAoB,GAAG,aAAa,GAAG,cAAc,GAAG,oBAAoB;IAElF,IAAI,QAAQ,CAAC,KAAK,KAAK,KAAK,IAAI,oBAAoB,KAAK,SAAS,EAAE;AAChE,QAAA,QAAQ,CAAC,OAAO,GAAG,oBAAqB;IAC5C;AAEA,IAAA,OAAO,QAAQ;AACnB;;;;"}
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"when_creating_instance.d.ts","sourceRoot":"","sources":["../../../../queries/for_useQuery/when_creating_instance.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"when_creating_instance_with_paging.d.ts","sourceRoot":"","sources":["../../../../queries/for_useQueryWithPaging/when_creating_instance_with_paging.ts"],"names":[],"mappings":""}
|
|
@@ -18,7 +18,7 @@ function useObservableQueryInternal(query, sorting, paging, args) {
|
|
|
18
18
|
instance.setOrigin(arc.origin ?? '');
|
|
19
19
|
return instance;
|
|
20
20
|
}, [currentPaging, currentSorting, arc.microservice, arc.apiBasePath, arc.origin]);
|
|
21
|
-
const [result, setResult] = React.useState(queries.QueryResultWithState.
|
|
21
|
+
const [result, setResult] = React.useState(queries.QueryResultWithState.initial(queryInstance.current.defaultValue));
|
|
22
22
|
const argumentsDependency = queryInstance.current.requiredRequestParameters.map(_ => args?.[_]);
|
|
23
23
|
React.useEffect(() => {
|
|
24
24
|
const subscription = queryInstance.current.subscribe(response => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useObservableQuery.js","sources":["../../../queries/useObservableQuery.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { QueryResultWithState, IObservableQueryFor, Sorting, Paging } from '@cratis/arc/queries';\nimport { Constructor } from '@cratis/fundamentals';\nimport { useState, useEffect, useContext, useRef, useMemo } from 'react';\nimport { SetSorting } from './SetSorting';\nimport { SetPage } from './SetPage';\nimport { SetPageSize } from './SetPageSize';\nimport { ArcContext } from '../ArcContext';\n\nfunction useObservableQueryInternal<TDataType, TQuery extends IObservableQueryFor<TDataType>, TArguments = object>(query: Constructor<TQuery>, sorting?: Sorting, paging?: Paging, args?: TArguments):\n [QueryResultWithState<TDataType>, SetSorting, SetPage, SetPageSize] {\n const [currentPaging, setCurrentPaging] = useState<Paging>(paging ?? Paging.noPaging);\n const [currentSorting, setCurrentSorting] = useState<Sorting>(sorting ?? Sorting.none);\n const arc = useContext(ArcContext);\n const queryInstance = useRef<TQuery | null>(null);\n\n queryInstance.current = useMemo(() => {\n const instance = new query() as TQuery;\n instance.paging = currentPaging;\n instance.sorting = currentSorting;\n instance.setMicroservice(arc.microservice);\n instance.setApiBasePath(arc.apiBasePath ?? '');\n instance.setOrigin(arc.origin ?? '');\n return instance;\n }, [currentPaging, currentSorting, arc.microservice, arc.apiBasePath, arc.origin]);\n\n const [result, setResult] = useState<QueryResultWithState<TDataType>>(QueryResultWithState.
|
|
1
|
+
{"version":3,"file":"useObservableQuery.js","sources":["../../../queries/useObservableQuery.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { QueryResultWithState, IObservableQueryFor, Sorting, Paging } from '@cratis/arc/queries';\nimport { Constructor } from '@cratis/fundamentals';\nimport { useState, useEffect, useContext, useRef, useMemo } from 'react';\nimport { SetSorting } from './SetSorting';\nimport { SetPage } from './SetPage';\nimport { SetPageSize } from './SetPageSize';\nimport { ArcContext } from '../ArcContext';\n\nfunction useObservableQueryInternal<TDataType, TQuery extends IObservableQueryFor<TDataType>, TArguments = object>(query: Constructor<TQuery>, sorting?: Sorting, paging?: Paging, args?: TArguments):\n [QueryResultWithState<TDataType>, SetSorting, SetPage, SetPageSize] {\n const [currentPaging, setCurrentPaging] = useState<Paging>(paging ?? Paging.noPaging);\n const [currentSorting, setCurrentSorting] = useState<Sorting>(sorting ?? Sorting.none);\n const arc = useContext(ArcContext);\n const queryInstance = useRef<TQuery | null>(null);\n\n queryInstance.current = useMemo(() => {\n const instance = new query() as TQuery;\n instance.paging = currentPaging;\n instance.sorting = currentSorting;\n instance.setMicroservice(arc.microservice);\n instance.setApiBasePath(arc.apiBasePath ?? '');\n instance.setOrigin(arc.origin ?? '');\n return instance;\n }, [currentPaging, currentSorting, arc.microservice, arc.apiBasePath, arc.origin]);\n\n const [result, setResult] = useState<QueryResultWithState<TDataType>>(QueryResultWithState.initial(queryInstance.current.defaultValue));\n const argumentsDependency = queryInstance.current.requiredRequestParameters.map(_ => args?.[_]);\n\n useEffect(() => {\n const subscription = queryInstance.current!.subscribe(response => {\n setResult(QueryResultWithState.fromQueryResult(response, false));\n }, args as object);\n\n return () => {\n subscription.unsubscribe();\n };\n }, [...argumentsDependency, ...[currentPaging, currentSorting]]);\n\n return [\n result,\n async (sorting: Sorting) => {\n setCurrentSorting(sorting);\n },\n async (page: number) => {\n setCurrentPaging(new Paging(page, currentPaging.pageSize));\n },\n async (pageSize: number) => {\n setCurrentPaging(new Paging(currentPaging.page, pageSize));\n }];\n}\n\n/**\n * React hook for working with {@link IObservableQueryFor} within the state management of React.\n * @template TDataType Type of model the query is for.\n * @template TQuery Type of observable query to use.\n * @template TArguments Optional: Arguments for the query, if any\n * @param query Query type constructor.\n * @param args Optional: Arguments for the query, if any\n * @returns Tuple of {@link QueryResultWithState} and a {@link PerformQuery} delegate.\n */\nexport function useObservableQuery<TDataType, TQuery extends IObservableQueryFor<TDataType>, TArguments = object>(query: Constructor<TQuery>, args?: TArguments, sorting?: Sorting):\n [QueryResultWithState<TDataType>, SetSorting] {\n const [result, setSorting] = useObservableQueryInternal<TDataType, TQuery, TArguments>(query, sorting, Paging.noPaging, args);\n return [result, setSorting];\n}\n\n/**\n * React hook for working with {@link IObservableQueryFor} within the state management of React for queries with paging.\n * @template TDataType Type of model the query is for.\n * @template TQuery Type of observable query to use.\n * @template TArguments Optional: Arguments for the query, if any\n * @param query Query type constructor.\n * @param args Optional: Arguments for the query, if any\n * @param paging Paging information.\n * @returns Tuple of {@link QueryResultWithState} and a {@link PerformQuery} delegate.\n */\nexport function useObservableQueryWithPaging<TDataType, TQuery extends IObservableQueryFor<TDataType>, TArguments = object>(query: Constructor<TQuery>, paging: Paging, args?: TArguments, sorting?: Sorting):\n [QueryResultWithState<TDataType>, SetSorting, SetPage, SetPageSize] {\n return useObservableQueryInternal<TDataType, TQuery, TArguments>(query, sorting, paging, args);\n}\n"],"names":["useState","Paging","Sorting","useContext","ArcContext","useRef","useMemo","QueryResultWithState","useEffect"],"mappings":";;;;;;AAWA,SAAS,0BAA0B,CAAgF,KAA0B,EAAE,OAAiB,EAAE,MAAe,EAAE,IAAiB,EAAA;AAEhM,IAAA,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAGA,cAAQ,CAAS,MAAM,IAAIC,cAAM,CAAC,QAAQ,CAAC;AACrF,IAAA,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAGD,cAAQ,CAAU,OAAO,IAAIE,eAAO,CAAC,IAAI,CAAC;AACtF,IAAA,MAAM,GAAG,GAAGC,gBAAU,CAACC,qBAAU,CAAC;AAClC,IAAA,MAAM,aAAa,GAAGC,YAAM,CAAgB,IAAI,CAAC;AAEjD,IAAA,aAAa,CAAC,OAAO,GAAGC,aAAO,CAAC,MAAK;AACjC,QAAA,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAY;AACtC,QAAA,QAAQ,CAAC,MAAM,GAAG,aAAa;AAC/B,QAAA,QAAQ,CAAC,OAAO,GAAG,cAAc;AACjC,QAAA,QAAQ,CAAC,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC;QAC1C,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;QAC9C,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;AACpC,QAAA,OAAO,QAAQ;AACnB,IAAA,CAAC,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;AAElF,IAAA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAGN,cAAQ,CAAkCO,4BAAoB,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACvI,MAAM,mBAAmB,GAAG,aAAa,CAAC,OAAO,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC;IAE/FC,eAAS,CAAC,MAAK;QACX,MAAM,YAAY,GAAG,aAAa,CAAC,OAAQ,CAAC,SAAS,CAAC,QAAQ,IAAG;YAC7D,SAAS,CAACD,4BAAoB,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACpE,CAAC,EAAE,IAAc,CAAC;AAElB,QAAA,OAAO,MAAK;YACR,YAAY,CAAC,WAAW,EAAE;AAC9B,QAAA,CAAC;AACL,IAAA,CAAC,EAAE,CAAC,GAAG,mBAAmB,EAAE,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;IAEhE,OAAO;QACH,MAAM;QACN,OAAO,OAAgB,KAAI;YACvB,iBAAiB,CAAC,OAAO,CAAC;QAC9B,CAAC;QACD,OAAO,IAAY,KAAI;YACnB,gBAAgB,CAAC,IAAIN,cAAM,CAAC,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,QAAgB,KAAI;YACvB,gBAAgB,CAAC,IAAIA,cAAM,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC9D;KAAE;AACV;SAWgB,kBAAkB,CAAgF,KAA0B,EAAE,IAAiB,EAAE,OAAiB,EAAA;AAE9K,IAAA,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,0BAA0B,CAAgC,KAAK,EAAE,OAAO,EAAEA,cAAM,CAAC,QAAQ,EAAE,IAAI,CAAC;AAC7H,IAAA,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC;AAC/B;AAYM,SAAU,4BAA4B,CAAgF,KAA0B,EAAE,MAAc,EAAE,IAAiB,EAAE,OAAiB,EAAA;IAExM,OAAO,0BAA0B,CAAgC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC;AAClG;;;;;"}
|
|
@@ -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 @@
|
|
|
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":""}
|