orak-util-ts 1.1.5 → 1.1.6
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/README.md +1 -1
- package/dist/orak-util-ts.cjs +1 -1
- package/dist/orak-util-ts.d.cts +10 -10
- package/dist/orak-util-ts.d.ts +10 -10
- package/dist/orak-util-ts.global.js +1 -1
- package/dist/orak-util-ts.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/orak-util-ts.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(t,e)=>{for(var r in e)__defProp(t,r,{get:e[r],enumerable:!0})},__copyProps=(t,e,r,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let s of __getOwnPropNames(e))__hasOwnProp.call(t,s)||s===r||__defProp(t,s,{get:()=>e[s],enumerable:!(i=__getOwnPropDesc(e,s))||i.enumerable});return t},__toESM=(t,e,r)=>(r=null!=t?__create(__getProtoOf(t)):{},__copyProps(!e&&t&&t.__esModule?r:__defProp(r,"default",{value:t,enumerable:!0}),t)),__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),src_exports={};__export(src_exports,{Fdr:()=>Fdr,FiApp:()=>FiApp,FiCol:()=>FiCol,FiConnConfig:()=>FiConnConfig,FiEnv:()=>FiEnv,FiFetchClient:()=>FiFetchClient,FiHttpClient:()=>FiHttpClient,FiKeyEntity:()=>FiKeyEntity,
|
|
1
|
+
"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(t,e)=>{for(var r in e)__defProp(t,r,{get:e[r],enumerable:!0})},__copyProps=(t,e,r,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let s of __getOwnPropNames(e))__hasOwnProp.call(t,s)||s===r||__defProp(t,s,{get:()=>e[s],enumerable:!(i=__getOwnPropDesc(e,s))||i.enumerable});return t},__toESM=(t,e,r)=>(r=null!=t?__create(__getProtoOf(t)):{},__copyProps(!e&&t&&t.__esModule?r:__defProp(r,"default",{value:t,enumerable:!0}),t)),__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),src_exports={};__export(src_exports,{Fdr:()=>Fdr,FiApp:()=>FiApp,FiCol:()=>FiCol,FiConnConfig:()=>FiConnConfig,FiEnv:()=>FiEnv,FiFetchClient:()=>FiFetchClient,FiHttpClient:()=>FiHttpClient,FiKeyEntity:()=>FiKeyEntity,FiLocalStorage:()=>FiLocalStorage,FiLog:()=>FiLog,FiLogger:()=>FiLogger,FiMeta:()=>FiMeta,FiNumber:()=>FiNumber,FiObject:()=>FiObject,FiQuery:()=>FiQuery,FiQueryUtil:()=>FiQueryUtil,FiQugen:()=>FiQugen,FiString:()=>FiString,FicList:()=>FicList,FimFiCol:()=>FimFiCol,FimFiReq:()=>FimFiReq,FimFiRes:()=>FimFiRes,Fkb:()=>Fkb,FkbList:()=>FkbList}),module.exports=__toCommonJS(src_exports);var FiConnConfig=class{},FiQuery=class{},FiQueryUtil=class{},FiQugen=class{},FiNumber=class{static orZero(t){return null==t?0:t}static orMinusOne(t){return null==t?-1:t}},FiString=class{static cropWitDot(t,e){return this.crop(t,e,"..")}static crop(t,e,r=""){return t?t.length>e?t.substring(0,e)+r:t:""}static joinComma(t,e){return t&&0!==t.length?t.map(e).join(", "):""}static orEmpty(t){return null==t?"":t}},FiMeta=class _FiMeta{static create(t){let e=new _FiMeta;return e.fimTxKey=t,e}getTxKeyNtn(){return FiString.orEmpty(this.fimTxKey)}getTxValueNtn(){return FiString.orEmpty(this.fimTxValue)}getLnKeyOrMinusOne(){return FiNumber.orMinusOne(this.fimLnKey)}},FimFiRes=class{static fsBoTknValid(){return FiMeta.create("fsBoTknValid")}static fsBoResult(){return FiMeta.create("fsBoResult")}static fsRefFdr(){return FiMeta.create("fsRefFdr")}static fsRefValue(){return FiMeta.create("fsRefValue")}static fsTxVer(){return FiMeta.create("fsTxVer")}static fsTxMessage(){return FiMeta.create("fsTxMessage")}static fsLnErrorCode(){return FiMeta.create("fsLnErrorCode")}static fsTxToken(){return FiMeta.create("fsTxToken")}},FiObject=class{constructor(t){this.refValue=t||{}}getValueByFiMeta(t){return null==t||null==t||null==t.fimTxKey?null:this.refValue[t.getTxKeyNtn()]}getValueByFkb(t){return null==t||null==t||null==t.getFieldName()?null:this.refValue[t.getFieldName()]}},FimFiReq=class{static frTxProfile(){return FiMeta.create("frTxProfile")}static frTxUser(){return FiMeta.create("frTxUser")}static frTxPass(){return FiMeta.create("frTxPass")}static frTxToken(){return FiMeta.create("frTxToken")}static frFkbParams(){return FiMeta.create("frFkbParams")}static frBoShowDoc(){return FiMeta.create("frBoShowDoc")}static frTxDb(){return FiMeta.create("frTxDb")}},FiApp=class{},FiLogger=class{static debug(t,e,r){r&&r()&&console.log(t)}static error(t,e){}static errorFront(t,e){}},FiEnv=class{},FiKeyEntity=class{constructor(){this.mapData=new Map}fiPut(t,e){return this.mapData.set(t,e),this}fiGet(t){if(null!=t)return this.mapData.get(t)}},FiFetchClient=class{constructor(t,e={}){this.baseUrl=t,this.defaultHeaders=e}async request(t,e={}){const r=`${this.baseUrl}${t}`,i={...this.defaultHeaders,...e.headers||{}};try{const t=await fetch(r,{...e,headers:i});if(!t.ok)throw new Error(`Fetch error: ${t.status} - ${t.statusText}`);return t.headers.get("Content-Type")?.includes("application/json")?await t.json():await t.text()}catch(t){throw console.error("Request failed:",t),t}}async get(t,e){return this.request(t,{method:"GET",headers:e})}async post(t,e,r){return this.request(t,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)})}async put(t,e,r){return this.request(t,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)})}async delete(t,e){return this.request(t,{method:"DELETE",headers:e})}},import_axios=__toESM(require("axios"),1),FiHttpClient=class{constructor(t,e=1e4,r){const i={"Content-Type":"application/json",...r?.getAsObject()};this.axiosInstance=import_axios.default.create({baseURL:t,timeout:e,headers:i}),this.initializeResponseInterceptor()}getAxiosInstance(){return this.axiosInstance}initializeResponseInterceptor(){this.axiosInstance.interceptors.response.use(this.handleResponse,this.handleError)}handleResponse(t){return Promise.resolve(t)}handleError(t){return console.error("API Hatası:",t),Promise.reject(t)}async get(t,e){return this.axiosInstance.get(t,e)}async post(t,e,r){return this.axiosInstance.post(t,e,r)}async put(t,e,r){return this.axiosInstance.put(t,e,r)}async delete(t,e){return this.axiosInstance.delete(t,e)}},Fdr=class{getLogListNtn(){return null==this.logList&&(this.logList=new Array),this.logList}},FiLog=class{},FiCol=class _FiCol{static bui(t,e){let r=new _FiCol;return r.fcTxFieldName=t,r.fcTxHeader=e,r}},FimFiCol=class{static fcTxDesc(){return FiMeta.create("fcTxDesc")}static fcTxPrefix(){return FiMeta.create("fcTxPrefix")}static fcTxEntityName(){return FiMeta.create("fcTxEntityName")}static fcTxFieldName(){return FiMeta.create("fcTxFieldName")}static fcTxFieldType(){return FiMeta.create("fcTxFieldType")}static fcTxHeader(){return FiMeta.create("fcTxHeader")}static fcTxDbField(){return FiMeta.create("fcTxDbField")}static fcTxRefField(){return FiMeta.create("fcTxRefField")}static fcLnLength(){return FiMeta.create("fcLnLength")}static fcLnPrecision(){return FiMeta.create("fcLnPrecision")}static fcLnScale(){return FiMeta.create("fcLnScale")}static fcBoNullable(){return FiMeta.create("fcBoNullable")}static fcTxIdType(){return FiMeta.create("fcTxIdType")}static fcBoTransient(){return FiMeta.create("fcBoTransient")}static fcBoUnique(){return FiMeta.create("fcBoUnique")}static fcBoUniqGro1(){return FiMeta.create("fcBoUniqGro1")}static fcTxDefValue(){return FiMeta.create("fcTxDefValue")}},Fkb=class{constructor(){this.mapData=new Map}fiPut(t,e){return this.mapData.set(t,e),this}fiGetAsStringNtn(t){return null==t?"":this.mapData.has(t)?this.mapData.get(t).toString():""}getAsStringNtn(t){return null==t?"":this.mapData.has(t)?this.mapData.get(t).toString():""}fiGet(t){if(null!=t)return this.mapData.get(t)}getAsObject(){const t={};for(const[e,r]of this.mapData.entries())t[e]=r;return t}addFieldByFiMeta(t,e){this.fiPut(t.getTxKeyNtn(),e)}addFieldByFm(t,e){this.addFieldByFiMeta(t,e)}getFieldName(){return this.fiGetAsStringNtn(FimFiCol.fcTxFieldName().fimTxKey)}isNumber(){const t=this.fiGetAsStringNtn(FimFiCol.fcTxFieldType().fimTxKey).toLowerCase();return"number"===t||"float"===t||"double"===t||"int"===t}},FkbList=class{constructor(){this.fkbList=[]}add(t){this.push(t)}push(t){this.fkbList.push(t)}getFkbListInit(){return null!=this.fkbList&&null!=this.fkbList||(this.fkbList=[]),this.fkbList}getArray(){return this.fkbList}},FicList=class{constructor(){this.ficList=[]}add(t){this.push(t)}push(t){this.ficList.push(t)}getFicListInit(){return null==this.ficList&&(this.ficList=[]),this.ficList}getFl(){return this.ficList}},FiLocalStorage=class{static set(t,e){try{const r="string"==typeof e?e:JSON.stringify(e);window.localStorage.setItem(t,r)}catch(t){console.error("FiLocalStorage.set error:",t)}}static get(t){try{const e=window.localStorage.getItem(t);if(null===e)return null;try{return JSON.parse(e)}catch{return e}}catch(t){return console.error("FiLocalStorage.get error:",t),null}}static remove(t){try{window.localStorage.removeItem(t)}catch(t){console.error("FiLocalStorage.remove error:",t)}}static clear(){try{window.localStorage.clear()}catch(t){console.error("FiLocalStorage.clear error:",t)}}static exist(t){try{return null!==window.localStorage.getItem(t)}catch(t){return console.error("FiLocalStorage.exist error:",t),!1}}};
|
package/dist/orak-util-ts.d.cts
CHANGED
|
@@ -47,9 +47,9 @@ declare class FimFiRes {
|
|
|
47
47
|
static fsTxToken(): FiMeta;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
declare class
|
|
50
|
+
declare class Fkb {
|
|
51
51
|
mapData: Map<string, any>;
|
|
52
|
-
fiPut(txKey: string, value: any):
|
|
52
|
+
fiPut(txKey: string, value: any): Fkb;
|
|
53
53
|
fiGetAsStringNtn(txKey: string | undefined): string;
|
|
54
54
|
getAsStringNtn(txKey: string | undefined): string;
|
|
55
55
|
fiGet(txKey: string | undefined): any;
|
|
@@ -71,7 +71,7 @@ declare class FiObject {
|
|
|
71
71
|
refValue: Record<string, any>;
|
|
72
72
|
constructor(refValue?: Record<string, any>);
|
|
73
73
|
getValueByFiMeta(fiMeta: FiMeta): any;
|
|
74
|
-
getValueByFkb(fkb:
|
|
74
|
+
getValueByFkb(fkb: Fkb): any;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
declare class FimFiReq {
|
|
@@ -135,7 +135,7 @@ declare class FiFetchClient {
|
|
|
135
135
|
|
|
136
136
|
declare class FiHttpClient {
|
|
137
137
|
private axiosInstance;
|
|
138
|
-
constructor(baseURL: string, timeout?: number, fkbExtraHeaders?:
|
|
138
|
+
constructor(baseURL: string, timeout?: number, fkbExtraHeaders?: Fkb);
|
|
139
139
|
getAxiosInstance(): AxiosInstance;
|
|
140
140
|
private initializeResponseInterceptor;
|
|
141
141
|
private handleResponse;
|
|
@@ -233,12 +233,12 @@ declare class FiCol {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
declare class FkbList {
|
|
236
|
-
fkbList: Array<
|
|
236
|
+
fkbList: Array<Fkb>;
|
|
237
237
|
constructor();
|
|
238
|
-
add(fkb:
|
|
239
|
-
push(fkb:
|
|
240
|
-
getFkbListInit(): Array<
|
|
241
|
-
getArray(): Array<
|
|
238
|
+
add(fkb: Fkb): void;
|
|
239
|
+
push(fkb: Fkb): void;
|
|
240
|
+
getFkbListInit(): Array<Fkb>;
|
|
241
|
+
getArray(): Array<Fkb>;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
declare class FicList {
|
|
@@ -319,4 +319,4 @@ interface IFiTableFkb {
|
|
|
319
319
|
genITableColsTrans(): FkbList;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
export { Fdr, FiApp, FiCol, FiConnConfig, FiEnv, FiFetchClient, FiHttpClient, FiKeyEntity,
|
|
322
|
+
export { Fdr, FiApp, FiCol, FiConnConfig, FiEnv, FiFetchClient, FiHttpClient, FiKeyEntity, FiLocalStorage, FiLog, FiLogger, FiMeta, FiNumber, FiObject, FiQuery, FiQueryUtil, FiQugen, FiString, FicList, FimFiCol, FimFiReq, FimFiRes, Fkb, FkbList, type IFiBaseLogger, type IFiConfiger, type IFiMeta, type IFiTableFic, type IFiTableFkb };
|
package/dist/orak-util-ts.d.ts
CHANGED
|
@@ -47,9 +47,9 @@ declare class FimFiRes {
|
|
|
47
47
|
static fsTxToken(): FiMeta;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
declare class
|
|
50
|
+
declare class Fkb {
|
|
51
51
|
mapData: Map<string, any>;
|
|
52
|
-
fiPut(txKey: string, value: any):
|
|
52
|
+
fiPut(txKey: string, value: any): Fkb;
|
|
53
53
|
fiGetAsStringNtn(txKey: string | undefined): string;
|
|
54
54
|
getAsStringNtn(txKey: string | undefined): string;
|
|
55
55
|
fiGet(txKey: string | undefined): any;
|
|
@@ -71,7 +71,7 @@ declare class FiObject {
|
|
|
71
71
|
refValue: Record<string, any>;
|
|
72
72
|
constructor(refValue?: Record<string, any>);
|
|
73
73
|
getValueByFiMeta(fiMeta: FiMeta): any;
|
|
74
|
-
getValueByFkb(fkb:
|
|
74
|
+
getValueByFkb(fkb: Fkb): any;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
declare class FimFiReq {
|
|
@@ -135,7 +135,7 @@ declare class FiFetchClient {
|
|
|
135
135
|
|
|
136
136
|
declare class FiHttpClient {
|
|
137
137
|
private axiosInstance;
|
|
138
|
-
constructor(baseURL: string, timeout?: number, fkbExtraHeaders?:
|
|
138
|
+
constructor(baseURL: string, timeout?: number, fkbExtraHeaders?: Fkb);
|
|
139
139
|
getAxiosInstance(): AxiosInstance;
|
|
140
140
|
private initializeResponseInterceptor;
|
|
141
141
|
private handleResponse;
|
|
@@ -233,12 +233,12 @@ declare class FiCol {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
declare class FkbList {
|
|
236
|
-
fkbList: Array<
|
|
236
|
+
fkbList: Array<Fkb>;
|
|
237
237
|
constructor();
|
|
238
|
-
add(fkb:
|
|
239
|
-
push(fkb:
|
|
240
|
-
getFkbListInit(): Array<
|
|
241
|
-
getArray(): Array<
|
|
238
|
+
add(fkb: Fkb): void;
|
|
239
|
+
push(fkb: Fkb): void;
|
|
240
|
+
getFkbListInit(): Array<Fkb>;
|
|
241
|
+
getArray(): Array<Fkb>;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
declare class FicList {
|
|
@@ -319,4 +319,4 @@ interface IFiTableFkb {
|
|
|
319
319
|
genITableColsTrans(): FkbList;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
export { Fdr, FiApp, FiCol, FiConnConfig, FiEnv, FiFetchClient, FiHttpClient, FiKeyEntity,
|
|
322
|
+
export { Fdr, FiApp, FiCol, FiConnConfig, FiEnv, FiFetchClient, FiHttpClient, FiKeyEntity, FiLocalStorage, FiLog, FiLogger, FiMeta, FiNumber, FiObject, FiQuery, FiQueryUtil, FiQugen, FiString, FicList, FimFiCol, FimFiReq, FimFiRes, Fkb, FkbList, type IFiBaseLogger, type IFiConfiger, type IFiMeta, type IFiTableFic, type IFiTableFkb };
|