@stemy/ngx-utils 19.6.7 → 19.6.9
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/fesm2022/stemy-ngx-utils.mjs +41 -18
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +11 -1
- package/ngx-utils/ngx-utils.imports.d.ts +2 -2
- package/ngx-utils/services/open-api.service.d.ts +2 -1
- package/ngx-utils/tokens.d.ts +2 -1
- package/ngx-utils/utils/cached-factory.d.ts +4 -2
- package/package.json +1 -1
- package/public_api.d.ts +3 -3
|
@@ -484,6 +484,7 @@ const ROOT_ELEMENT = new InjectionToken("app-root-element");
|
|
|
484
484
|
const RESIZE_DELAY = new InjectionToken("resize-event-delay");
|
|
485
485
|
const RESIZE_STRATEGY = new InjectionToken("resize-event-strategy");
|
|
486
486
|
const ERROR_HANDLER = new InjectionToken("error-handler-callback");
|
|
487
|
+
const STATIC_SCHEMAS = new InjectionToken("static-openapi-schemas");
|
|
487
488
|
|
|
488
489
|
class AjaxRequestHandler {
|
|
489
490
|
static { this.isOverridden = false; }
|
|
@@ -1054,6 +1055,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1054
1055
|
}] }] });
|
|
1055
1056
|
|
|
1056
1057
|
const CACHED_TOKEN = new InjectionToken("cached-factory-token");
|
|
1058
|
+
function createTypedProvider(provide, p, multi = false) {
|
|
1059
|
+
if (("useFactory" in p && "deps" in p) || "useValue" in p || "useExisting" in p || "useClass" in p) {
|
|
1060
|
+
return {
|
|
1061
|
+
provide,
|
|
1062
|
+
multi,
|
|
1063
|
+
...p
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
if ("useToken" in p) {
|
|
1067
|
+
return {
|
|
1068
|
+
provide,
|
|
1069
|
+
multi,
|
|
1070
|
+
useFactory: (i) => i,
|
|
1071
|
+
deps: [p.useToken]
|
|
1072
|
+
};
|
|
1073
|
+
}
|
|
1074
|
+
return {
|
|
1075
|
+
provide,
|
|
1076
|
+
multi,
|
|
1077
|
+
useClass: p
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1057
1080
|
function cachedFactory(providers) {
|
|
1058
1081
|
let cached = null;
|
|
1059
1082
|
return (injector) => {
|
|
@@ -1061,20 +1084,7 @@ function cachedFactory(providers) {
|
|
|
1061
1084
|
return cached;
|
|
1062
1085
|
}
|
|
1063
1086
|
const subInjector = Injector.create({
|
|
1064
|
-
providers: providers.map(p =>
|
|
1065
|
-
if (("useFactory" in p && "deps" in p) || "useValue" in p) {
|
|
1066
|
-
return {
|
|
1067
|
-
provide: CACHED_TOKEN,
|
|
1068
|
-
multi: true,
|
|
1069
|
-
...p
|
|
1070
|
-
};
|
|
1071
|
-
}
|
|
1072
|
-
return {
|
|
1073
|
-
provide: CACHED_TOKEN,
|
|
1074
|
-
multi: true,
|
|
1075
|
-
useClass: p
|
|
1076
|
-
};
|
|
1077
|
-
}),
|
|
1087
|
+
providers: providers.map(p => createTypedProvider(CACHED_TOKEN, p, true)),
|
|
1078
1088
|
parent: injector
|
|
1079
1089
|
});
|
|
1080
1090
|
cached = subInjector.get(CACHED_TOKEN);
|
|
@@ -4053,8 +4063,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4053
4063
|
}] });
|
|
4054
4064
|
|
|
4055
4065
|
class OpenApiService {
|
|
4056
|
-
constructor(api) {
|
|
4066
|
+
constructor(api, staticSchemas) {
|
|
4057
4067
|
this.api = api;
|
|
4068
|
+
this.staticSchemas = staticSchemas;
|
|
4058
4069
|
this.dynamicSchemas = {};
|
|
4059
4070
|
}
|
|
4060
4071
|
isDynamicSchema(value) {
|
|
@@ -4071,7 +4082,12 @@ class OpenApiService {
|
|
|
4071
4082
|
const apiDocs = this.api.get("api-docs", { cache });
|
|
4072
4083
|
if (apiDocs !== this.apiDocs) {
|
|
4073
4084
|
this.apiDocs = apiDocs;
|
|
4074
|
-
this.schemas = apiDocs.then(res =>
|
|
4085
|
+
this.schemas = apiDocs.then(res => {
|
|
4086
|
+
return {
|
|
4087
|
+
...this.extractSchemas({ definitions: this.staticSchemas }),
|
|
4088
|
+
...this.extractSchemas(res)
|
|
4089
|
+
};
|
|
4090
|
+
});
|
|
4075
4091
|
}
|
|
4076
4092
|
return this.schemas;
|
|
4077
4093
|
}
|
|
@@ -4123,7 +4139,7 @@ class OpenApiService {
|
|
|
4123
4139
|
});
|
|
4124
4140
|
return schemas;
|
|
4125
4141
|
}
|
|
4126
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: OpenApiService, deps: [{ token: API_SERVICE }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4142
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: OpenApiService, deps: [{ token: API_SERVICE }, { token: STATIC_SCHEMAS }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4127
4143
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: OpenApiService }); }
|
|
4128
4144
|
}
|
|
4129
4145
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: OpenApiService, decorators: [{
|
|
@@ -4131,6 +4147,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4131
4147
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4132
4148
|
type: Inject,
|
|
4133
4149
|
args: [API_SERVICE]
|
|
4150
|
+
}] }, { type: undefined, decorators: [{
|
|
4151
|
+
type: Inject,
|
|
4152
|
+
args: [STATIC_SCHEMAS]
|
|
4134
4153
|
}] }] });
|
|
4135
4154
|
|
|
4136
4155
|
class BaseToasterService {
|
|
@@ -8855,6 +8874,10 @@ class NgxUtilsModule {
|
|
|
8855
8874
|
provide: SOCKET_IO_PATH,
|
|
8856
8875
|
useValue: (!config ? null : config.socketPath) ?? "socket.io",
|
|
8857
8876
|
},
|
|
8877
|
+
{
|
|
8878
|
+
provide: STATIC_SCHEMAS,
|
|
8879
|
+
useValue: (!config ? null : config.staticSchemas) ?? {},
|
|
8880
|
+
},
|
|
8858
8881
|
{
|
|
8859
8882
|
provide: APP_INITIALIZER,
|
|
8860
8883
|
useFactory: (!config ? null : config.initializeApp) || loadConfig,
|
|
@@ -8937,5 +8960,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
8937
8960
|
* Generated bundle index. Do not edit.
|
|
8938
8961
|
*/
|
|
8939
8962
|
|
|
8940
|
-
export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AsyncMethodTargetDirective, AuthGuard, BASE_CONFIG, BUTTON_TYPE, BackgroundDirective, BaseDialogService, BaseHttpClient, BaseHttpService, BaseToasterService, BtnComponent, BtnDefaultComponent, CONFIG_SERVICE, CacheService, CanvasColor, CanvasUtils, ChipsComponent, ChunkPipe, Circle, CloseBtnComponent, ComponentLoaderDirective, ComponentLoaderService, ConfigService, DIALOG_SERVICE, DateUtils, DragDropEventPlugin, DropListComponent, DropdownBoxComponent, DropdownContentDirective, DropdownDirective, DropdownToggleDirective, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FakeModuleComponent, FileSystemEntry, FileUtils, FilterPipe, FindPipe, ForbiddenZone, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GetValuePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, ICON_MAP, ICON_SERVICE, ICON_TYPE, IConfiguration, IconComponent, IconDefaultComponent, IconDirective, IconService, IncludesPipe, Initializer, InteractiveCanvasComponent, InteractiveCircleComponent, InteractiveItemComponent, InteractiveRectComponent, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, OPTIONS_TOKEN, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, RESIZE_STRATEGY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SocketClient, SocketService, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TabsComponent, TabsItemDirective, TabsTemplateDirective, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UploadComponent, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService, cachedFactory, cancelablePromise, checkTransitions, computedPrevious, cssStyles, cssVariables, getComponentDef, getCssVariables, getRoot, hashCode, impatientPromise, isBrowser, parseSelector, provideEntryComponents, provideWithOptions, selectorMatchesList, switchClass };
|
|
8963
|
+
export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AsyncMethodTargetDirective, AuthGuard, BASE_CONFIG, BUTTON_TYPE, BackgroundDirective, BaseDialogService, BaseHttpClient, BaseHttpService, BaseToasterService, BtnComponent, BtnDefaultComponent, CONFIG_SERVICE, CacheService, CanvasColor, CanvasUtils, ChipsComponent, ChunkPipe, Circle, CloseBtnComponent, ComponentLoaderDirective, ComponentLoaderService, ConfigService, DIALOG_SERVICE, DateUtils, DragDropEventPlugin, DropListComponent, DropdownBoxComponent, DropdownContentDirective, DropdownDirective, DropdownToggleDirective, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FakeModuleComponent, FileSystemEntry, FileUtils, FilterPipe, FindPipe, ForbiddenZone, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GetValuePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, ICON_MAP, ICON_SERVICE, ICON_TYPE, IConfiguration, IconComponent, IconDefaultComponent, IconDirective, IconService, IncludesPipe, Initializer, InteractiveCanvasComponent, InteractiveCircleComponent, InteractiveItemComponent, InteractiveRectComponent, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, OPTIONS_TOKEN, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, RESIZE_STRATEGY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, STATIC_SCHEMAS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SocketClient, SocketService, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TabsComponent, TabsItemDirective, TabsTemplateDirective, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UploadComponent, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService, cachedFactory, cancelablePromise, checkTransitions, computedPrevious, createTypedProvider, cssStyles, cssVariables, getComponentDef, getCssVariables, getRoot, hashCode, impatientPromise, isBrowser, parseSelector, provideEntryComponents, provideWithOptions, selectorMatchesList, switchClass };
|
|
8941
8964
|
//# sourceMappingURL=stemy-ngx-utils.mjs.map
|