@buildery/ts-api-kit 5.2.5 → 6.0.1
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/dist/Api.d.ts +76 -63
- package/dist/Api.js +4 -0
- package/dist/Api.js.map +1 -1
- package/dist/ApiConfigs.d.ts +7 -6
- package/dist/ApiConfigs.js +1 -0
- package/dist/ApiConfigs.js.map +1 -1
- package/dist/compose/useSingleton.d.ts +1 -1
- package/dist/compose/useSingleton.js +1 -2
- package/dist/compose/useSingleton.js.map +1 -1
- package/dist/features/api/AbstractApi.js.map +1 -1
- package/dist/features/auth/services/AuthAxiosService.js +6 -3
- package/dist/features/auth/services/AuthAxiosService.js.map +1 -1
- package/dist/features/auth/services/AuthService.d.ts +0 -1
- package/dist/features/auth/services/AuthService.js +0 -4
- package/dist/features/auth/services/AuthService.js.map +1 -1
- package/dist/features/callout/Callout.d.ts +22 -0
- package/dist/features/callout/Callout.js +66 -0
- package/dist/features/callout/Callout.js.map +1 -0
- package/dist/features/callout/CalloutMiddlewareService.d.ts +5 -0
- package/dist/features/callout/CalloutMiddlewareService.js +17 -0
- package/dist/features/callout/CalloutMiddlewareService.js.map +1 -0
- package/dist/features/callout/CalloutMiddlewares.d.ts +4 -0
- package/dist/features/callout/CalloutMiddlewares.js +15 -0
- package/dist/features/callout/CalloutMiddlewares.js.map +1 -0
- package/dist/features/callout/Calloutable.d.ts +3 -0
- package/dist/features/callout/Calloutable.js +20 -0
- package/dist/features/callout/Calloutable.js.map +1 -0
- package/dist/features/callout/index.d.ts +4 -1
- package/dist/features/callout/index.js +4 -1
- package/dist/features/callout/index.js.map +1 -1
- package/dist/features/callout/types.d.ts +21 -0
- package/dist/features/callout/types.js +3 -0
- package/dist/features/callout/types.js.map +1 -0
- package/dist/features/crud/operations/abstract/AbstractCRUDApi.js.map +1 -1
- package/dist/features/crud/operations/operations/Create.js +4 -4
- package/dist/features/crud/operations/operations/Create.js.map +1 -1
- package/dist/features/crud/operations/operations/CreateBulk.js +3 -4
- package/dist/features/crud/operations/operations/CreateBulk.js.map +1 -1
- package/dist/features/crud/operations/operations/DeleteByFilters.js +1 -1
- package/dist/features/crud/operations/operations/DeleteByFilters.js.map +1 -1
- package/dist/features/crud/operations/operations/DeleteById.js +1 -1
- package/dist/features/crud/operations/operations/DeleteById.js.map +1 -1
- package/dist/features/crud/operations/operations/DeleteByIds.js +1 -1
- package/dist/features/crud/operations/operations/DeleteByIds.js.map +1 -1
- package/dist/features/crud/operations/operations/GetAll.js +1 -1
- package/dist/features/crud/operations/operations/GetAll.js.map +1 -1
- package/dist/features/crud/operations/operations/GetByFilters.js +1 -1
- package/dist/features/crud/operations/operations/GetByFilters.js.map +1 -1
- package/dist/features/crud/operations/operations/GetById.js +1 -1
- package/dist/features/crud/operations/operations/GetById.js.map +1 -1
- package/dist/features/crud/operations/operations/GetByIds.js +1 -1
- package/dist/features/crud/operations/operations/GetByIds.js.map +1 -1
- package/dist/features/crud/operations/operations/Update.js +1 -1
- package/dist/features/crud/operations/operations/Update.js.map +1 -1
- package/dist/features/crud/operations/operations/UpdateBulk.js +1 -1
- package/dist/features/crud/operations/operations/UpdateBulk.js.map +1 -1
- package/dist/features/crud/operations/operations/Upsert.js +1 -1
- package/dist/features/crud/operations/operations/Upsert.js.map +1 -1
- package/dist/features/crud/operations/operations/UpsertBulk.js +1 -1
- package/dist/features/crud/operations/operations/UpsertBulk.js.map +1 -1
- package/dist/features/crud/sync/compose/useCrudSync.js +1 -2
- package/dist/features/crud/sync/compose/useCrudSync.js.map +1 -1
- package/dist/features/crud/sync/constants/CrudSyncAction.js +1 -1
- package/dist/features/crud/sync/constants/CrudSyncAction.js.map +1 -1
- package/dist/features/crud/sync/middlewares/PushCrudEvent.js.map +1 -1
- package/dist/features/crud/sync/sync/abstract/AbstractCrudSync.js.map +1 -1
- package/dist/micro/auth/AuthApi.d.ts +6 -6
- package/dist/micro/auth/AuthApi.js +1 -1
- package/dist/micro/auth/AuthApi.js.map +1 -1
- package/dist/micro/auth/WorkspaceApi.js +1 -1
- package/dist/micro/auth/WorkspaceApi.js.map +1 -1
- package/dist/micro/query/FieldApi.d.ts +3 -3
- package/dist/micro/query/FieldApi.js +3 -3
- package/dist/micro/query/FieldApi.js.map +1 -1
- package/dist/micro/query/SObjectApi.d.ts +1 -1
- package/dist/micro/query/SObjectApi.js +1 -1
- package/dist/micro/query/SObjectApi.js.map +1 -1
- package/dist/micro/query/types/FieldType.js +1 -1
- package/dist/micro/query/types/FieldType.js.map +1 -1
- package/dist/micro/query/types/SObjectField.d.ts +1 -0
- package/dist/micro/security/PermissionApi.js +1 -1
- package/dist/micro/security/PermissionApi.js.map +1 -1
- package/dist/micro/security/PermissionCategoryApi.js +1 -1
- package/dist/micro/security/PermissionCategoryApi.js.map +1 -1
- package/dist/micro/security/PermissionSetApi.d.ts +2 -2
- package/dist/micro/security/PermissionSetApi.js +1 -1
- package/dist/micro/security/PermissionSetApi.js.map +1 -1
- package/dist/micro/security/TeamApi.d.ts +2 -2
- package/dist/micro/security/TeamApi.js +1 -1
- package/dist/micro/security/TeamApi.js.map +1 -1
- package/dist/micro/workspace/ModuleApi.d.ts +3 -3
- package/dist/micro/workspace/ModuleApi.js +1 -1
- package/dist/micro/workspace/ModuleApi.js.map +1 -1
- package/dist/micro/workspace/types/EUserStatus.js +1 -1
- package/dist/micro/workspace/types/EUserStatus.js.map +1 -1
- package/dist/services/ResponseService.d.ts +9 -0
- package/dist/services/ResponseService.js +28 -0
- package/dist/services/ResponseService.js.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/HasCallouts.d.ts +1 -1
- package/package.json +6 -5
package/dist/Api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Permission, PermissionAssignment, PermissionCategory, PermissionDefinition, PermissionGroup, PermissionSet, Module, SObject, SObjectField, Team, User, WorkspaceApi } from "./micro";
|
|
2
2
|
import { HasCallouts } from "./types";
|
|
3
3
|
import { AuthApi } from "./micro/auth/AuthApi";
|
|
4
|
+
import { Flow } from '@buildery/flow';
|
|
4
5
|
export type ApiLayer = {
|
|
5
6
|
[Micro in keyof typeof RawApi]: {
|
|
6
7
|
[Entity in keyof typeof RawApi[Micro]]: typeof RawApi[Micro][Entity] extends (...params: infer EntityParams) => infer EntityResult ? (...args: EntityParams) => EntityResult & HasCallouts<EntityResult> : typeof RawApi[Micro][Entity] & HasCallouts<typeof RawApi[Micro][Entity]>;
|
|
@@ -15,164 +16,176 @@ export declare const RawApi: {
|
|
|
15
16
|
};
|
|
16
17
|
readonly query: {
|
|
17
18
|
readonly object: {
|
|
18
|
-
getByApiName(apiName: string): import("axios").AxiosRequestConfig
|
|
19
|
+
getByApiName(apiName: string): import("axios").AxiosRequestConfig;
|
|
19
20
|
readonly objectName: string;
|
|
20
21
|
readonly _serverName: string;
|
|
21
22
|
readonly serverName: any;
|
|
22
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
23
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
23
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
24
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
24
25
|
create(entity: SObject): import("axios").AxiosRequestConfig<SObject>;
|
|
25
26
|
update(entity: SObject): import("axios").AxiosRequestConfig<SObject>;
|
|
26
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
27
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
27
28
|
};
|
|
28
29
|
readonly field: {
|
|
29
|
-
create(field: SObjectField): import("axios").AxiosRequestConfig
|
|
30
|
-
getAllByObjectId(objectId: string): import("axios").AxiosRequestConfig
|
|
30
|
+
create(field: SObjectField): import("axios").AxiosRequestConfig;
|
|
31
|
+
getAllByObjectId(objectId: string): import("axios").AxiosRequestConfig;
|
|
31
32
|
getAllByObjectApiName(apiName: string): {
|
|
32
33
|
baseURL: any;
|
|
33
34
|
url: string;
|
|
34
35
|
};
|
|
35
|
-
deleteAllByObjectId(objectId: string): import("axios").AxiosRequestConfig
|
|
36
|
+
deleteAllByObjectId(objectId: string): import("axios").AxiosRequestConfig;
|
|
36
37
|
readonly objectName: string;
|
|
37
38
|
readonly _serverName: string;
|
|
38
39
|
readonly serverName: any;
|
|
39
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
40
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
40
41
|
update(entity: SObjectField): import("axios").AxiosRequestConfig<SObjectField>;
|
|
41
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
42
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
42
43
|
};
|
|
43
44
|
readonly record: <T>(objectName: string) => {
|
|
44
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
45
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
45
46
|
readonly objectName: string;
|
|
46
47
|
readonly _serverName: string;
|
|
47
48
|
readonly serverName: any;
|
|
48
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
49
|
-
getByFilters(query?: import("./types").ApiQueryRequest<T>): import("axios").AxiosRequestConfig
|
|
49
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
50
|
+
getByFilters(query?: import("./types").ApiQueryRequest<T>): import("axios").AxiosRequestConfig;
|
|
50
51
|
create(entity: T): import("axios").AxiosRequestConfig<T>;
|
|
51
52
|
update(entity: T): import("axios").AxiosRequestConfig<T>;
|
|
52
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
53
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
53
54
|
};
|
|
54
55
|
};
|
|
55
56
|
readonly security: {
|
|
56
57
|
readonly permission: {
|
|
57
|
-
getByCategoryId(categoryId: string): import("axios").AxiosRequestConfig
|
|
58
|
-
getByCategoryIds(categoryIds: string
|
|
58
|
+
getByCategoryId(categoryId: string): import("axios").AxiosRequestConfig;
|
|
59
|
+
getByCategoryIds(categoryIds: Array<string>): import("axios").AxiosRequestConfig;
|
|
59
60
|
getWithAssignments(data: import("./types").ApiQueryRequest<any> & {
|
|
60
61
|
permissionSetId: string;
|
|
61
|
-
}): import("axios").AxiosRequestConfig
|
|
62
|
+
}): import("axios").AxiosRequestConfig;
|
|
62
63
|
readonly objectName: string;
|
|
63
64
|
readonly _serverName: string;
|
|
64
65
|
readonly serverName: any;
|
|
65
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
66
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
67
|
-
getByFilters(query?: import("./types").ApiQueryRequest<Permission>): import("axios").AxiosRequestConfig
|
|
66
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
67
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
68
|
+
getByFilters(query?: import("./types").ApiQueryRequest<Permission>): import("axios").AxiosRequestConfig;
|
|
68
69
|
create(entity: Permission): import("axios").AxiosRequestConfig<Permission>;
|
|
69
70
|
update(entity: Permission): import("axios").AxiosRequestConfig<Permission>;
|
|
70
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
71
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
71
72
|
};
|
|
72
73
|
readonly permissionCategory: {
|
|
73
|
-
getByGroupId(groupId: string): import("axios").AxiosRequestConfig
|
|
74
|
+
getByGroupId(groupId: string): import("axios").AxiosRequestConfig;
|
|
74
75
|
readonly objectName: string;
|
|
75
76
|
readonly _serverName: string;
|
|
76
77
|
readonly serverName: any;
|
|
77
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
78
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
79
|
-
getByFilters(query?: import("./types").ApiQueryRequest<PermissionCategory>): import("axios").AxiosRequestConfig
|
|
78
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
79
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
80
|
+
getByFilters(query?: import("./types").ApiQueryRequest<PermissionCategory>): import("axios").AxiosRequestConfig;
|
|
80
81
|
create(entity: PermissionCategory): import("axios").AxiosRequestConfig<PermissionCategory>;
|
|
81
82
|
update(entity: PermissionCategory): import("axios").AxiosRequestConfig<PermissionCategory>;
|
|
82
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
83
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
83
84
|
};
|
|
84
85
|
readonly permissionAssignment: {
|
|
85
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
86
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
86
87
|
readonly objectName: string;
|
|
87
88
|
readonly _serverName: string;
|
|
88
89
|
readonly serverName: any;
|
|
89
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
90
|
-
getByFilters(query?: import("./types").ApiQueryRequest<PermissionAssignment>): import("axios").AxiosRequestConfig
|
|
90
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
91
|
+
getByFilters(query?: import("./types").ApiQueryRequest<PermissionAssignment>): import("axios").AxiosRequestConfig;
|
|
91
92
|
create(entity: PermissionAssignment): import("axios").AxiosRequestConfig<PermissionAssignment>;
|
|
92
93
|
update(entity: PermissionAssignment): import("axios").AxiosRequestConfig<PermissionAssignment>;
|
|
93
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
94
|
-
deleteByFilters(filter: import("mongodb").Filter<PermissionAssignment>): import("axios").AxiosRequestConfig
|
|
94
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
95
|
+
deleteByFilters(filter: import("mongodb").Filter<PermissionAssignment>): import("axios").AxiosRequestConfig;
|
|
95
96
|
};
|
|
96
97
|
readonly permissionDefinition: {
|
|
97
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
98
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
98
99
|
readonly objectName: string;
|
|
99
100
|
readonly _serverName: string;
|
|
100
101
|
readonly serverName: any;
|
|
101
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
102
|
-
getByIds(entityIds: string
|
|
103
|
-
getByFilters(query?: import("./types").ApiQueryRequest<PermissionDefinition>): import("axios").AxiosRequestConfig
|
|
102
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
103
|
+
getByIds(entityIds: Array<string>): import("axios").AxiosRequestConfig;
|
|
104
|
+
getByFilters(query?: import("./types").ApiQueryRequest<PermissionDefinition>): import("axios").AxiosRequestConfig;
|
|
104
105
|
create(entity: PermissionDefinition): import("axios").AxiosRequestConfig<PermissionDefinition>;
|
|
105
106
|
update(entity: PermissionDefinition): import("axios").AxiosRequestConfig<PermissionDefinition>;
|
|
106
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
107
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
107
108
|
};
|
|
108
109
|
readonly permissionGroup: {
|
|
109
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
110
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
110
111
|
readonly objectName: string;
|
|
111
112
|
readonly _serverName: string;
|
|
112
113
|
readonly serverName: any;
|
|
113
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
114
|
-
getByFilters(query?: import("./types").ApiQueryRequest<PermissionGroup>): import("axios").AxiosRequestConfig
|
|
114
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
115
|
+
getByFilters(query?: import("./types").ApiQueryRequest<PermissionGroup>): import("axios").AxiosRequestConfig;
|
|
115
116
|
create(entity: PermissionGroup): import("axios").AxiosRequestConfig<PermissionGroup>;
|
|
116
117
|
update(entity: PermissionGroup): import("axios").AxiosRequestConfig<PermissionGroup>;
|
|
117
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
118
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
118
119
|
};
|
|
119
120
|
readonly permissionSet: {
|
|
120
|
-
assign(assignment: import("./micro").PermissionSetAssignment): import("axios").AxiosRequestConfig
|
|
121
|
-
unAssign(assignment: import("./micro").PermissionSetAssignment): import("axios").AxiosRequestConfig
|
|
121
|
+
assign(assignment: import("./micro").PermissionSetAssignment): import("axios").AxiosRequestConfig;
|
|
122
|
+
unAssign(assignment: import("./micro").PermissionSetAssignment): import("axios").AxiosRequestConfig;
|
|
122
123
|
readonly objectName: string;
|
|
123
124
|
readonly _serverName: string;
|
|
124
125
|
readonly serverName: any;
|
|
125
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
126
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
127
|
-
getByFilters(query?: import("./types").ApiQueryRequest<PermissionSet>): import("axios").AxiosRequestConfig
|
|
126
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
127
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
128
|
+
getByFilters(query?: import("./types").ApiQueryRequest<PermissionSet>): import("axios").AxiosRequestConfig;
|
|
128
129
|
create(entity: PermissionSet): import("axios").AxiosRequestConfig<PermissionSet>;
|
|
129
130
|
update(entity: PermissionSet): import("axios").AxiosRequestConfig<PermissionSet>;
|
|
130
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
131
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
131
132
|
};
|
|
132
133
|
readonly team: {
|
|
133
|
-
assign(assignment: import("./micro").TeamAssignment): import("axios").AxiosRequestConfig
|
|
134
|
-
unassign(assignment: import("./micro").TeamAssignment): import("axios").AxiosRequestConfig
|
|
134
|
+
assign(assignment: import("./micro").TeamAssignment): import("axios").AxiosRequestConfig;
|
|
135
|
+
unassign(assignment: import("./micro").TeamAssignment): import("axios").AxiosRequestConfig;
|
|
135
136
|
readonly objectName: string;
|
|
136
137
|
readonly _serverName: string;
|
|
137
138
|
readonly serverName: any;
|
|
138
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
139
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
140
|
-
getByFilters(query?: import("./types").ApiQueryRequest<Team>): import("axios").AxiosRequestConfig
|
|
139
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
140
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
141
|
+
getByFilters(query?: import("./types").ApiQueryRequest<Team>): import("axios").AxiosRequestConfig;
|
|
141
142
|
create(entity: Team): import("axios").AxiosRequestConfig<Team>;
|
|
142
143
|
update(entity: Team): import("axios").AxiosRequestConfig<Team>;
|
|
143
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
144
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
144
145
|
};
|
|
145
146
|
};
|
|
146
147
|
readonly workspace: {
|
|
147
148
|
readonly user: {
|
|
148
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
149
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
149
150
|
readonly objectName: string;
|
|
150
151
|
readonly _serverName: string;
|
|
151
152
|
readonly serverName: any;
|
|
152
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
153
|
-
getByFilters(query?: import("./types").ApiQueryRequest<User>): import("axios").AxiosRequestConfig
|
|
153
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
154
|
+
getByFilters(query?: import("./types").ApiQueryRequest<User>): import("axios").AxiosRequestConfig;
|
|
154
155
|
create(entity: User): import("axios").AxiosRequestConfig<User>;
|
|
155
156
|
update(entity: User): import("axios").AxiosRequestConfig<User>;
|
|
156
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
157
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
157
158
|
};
|
|
158
159
|
readonly module: {
|
|
159
|
-
createAction(moduleId: string, action: import("./micro").ModuleAction): import("axios").AxiosRequestConfig
|
|
160
|
-
updateAction(moduleId: string, actionName: string, action: import("./micro").ModuleAction): import("axios").AxiosRequestConfig
|
|
161
|
-
deleteAction(moduleId: string, actionName: string): import("axios").AxiosRequestConfig
|
|
160
|
+
createAction(moduleId: string, action: import("./micro").ModuleAction): import("axios").AxiosRequestConfig;
|
|
161
|
+
updateAction(moduleId: string, actionName: string, action: import("./micro").ModuleAction): import("axios").AxiosRequestConfig;
|
|
162
|
+
deleteAction(moduleId: string, actionName: string): import("axios").AxiosRequestConfig;
|
|
162
163
|
readonly objectName: string;
|
|
163
164
|
readonly _serverName: string;
|
|
164
165
|
readonly serverName: any;
|
|
165
|
-
getAll(): import("axios").AxiosRequestConfig
|
|
166
|
-
getById(entityId: string): import("axios").AxiosRequestConfig
|
|
167
|
-
getByFilters(query?: import("./types").ApiQueryRequest<Module>): import("axios").AxiosRequestConfig
|
|
166
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
167
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
168
|
+
getByFilters(query?: import("./types").ApiQueryRequest<Module>): import("axios").AxiosRequestConfig;
|
|
168
169
|
create(entity: Module): import("axios").AxiosRequestConfig<Module>;
|
|
169
170
|
update(entity: Module): import("axios").AxiosRequestConfig<Module>;
|
|
170
171
|
upsert(entity: Module): import("axios").AxiosRequestConfig<Module>;
|
|
171
172
|
createBulk(entities: unknown[]): import("axios").AxiosRequestConfig<unknown[]>;
|
|
172
173
|
updateBulk(entities: unknown[]): import("axios").AxiosRequestConfig<unknown[]>;
|
|
173
174
|
upsertBulk(entities: unknown[]): import("axios").AxiosRequestConfig<unknown[]>;
|
|
174
|
-
deleteById(entityId: string): import("axios").AxiosRequestConfig
|
|
175
|
-
deleteByIds(entityIds: string
|
|
175
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
176
|
+
deleteByIds(entityIds: Array<string>): import("axios").AxiosRequestConfig;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
readonly blueprint: {
|
|
180
|
+
readonly blueprint: {
|
|
181
|
+
getAll(): import("axios").AxiosRequestConfig;
|
|
182
|
+
readonly objectName: string;
|
|
183
|
+
readonly _serverName: string;
|
|
184
|
+
readonly serverName: any;
|
|
185
|
+
getById(entityId: string): import("axios").AxiosRequestConfig;
|
|
186
|
+
create(entity: Flow): import("axios").AxiosRequestConfig<Flow>;
|
|
187
|
+
update(entity: Flow): import("axios").AxiosRequestConfig<Flow>;
|
|
188
|
+
deleteById(entityId: string): import("axios").AxiosRequestConfig;
|
|
176
189
|
};
|
|
177
190
|
};
|
|
178
191
|
};
|
package/dist/Api.js
CHANGED
|
@@ -42,6 +42,10 @@ exports.RawApi = {
|
|
|
42
42
|
module: new (class extends (0, ts_mixer_1.Mixin)(micro_1.ModuleApi, (0, ts_mixer_1.Mixin)(features_1.GetAll, features_1.GetById, (features_1.GetByFilters)), (0, ts_mixer_1.Mixin)((features_1.Create), (features_1.Update), (features_1.Upsert)), features_1.CreateBulk, features_1.UpdateBulk, features_1.UpsertBulk, features_1.DeleteById, features_1.DeleteByIds) {
|
|
43
43
|
})('workspaceUrl', 'module'),
|
|
44
44
|
},
|
|
45
|
+
blueprint: {
|
|
46
|
+
blueprint: new (class extends (0, ts_mixer_1.Mixin)(features_1.GetAll, features_1.GetById, (features_1.Create), (features_1.Update), features_1.DeleteById) {
|
|
47
|
+
})('flowUrl', 'flow'),
|
|
48
|
+
},
|
|
45
49
|
};
|
|
46
50
|
exports.Api = exports.RawApi;
|
|
47
51
|
//# sourceMappingURL=Api.js.map
|
package/dist/Api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../src/Api.ts"],"names":[],"mappings":";;;AAAA,mCAciB;AACjB,yCAYoB;AAEpB,uCAA+B;AAC/B,kDAA6C;
|
|
1
|
+
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../src/Api.ts"],"names":[],"mappings":";;;AAAA,mCAciB;AACjB,yCAYoB;AAEpB,uCAA+B;AAC/B,kDAA6C;AAWhC,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE;QACJ,IAAI,EAAE,IAAI,iBAAO,EAAE;KACpB;IAED,IAAI,EAAE;QACJ,SAAS,EAAE,IAA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K,EAC5B,iBAAM,EAAE,kBAAO,EAAE,CAAA,uBAAkB,CAAA,EACnC,CAAA,iBAAY,CAAA,EACZ,CAAA,iBAAY,CAAA,EACZ,qBAAU,CAAC;SAAG,CACf,CAAC,cAAc,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,IAAI,CAAC,KAAM,SAAQ,IAAA,gBAAK,EAC9B,iBAAS,EACT,IAAA,gBAAK,EAAC,iBAAM,EAAE,kBAAO,EAAE,CAAA,uBAAoB,CAAA,CAAC,EAC5C,IAAA,gBAAK,EAAC,CAAA,iBAAc,CAAA,EAAE,CAAA,iBAAc,CAAA,EAAE,CAAA,iBAAc,CAAA,CAAC,EACrD,qBAAU,EAAE,qBAAU,EAAE,qBAAU,EAAE,qBAAU,EAAE,sBAAW,CAC5D;SAAG,CAAC,CAAC,cAAc,EAAE,QAAQ,CAAC;KAChC;IAED,SAAS,EAAE;QACT,SAAS,EAAE,IAAI,CAAC,KAAM,SAAQ,IAAA,gBAAK,EAC3B,iBAAM,EAAE,kBAAO,EACf,CAAA,iBAAY,CAAA,EACZ,CAAA,iBAAY,CAAA,EACZ,qBAAU,CAAC;SAAG,CACrB,CAAC,SAAS,EAAE,MAAM,CAAC;KACrB;CACO,CAAC;AAEE,QAAA,GAAG,GAAG,cAAkB,CAAC"}
|
package/dist/ApiConfigs.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { EventBus } from "@buildery/event-bus";
|
|
2
2
|
export declare class ApiConfigs {
|
|
3
3
|
static readonly api: {
|
|
4
|
-
workspaceUrl: string;
|
|
5
|
-
initUrl: string;
|
|
6
|
-
queryUrl: string;
|
|
7
|
-
authUrl: string;
|
|
8
|
-
securityUrl: string;
|
|
4
|
+
workspaceUrl: undefined | string;
|
|
5
|
+
initUrl: undefined | string;
|
|
6
|
+
queryUrl: undefined | string;
|
|
7
|
+
authUrl: undefined | string;
|
|
8
|
+
securityUrl: undefined | string;
|
|
9
|
+
flowUrl: undefined | string;
|
|
9
10
|
};
|
|
10
11
|
static readonly event: {
|
|
11
|
-
eventBus: EventBus;
|
|
12
|
+
eventBus: null | EventBus;
|
|
12
13
|
};
|
|
13
14
|
}
|
package/dist/ApiConfigs.js
CHANGED
package/dist/ApiConfigs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiConfigs.js","sourceRoot":"","sources":["../src/ApiConfigs.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;;AAAvB,
|
|
1
|
+
{"version":3,"file":"ApiConfigs.js","sourceRoot":"","sources":["../src/ApiConfigs.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;;AAAvB,gCAaC;AAZwB,cAAG,GAAG;IAC3B,YAAY,EAAE,SAA+B;IAC7C,OAAO,EAAE,SAA+B;IACxC,QAAQ,EAAE,SAA+B;IACzC,OAAO,EAAE,SAA+B;IACxC,WAAW,EAAE,SAA+B;IAC5C,OAAO,EAAE,SAA+B;CACzC,CAAA;AAEsB,gBAAK,GAAG;IAC7B,QAAQ,EAAE,IAAuB;CAClC,CAAA"}
|
|
@@ -2,5 +2,5 @@ import { Constructor } from "../types";
|
|
|
2
2
|
export declare function useSingleton(): {
|
|
3
3
|
instanceByDefinition: Map<any, any>;
|
|
4
4
|
getInstanceByDefinition: <T extends Constructor<any>>(definition: T, ...params: ConstructorParameters<T>) => InstanceType<T>;
|
|
5
|
-
getInstanceByKey: <
|
|
5
|
+
getInstanceByKey: <T extends Constructor<any>>(key: any, definition: T, ...params: ConstructorParameters<T>) => InstanceType<T>;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useSingleton =
|
|
3
|
+
exports.useSingleton = useSingleton;
|
|
4
4
|
function useSingleton() {
|
|
5
5
|
const instanceByDefinition = new Map();
|
|
6
6
|
const instanceByKey = new Map();
|
|
@@ -26,5 +26,4 @@ function useSingleton() {
|
|
|
26
26
|
getInstanceByKey
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
exports.useSingleton = useSingleton;
|
|
30
29
|
//# sourceMappingURL=useSingleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSingleton.js","sourceRoot":"","sources":["../../src/compose/useSingleton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSingleton.js","sourceRoot":"","sources":["../../src/compose/useSingleton.ts"],"names":[],"mappings":";;AAEA,oCAgCC;AAhCD,SAAgB,YAAY;IAE1B,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAE,CAAC;IAEvC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;IAEhC,SAAS,uBAAuB,CAA6B,UAAa,EAAE,GAAG,MAAgC;;QAC7G,IAAI,CAAC,UAAU;YAAE,OAAO;QAExB,IAAI,QAAQ,GAAG,MAAA,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,mCAAI,IAAI,UAAU,CAAC,GAAG,MAAM,CAAC,CAAC;QAEjF,oBAAoB,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE/C,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,SAAS,gBAAgB,CAA6B,GAAQ,EAAE,UAAa,EAAE,GAAG,MAAgC;;QAChH,IAAI,CAAC,UAAU;YAAE,OAAO;QAExB,IAAI,QAAQ,GAAG,MAAA,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,mCAAI,IAAI,UAAU,CAAC,GAAG,MAAM,CAAC,CAAC;QAEnE,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAEjC,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,OAAO;QACL,oBAAoB;QACpB,uBAAuB;QACvB,gBAAgB;KACjB,CAAA;AAEH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractApi.js","sourceRoot":"","sources":["../../../src/features/api/AbstractApi.ts"],"names":[],"mappings":";;;AAAA,mDAA2C;AAC3C,iDAA4C;AAE5C,MAAsB,WAAW;IAI/B,IAAW,UAAU;QACnB,OAAO,uBAAU,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,YAAsB,UAAuC;QAC3D,IAAA,mBAAQ,EAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"AbstractApi.js","sourceRoot":"","sources":["../../../src/features/api/AbstractApi.ts"],"names":[],"mappings":";;;AAAA,mDAA2C;AAC3C,iDAA4C;AAE5C,MAAsB,WAAW;IAI/B,IAAW,UAAU;QACnB,OAAO,uBAAU,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,YAAsB,UAAuC;QAC3D,IAAA,mBAAQ,EAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,gBAAgB,CAAC,iCAAiC,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;CACF;AAjBD,kCAiBC;AAED,MAAM,gBAAiB,SAAQ,KAAK;CAAG"}
|
|
@@ -7,8 +7,10 @@ const AuthService_1 = require("./AuthService");
|
|
|
7
7
|
class AuthAxiosService {
|
|
8
8
|
static getAxiosInstance() {
|
|
9
9
|
const instance = axios_1.default.create();
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
if (typeof window !== "undefined") {
|
|
11
|
+
instance.interceptors.request.use(AuthAxiosService.setTokenHeader, error => Promise.reject(error));
|
|
12
|
+
instance.interceptors.response.use(response => response, AuthAxiosService.refreshTokens);
|
|
13
|
+
}
|
|
12
14
|
return instance;
|
|
13
15
|
}
|
|
14
16
|
static setTokenHeader(config) {
|
|
@@ -19,7 +21,8 @@ class AuthAxiosService {
|
|
|
19
21
|
return config;
|
|
20
22
|
}
|
|
21
23
|
static async refreshTokens(error) {
|
|
22
|
-
|
|
24
|
+
var _a;
|
|
25
|
+
if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) !== 401)
|
|
23
26
|
return Promise.reject(error);
|
|
24
27
|
await AuthService_1.AuthService.refresh();
|
|
25
28
|
if (!AuthTokensService_1.AuthTokensService.isTokensExists()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthAxiosService.js","sourceRoot":"","sources":["../../../../src/features/auth/services/AuthAxiosService.ts"],"names":[],"mappings":";;;AAAA,iCAAwD;AACxD,2DAAsD;AACtD,+CAA0C;AAE1C,MAAa,gBAAgB;IAC1B,MAAM,CAAC,gBAAgB;QACtB,MAAM,QAAQ,GAAG,eAAK,CAAC,MAAM,EAAE,CAAC;QAEhC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthAxiosService.js","sourceRoot":"","sources":["../../../../src/features/auth/services/AuthAxiosService.ts"],"names":[],"mappings":";;;AAAA,iCAAwD;AACxD,2DAAsD;AACtD,+CAA0C;AAE1C,MAAa,gBAAgB;IAC1B,MAAM,CAAC,gBAAgB;QACtB,MAAM,QAAQ,GAAG,eAAK,CAAC,MAAM,EAAE,CAAC;QAEhC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAChC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACnG,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAC7F,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,MAAkC;QACtD,MAAM,WAAW,GAAG,qCAAiB,CAAC,cAAc,EAAE,CAAC;QAEvD,IAAI,CAAC,WAAW;YAAE,OAAO,MAAM,CAAC;QAEhC,MAAM,CAAC,OAAO,CAAC,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAErE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,KAAU;;QACnC,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG;YAAE,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEjE,MAAM,yBAAW,CAAC,OAAO,EAAE,CAAC;QAE5B,IAAI,CAAC,qCAAiB,CAAC,cAAc,EAAE,EAAE,CAAC;YACxC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC;YAEpC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAA,eAAK,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,gBAAgB;QACpB,MAAM,QAAQ,GAAG,uBAAuB,CAAC;QACzC,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAEzC,MAAM,GAAG,GAAG,GAAG,QAAQ,aAAa,WAAW,EAAE,CAAC;QAElD,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;CAEF;AA7CD,4CA6CC"}
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthService = void 0;
|
|
4
4
|
const AuthTokensService_1 = require("./AuthTokensService");
|
|
5
|
-
const AuthApi_1 = require("../../../micro/auth/AuthApi");
|
|
6
5
|
class AuthService {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.authApi = new AuthApi_1.AuthApi();
|
|
9
|
-
}
|
|
10
6
|
static async signInByCode(code) {
|
|
11
7
|
if (!code)
|
|
12
8
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthService.js","sourceRoot":"","sources":["../../../../src/features/auth/services/AuthService.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;
|
|
1
|
+
{"version":3,"file":"AuthService.js","sourceRoot":"","sources":["../../../../src/features/auth/services/AuthService.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAGtD,MAAa,WAAW;IAKtB,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAY;QACpC,IAAI,CAAC,IAAI;YAAE,OAAO;QAGlB,MAAM,MAAM,GAAG,IAAI,CAAA;QAEnB,OAAO,qCAAiB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAO;QAClB,MAAM,YAAY,GAAG,qCAAiB,CAAC,eAAe,EAAE,CAAC;QAEzD,IAAI,CAAC,YAAY;YAAE,OAAO;QAG1B,MAAM,MAAM,GAAG,IAAI,CAAA;QAEnB,qCAAiB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAEpC,OAAO,MAAM,CAAC;IAChB,CAAC;CAEF;AA3BD,kCA2BC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios";
|
|
2
|
+
import { CalloutMiddleware, CalloutState } from "./types";
|
|
3
|
+
export declare class Callout<Params extends any[], ResponseType> {
|
|
4
|
+
private readonly _axiosInstance;
|
|
5
|
+
private readonly _configFunction;
|
|
6
|
+
private readonly _state;
|
|
7
|
+
private readonly _middlewares;
|
|
8
|
+
private _message;
|
|
9
|
+
get getState(): CalloutState;
|
|
10
|
+
get isLoading(): boolean;
|
|
11
|
+
get getMessage(): string;
|
|
12
|
+
get getConfigFunction(): (...params: Params) => AxiosRequestConfig;
|
|
13
|
+
constructor(configFunction: () => AxiosRequestConfig, axiosInstance?: AxiosInstance | null);
|
|
14
|
+
setMessage(message: string | undefined): this;
|
|
15
|
+
invoke(...params: Params): Promise<AxiosResponse<ResponseType>>;
|
|
16
|
+
addMiddleware(...middleware: Array<CalloutMiddleware<Params, ResponseType>>): void;
|
|
17
|
+
removeMiddleware(middleware: CalloutMiddleware<Params, ResponseType>): void;
|
|
18
|
+
private _getAxiosInstance;
|
|
19
|
+
private _invokeStart;
|
|
20
|
+
private _invokeEnd;
|
|
21
|
+
private _invokeMiddlewares;
|
|
22
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Callout = void 0;
|
|
4
|
+
const axios_1 = require("axios");
|
|
5
|
+
class Callout {
|
|
6
|
+
get getState() { return this._state; }
|
|
7
|
+
get isLoading() { return this._state.isLoading; }
|
|
8
|
+
get getMessage() { return this._state.message; }
|
|
9
|
+
get getConfigFunction() { return this._configFunction; }
|
|
10
|
+
constructor(configFunction, axiosInstance = null) {
|
|
11
|
+
this._axiosInstance = axios_1.default;
|
|
12
|
+
this._state = { isLoading: false, message: null };
|
|
13
|
+
this._middlewares = [];
|
|
14
|
+
this._message = 'Loading...';
|
|
15
|
+
this._configFunction = configFunction;
|
|
16
|
+
this._axiosInstance = axiosInstance !== null && axiosInstance !== void 0 ? axiosInstance : this._getAxiosInstance();
|
|
17
|
+
}
|
|
18
|
+
setMessage(message) {
|
|
19
|
+
this._message = message;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
async invoke(...params) {
|
|
23
|
+
this._invokeStart();
|
|
24
|
+
let response;
|
|
25
|
+
let error;
|
|
26
|
+
const config = await this._configFunction(...params);
|
|
27
|
+
try {
|
|
28
|
+
response = await this._axiosInstance(config);
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
response = e === null || e === void 0 ? void 0 : e.response;
|
|
32
|
+
error = e;
|
|
33
|
+
}
|
|
34
|
+
await this._invokeMiddlewares(response, params, error);
|
|
35
|
+
this._invokeEnd();
|
|
36
|
+
return response;
|
|
37
|
+
}
|
|
38
|
+
addMiddleware(...middleware) {
|
|
39
|
+
this._middlewares.push(...middleware);
|
|
40
|
+
}
|
|
41
|
+
removeMiddleware(middleware) {
|
|
42
|
+
const index = this._middlewares.findIndex(m => m === middleware);
|
|
43
|
+
if (index === -1)
|
|
44
|
+
return;
|
|
45
|
+
this._middlewares.splice(index, 1);
|
|
46
|
+
}
|
|
47
|
+
_getAxiosInstance() {
|
|
48
|
+
return axios_1.default.create();
|
|
49
|
+
}
|
|
50
|
+
_invokeStart() {
|
|
51
|
+
this._state.isLoading = true;
|
|
52
|
+
this._state.message = this._message;
|
|
53
|
+
}
|
|
54
|
+
_invokeEnd() {
|
|
55
|
+
this._state.isLoading = false;
|
|
56
|
+
this._state.message = null;
|
|
57
|
+
}
|
|
58
|
+
async _invokeMiddlewares(response, params, error) {
|
|
59
|
+
let chain = {};
|
|
60
|
+
for (const middleware of this._middlewares) {
|
|
61
|
+
chain = await middleware({ response, error, params, chain, callout: this });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Callout = Callout;
|
|
66
|
+
//# sourceMappingURL=Callout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Callout.js","sourceRoot":"","sources":["../../../src/features/callout/Callout.ts"],"names":[],"mappings":";;;AAAA,iCAA0F;AAG1F,MAAa,OAAO;IAahB,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtC,IAAI,SAAS,KAAc,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1D,IAAI,UAAU,KAAK,OAAO,IAAI,CAAC,M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AI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IAC1C,CAAC;IAEM,gBAAgB,CAAC,UAAmD;QACvE,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC;QAEjE,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,OAAO;QAEzB,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IAEO,iBAAiB;QACrB,OAAO,eAAK,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC;IAEO,YAAY;QAChB,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;IACxC,CAAC;IAEO,UAAU;QACd,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IAC/B,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAC,QAAuB,EAAE,MAAkB,EAAE,KAAkB;QAC5F,IAAI,KAAK,GAAG,EAAE,CAAC;QAEf,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACzC,KAAK,GAAG,MAAM,UAAU,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;CACJ;AAxFD,0BAwFC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalloutMiddlewareService = void 0;
|
|
4
|
+
const services_1 = require("../../services");
|
|
5
|
+
class CalloutMiddlewareService {
|
|
6
|
+
static isMeetConditions(response, conditions) {
|
|
7
|
+
if (!conditions)
|
|
8
|
+
return true;
|
|
9
|
+
const isHTTPIncludeMeet = !conditions.forHTTPCodes || services_1.ResponseService.isInHttpCodeRange(response, conditions.forHTTPCodes);
|
|
10
|
+
const isHTTPExcludeMeet = !conditions.excludeHTTPCodes || !services_1.ResponseService.isInHttpCodeRange(response, conditions.excludeHTTPCodes);
|
|
11
|
+
const isServerIncludeMeet = !conditions.forServerCodes || services_1.ResponseService.isInServerCodeRange(response, conditions.forServerCodes);
|
|
12
|
+
const isServerExcludeMeet = !conditions.excludeServerCodes || !services_1.ResponseService.isInServerCodeRange(response, conditions.excludeServerCodes);
|
|
13
|
+
return isHTTPIncludeMeet && isHTTPExcludeMeet && isServerIncludeMeet && isServerExcludeMeet;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.CalloutMiddlewareService = CalloutMiddlewareService;
|
|
17
|
+
//# sourceMappingURL=CalloutMiddlewareService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutMiddlewareService.js","sourceRoot":"","sources":["../../../src/features/callout/CalloutMiddlewareService.ts"],"names":[],"mappings":";;;AAEA,6CAA+C;AAE/C,MAAa,wBAAwB;IACjC,MAAM,CAAC,gBAAgB,CAAC,QAAuB,EAAE,UAAuC;QACpF,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,MAAM,iBAAiB,GAAG,CAAC,UAAU,CAAC,YAAY,IAAI,0BAAe,CAAC,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;QAC3H,MAAM,iBAAiB,GAAG,CAAC,UAAU,CAAC,gBAAgB,IAAI,CAAC,0BAAe,CAAC,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;QAEpI,MAAM,mBAAmB,GAAG,CAAC,UAAU,CAAC,cAAc,IAAI,0BAAe,CAAC,mBAAmB,CAAC,QAAQ,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;QACnI,MAAM,mBAAmB,GAAG,CAAC,UAAU,CAAC,kBAAkB,IAAI,CAAC,0BAAe,CAAC,mBAAmB,CAAC,QAAQ,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;QAE5I,OAAO,iBAAiB,IAAI,iBAAiB,IAAI,mBAAmB,IAAI,mBAAmB,CAAC;IAChG,CAAC;CAEJ;AAbD,4DAaC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalloutMiddlewares = void 0;
|
|
4
|
+
const CalloutMiddlewareService_1 = require("./CalloutMiddlewareService");
|
|
5
|
+
class CalloutMiddlewares {
|
|
6
|
+
}
|
|
7
|
+
exports.CalloutMiddlewares = CalloutMiddlewares;
|
|
8
|
+
CalloutMiddlewares.throwException = (message, conditions) => ({ callout, response, error }) => {
|
|
9
|
+
if (!CalloutMiddlewareService_1.CalloutMiddlewareService.isMeetConditions(response, conditions))
|
|
10
|
+
return;
|
|
11
|
+
callout.getState.isLoading = false;
|
|
12
|
+
callout.getState.message = undefined;
|
|
13
|
+
throw new Error(message !== null && message !== void 0 ? message : `${error === null || error === void 0 ? void 0 : error.name}: ${error === null || error === void 0 ? void 0 : error.message}`);
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=CalloutMiddlewares.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutMiddlewares.js","sourceRoot":"","sources":["../../../src/features/callout/CalloutMiddlewares.ts"],"names":[],"mappings":";;;AACA,yEAAoE;AAEpE,MAAa,kBAAkB;;AAA/B,gDASC;AARU,iCAAc,GAAG,CAAC,OAAgB,EAAE,UAAwC,EAA+B,EAAE,CAAC,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAC,EAAE,EAAE;IAChJ,IAAI,CAAC,mDAAwB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC;QAAE,OAAO;IAE7E,OAAO,CAAC,QAAQ,CAAC,SAAS,GAAG,KAAK,CAAC;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC;IAErC,MAAM,IAAI,KAAK,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,KAAK,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,EAAE,CAAC,CAAC;AACpE,CAAC,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ApiCalloutMiddleware } from "./types";
|
|
2
|
+
import type { AbstractCRUDApi } from "../crud";
|
|
3
|
+
export declare const Calloutable: (...apiMiddlewares: Array<ApiCalloutMiddleware<AbstractCRUDApi>>) => (target: any, method: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Calloutable = void 0;
|
|
4
|
+
const auth_1 = require("../auth");
|
|
5
|
+
const Callout_1 = require("./Callout");
|
|
6
|
+
const Calloutable = (...apiMiddlewares) => (target, method, descriptor) => {
|
|
7
|
+
target[`${method}Callout`] = function () {
|
|
8
|
+
const callout = new Callout_1.Callout(descriptor.value.bind(this), auth_1.AuthAxiosService.getAxiosInstance());
|
|
9
|
+
apiMiddlewares === null || apiMiddlewares === void 0 ? void 0 : apiMiddlewares.map(apiMiddleware => {
|
|
10
|
+
const calloutMiddleware = apiMiddleware === null || apiMiddleware === void 0 ? void 0 : apiMiddleware(this);
|
|
11
|
+
if (!calloutMiddleware)
|
|
12
|
+
return;
|
|
13
|
+
callout.addMiddleware(calloutMiddleware);
|
|
14
|
+
});
|
|
15
|
+
return callout;
|
|
16
|
+
};
|
|
17
|
+
return descriptor;
|
|
18
|
+
};
|
|
19
|
+
exports.Calloutable = Calloutable;
|
|
20
|
+
//# sourceMappingURL=Calloutable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calloutable.js","sourceRoot":"","sources":["../../../src/features/callout/Calloutable.ts"],"names":[],"mappings":";;;AACA,kCAAyC;AAEzC,uCAAkC;AAE3B,MAAM,WAAW,GAAG,CAAC,GAAG,cAA4D,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,MAAc,EAAE,UAA8B,EAAE,EAAE;IAC9J,MAAM,CAAC,GAAG,MAAM,SAAS,CAAC,GAAG;QAE3B,MAAM,OAAO,GAAG,IAAI,iBAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,uBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAE9F,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,GAAG,CAAC,aAAa,CAAC,EAAE;YAClC,MAAM,iBAAiB,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,IAAI,CAAC,CAAC;YAEhD,IAAI,CAAC,iBAAiB;gBAAE,OAAO;YAE/B,OAAO,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAA;AAjBY,QAAA,WAAW,eAiBvB"}
|