@iyio/common
Advanced tools
Comparing version 0.0.22 to 0.0.23
{ | ||
"name": "@iyio/common", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"type": "commonjs", | ||
@@ -10,2 +10,3 @@ "main": "./src/index.js", | ||
"rxjs": "^7.5.7", | ||
"date-fns": "^2.29.3", | ||
"uuid": "^9.0.0", | ||
@@ -12,0 +13,0 @@ "tslib": "^2.3.0" |
@@ -8,2 +8,3 @@ export * from './lib/array'; | ||
export * from './lib/CancelToken'; | ||
export * from './lib/client-download'; | ||
export * from './lib/common-lib'; | ||
@@ -34,3 +35,5 @@ export * from './lib/common-types'; | ||
export * from './lib/PromiseSource'; | ||
export * from './lib/query-static-operators'; | ||
export * from './lib/query-types'; | ||
export * from './lib/QueryCtrl'; | ||
export * from './lib/RouterStore'; | ||
@@ -40,2 +43,5 @@ export * from './lib/rxjs-types'; | ||
export * from './lib/scope-types'; | ||
export * from './lib/series-ctrls'; | ||
export * from './lib/series-lib'; | ||
export * from './lib/series-types'; | ||
export * from './lib/Setter'; | ||
@@ -42,0 +48,0 @@ export * from './lib/shared-pointers'; |
@@ -11,2 +11,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./lib/CancelToken"), exports); | ||
tslib_1.__exportStar(require("./lib/client-download"), exports); | ||
tslib_1.__exportStar(require("./lib/common-lib"), exports); | ||
@@ -37,3 +38,5 @@ tslib_1.__exportStar(require("./lib/common-types"), exports); | ||
tslib_1.__exportStar(require("./lib/PromiseSource"), exports); | ||
tslib_1.__exportStar(require("./lib/query-static-operators"), exports); | ||
tslib_1.__exportStar(require("./lib/query-types"), exports); | ||
tslib_1.__exportStar(require("./lib/QueryCtrl"), exports); | ||
tslib_1.__exportStar(require("./lib/RouterStore"), exports); | ||
@@ -43,2 +46,5 @@ tslib_1.__exportStar(require("./lib/rxjs-types"), exports); | ||
tslib_1.__exportStar(require("./lib/scope-types"), exports); | ||
tslib_1.__exportStar(require("./lib/series-ctrls"), exports); | ||
tslib_1.__exportStar(require("./lib/series-lib"), exports); | ||
tslib_1.__exportStar(require("./lib/series-types"), exports); | ||
tslib_1.__exportStar(require("./lib/Setter"), exports); | ||
@@ -45,0 +51,0 @@ tslib_1.__exportStar(require("./lib/shared-pointers"), exports); |
@@ -8,2 +8,3 @@ import { AuthProvider, UserFactoryCallback } from "./auth-types"; | ||
import { JwtProvider } from "./jwt"; | ||
import { QueryCtrl } from "./QueryCtrl"; | ||
import { RouterStore } from "./RouterStore"; | ||
@@ -25,2 +26,4 @@ import { ISqlClient } from "./sql-types"; | ||
export declare const sqlClient: import("./scope-types").ClientTypeDef<ISqlClient>; | ||
export declare const queryCtrlFactory: import("./scope-types").ServiceTypeDef<QueryCtrl<any>>; | ||
export declare const queryRecordStorePathParam: import("./scope-types").ParamTypeDef<string>; | ||
export declare const storeRoot: import("./scope-types").ServiceTypeDef<RouterStore<any>>; | ||
@@ -27,0 +30,0 @@ export declare const StoreProviders: import("./scope-types").ProviderTypeDef<IStore<any> | StoreProvider<any>>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.uiRouterService = exports.UserFactory = exports.AuthProviders = exports.currentBaseUser = exports.authService = exports.StoreProviders = exports.storeRoot = exports.sqlClient = exports.JwtProviders = exports.httpRetryDelayMsParam = exports.httpMaxRetriesParam = exports.httpLogResponsesParam = exports.httpLogRequestsParam = exports.httpBaseUrlPrefixParam = exports.httpBaseUrlMapParam = exports.HttpFetchers = exports.HttpRequestSigners = exports.httpClient = exports.apiBaseUrlParam = void 0; | ||
exports.uiRouterService = exports.UserFactory = exports.AuthProviders = exports.currentBaseUser = exports.authService = exports.StoreProviders = exports.storeRoot = exports.queryRecordStorePathParam = exports.queryCtrlFactory = exports.sqlClient = exports.JwtProviders = exports.httpRetryDelayMsParam = exports.httpMaxRetriesParam = exports.httpLogResponsesParam = exports.httpLogRequestsParam = exports.httpBaseUrlPrefixParam = exports.httpBaseUrlMapParam = exports.HttpFetchers = exports.HttpRequestSigners = exports.httpClient = exports.apiBaseUrlParam = void 0; | ||
const AuthService_1 = require("./AuthService"); | ||
@@ -9,2 +9,3 @@ const BaseUser_1 = require("./BaseUser"); | ||
const HttpDefaultFetcher_1 = require("./HttpDefaultFetcher"); | ||
const QueryCtrl_1 = require("./QueryCtrl"); | ||
const RouterStore_1 = require("./RouterStore"); | ||
@@ -29,2 +30,5 @@ const scope_lib_1 = require("./scope-lib"); | ||
exports.sqlClient = (0, scope_lib_1.defineClient)('sqlClient'); | ||
// QueryCtrl | ||
exports.queryCtrlFactory = (0, scope_lib_1.defineServiceFactory)('queryCtrlFactory', scope => QueryCtrl_1.QueryCtrl.fromScope(scope)); | ||
exports.queryRecordStorePathParam = (0, scope_lib_1.defineStringParam)('queryRecordStorePath', QueryCtrl_1.defaultQueryRecordStorePath); | ||
// Store | ||
@@ -31,0 +35,0 @@ exports.storeRoot = (0, scope_lib_1.defineService)("storeRoot", scope => new RouterStore_1.RouterStore(scope)); |
@@ -178,1 +178,10 @@ export interface StaticQueryOperator<T = any> { | ||
} | ||
/** | ||
* A query object stored in a database | ||
*/ | ||
export interface BaseQueryRecord { | ||
id: string; | ||
query: Query; | ||
} | ||
export declare const isBaseQueryRecord: (value: any) => value is BaseQueryRecord; | ||
export declare type QueryOptions<T = any> = string | BaseQueryRecord | Query | QueryWithData<T>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isQueryCondition = exports.allQueryConditionOps = exports.isQueryGroupCondition = exports.allQueryGroupConditionOps = exports.isQueryWithData = exports.isQuery = void 0; | ||
exports.isBaseQueryRecord = exports.isQueryCondition = exports.allQueryConditionOps = exports.isQueryGroupCondition = exports.allQueryGroupConditionOps = exports.isQueryWithData = exports.isQuery = void 0; | ||
const isQuery = (value) => { | ||
const tableType = typeof (value === null || value === void 0 ? void 0 : value.table); | ||
return (tableType === 'string' || tableType === 'object') && !Array.isArray(value === null || value === void 0 ? void 0 : value.table); | ||
return (tableType === 'string' || tableType === 'object' || Array.isArray(value === null || value === void 0 ? void 0 : value.columns)) && !Array.isArray(value === null || value === void 0 ? void 0 : value.table); | ||
}; | ||
@@ -31,2 +31,10 @@ exports.isQuery = isQuery; | ||
exports.isQueryCondition = isQueryCondition; | ||
const isBaseQueryRecord = (value) => { | ||
if (!value) { | ||
return false; | ||
} | ||
const v = value; | ||
return (typeof v.id === 'string') && (0, exports.isQuery)(v.query); | ||
}; | ||
exports.isBaseQueryRecord = isBaseQueryRecord; | ||
//# sourceMappingURL=query-types.js.map |
@@ -114,6 +114,8 @@ import { CancelToken } from "./CancelToken"; | ||
export declare const defineProvider: <T>(name: string, defaultProvider?: TypeProvider<T> | TypeProviderOptions<T> | undefined) => ProviderTypeDef<T>; | ||
export declare const defineFactory: <T extends (...args: any[]) => any>(name: string, defaultFactory?: T | undefined) => FactoryTypeDef<T>; | ||
export declare const defineFactory: <T extends AnyFunction>(name: string, defaultFactory?: T | undefined) => FactoryTypeDef<T>; | ||
export declare const defineCallableType: <T>(name: string, defaultProvider?: TypeProvider<T> | TypeProviderOptions<T> | undefined) => CallableTypeDef<T>; | ||
export declare const defineService: <T>(name: string, defaultProvider?: TypeProvider<T> | TypeProviderOptions<T> | undefined) => ServiceTypeDef<T>; | ||
export declare const defineClient: <T>(name: string, defaultProvider?: TypeProvider<T> | TypeProviderOptions<T> | undefined) => ClientTypeDef<T>; | ||
export declare const defineServiceFactory: <T>(name: string, provider: TypeProvider<T>) => ServiceTypeDef<T>; | ||
export declare const defineClientFactory: <T>(name: string, provider: TypeProvider<T>) => ClientTypeDef<T>; | ||
interface defineObservableOverloads { | ||
@@ -120,0 +122,0 @@ <T>(name: string, defaultValue: TypeProvider<T>): ObservableTypeDef<T>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.requireParam = exports.getParam = exports.defineBoolParam = exports.defineNumberParam = exports.defineStringParam = exports.defineParam = exports.defineReadonlyObservable = exports.defineObservable = exports.defineClient = exports.defineService = exports.defineCallableType = exports.defineFactory = exports.defineProvider = exports.defineType = exports.initRootScope = exports.rootScope = exports.createScope = exports.isTypeDef = exports.ScopeModulePriorities = void 0; | ||
exports.requireParam = exports.getParam = exports.defineBoolParam = exports.defineNumberParam = exports.defineStringParam = exports.defineParam = exports.defineReadonlyObservable = exports.defineObservable = exports.defineClientFactory = exports.defineServiceFactory = exports.defineClient = exports.defineService = exports.defineCallableType = exports.defineFactory = exports.defineProvider = exports.defineType = exports.initRootScope = exports.rootScope = exports.createScope = exports.isTypeDef = exports.ScopeModulePriorities = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -643,2 +643,6 @@ const rxjs_1 = require("rxjs"); | ||
exports.defineClient = defineClient; | ||
const defineServiceFactory = (name, provider) => exports.rootScope.defineCallableType(name, { provider, isFactory: true }); | ||
exports.defineServiceFactory = defineServiceFactory; | ||
const defineClientFactory = (name, provider) => exports.rootScope.defineCallableType(name, { provider, isFactory: true }); | ||
exports.defineClientFactory = defineClientFactory; | ||
exports.defineObservable = ((name, defaultValue) => (exports.rootScope.defineObservable(name, defaultValue))); | ||
@@ -645,0 +649,0 @@ exports.defineReadonlyObservable = ((name, setter, defaultValue) => (exports.rootScope.defineReadonlyObservable(name, setter, defaultValue))); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
450331
209
7350
4