orak-util-ts 0.0.42 → 1.0.2
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/orak-util-ts.cjs +1 -1
- package/dist/orak-util-ts.d.cts +70 -22
- package/dist/orak-util-ts.d.ts +70 -22
- package/dist/orak-util-ts.global.js +1 -1
- package/dist/orak-util-ts.js +1 -1
- package/package.json +17 -15
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=(e
|
|
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,s)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of __getOwnPropNames(e))__hasOwnProp.call(t,i)||i===r||__defProp(t,i,{get:()=>e[i],enumerable:!(s=__getOwnPropDesc(e,i))||s.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,FiCol:()=>FiCol,FiFetchClient:()=>FiFetchClient,FiHttpClient:()=>FiHttpClient,FiKeyEntity:()=>FiKeyEntity,FiKeybean:()=>FiKeybean,FiLocalStorage:()=>FiLocalStorage,FiLog:()=>FiLog,FiMeta:()=>FiMeta,FiNumber:()=>FiNumber,FiString:()=>FiString,FicList:()=>FicList,FkbList:()=>FkbList}),module.exports=__toCommonJS(src_exports);var 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}`,s={...this.defaultHeaders,...e.headers||{}};try{const t=await fetch(r,{...e,headers:s});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 s={"Content-Type":"application/json",...r?.getAsObject()};this.axiosInstance=import_axios.default.create({baseURL:t,timeout:e,headers:s}),this.initializeResponseInterceptor()}initializeResponseInterceptor(){this.axiosInstance.interceptors.response.use(this.handleResponse,this.handleError)}handleResponse({data:t}){return t}handleError(t){return console.error("API Hatası:",t),Promise.reject(t.message||"Bir hata oluştu")}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)}},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}},FiNumber=class{static orZero(t){return null==t?0:t}static orMinusOne(t){return null==t?-1: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)}},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.ofcTxFieldName=t,r.ofcTxHeader=e,r}},FiKeybean=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():""}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}},FkbList=class{constructor(){this.fkbList=[]}add(t){this.push(t)}push(t){this.fkbList.push(t)}getFkbListInit(){return 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
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { JSX } from 'solid-js';
|
|
2
1
|
import { AxiosRequestConfig } from 'axios';
|
|
3
2
|
|
|
4
|
-
declare class Fel {
|
|
5
|
-
jsxElement?: JSX.Element;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
3
|
declare class FiKeyEntity<T> {
|
|
9
4
|
mapData: Map<string, T>;
|
|
10
5
|
fiPut(txKey: string, value: T): FiKeyEntity<T>;
|
|
@@ -12,6 +7,9 @@ declare class FiKeyEntity<T> {
|
|
|
12
7
|
constructor();
|
|
13
8
|
}
|
|
14
9
|
|
|
10
|
+
/**
|
|
11
|
+
* FiFetchClient
|
|
12
|
+
*/
|
|
15
13
|
declare class FiFetchClient {
|
|
16
14
|
private baseUrl;
|
|
17
15
|
private defaultHeaders;
|
|
@@ -23,9 +21,18 @@ declare class FiFetchClient {
|
|
|
23
21
|
delete<T>(endpoint: string, headers?: HeadersInit): Promise<T>;
|
|
24
22
|
}
|
|
25
23
|
|
|
24
|
+
declare class FiKeybean {
|
|
25
|
+
mapData: Map<string, any>;
|
|
26
|
+
fiPut(txKey: string, value: any): FiKeybean;
|
|
27
|
+
fiGetAsStringNtn(txKey: string | undefined): string;
|
|
28
|
+
fiGet(txKey: string | undefined): any;
|
|
29
|
+
getAsObject(): Record<string, any>;
|
|
30
|
+
constructor();
|
|
31
|
+
}
|
|
32
|
+
|
|
26
33
|
declare class FiHttpClient {
|
|
27
34
|
private axiosInstance;
|
|
28
|
-
constructor(baseURL: string, timeout?: number);
|
|
35
|
+
constructor(baseURL: string, timeout?: number, fkbExtraHeaders?: FiKeybean);
|
|
29
36
|
private initializeResponseInterceptor;
|
|
30
37
|
private handleResponse;
|
|
31
38
|
private handleError;
|
|
@@ -36,6 +43,9 @@ declare class FiHttpClient {
|
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
declare class FiString {
|
|
46
|
+
static cropWitDot(musTXTUNVAN: string, arg1: number): string;
|
|
47
|
+
static crop(txValue: string, lnSize: number, txSuffix?: string): string;
|
|
48
|
+
static joinComma(iskProList: any, fnValue: (item: any) => any): any;
|
|
39
49
|
static orEmpty(value: string | undefined): string;
|
|
40
50
|
}
|
|
41
51
|
|
|
@@ -54,14 +64,15 @@ declare class FiMeta implements IFiMeta {
|
|
|
54
64
|
fimTxKey?: string;
|
|
55
65
|
fimTxValue?: string;
|
|
56
66
|
fimLnKey?: number;
|
|
67
|
+
static create(txKey: string): FiMeta;
|
|
57
68
|
getTxKeyNtn(): string;
|
|
58
69
|
getTxValueNtn(): string;
|
|
59
70
|
getLnKeyOrMinusOne(): number;
|
|
60
71
|
}
|
|
61
72
|
|
|
62
|
-
declare class
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
declare class FiLog {
|
|
74
|
+
logTxMessage?: string;
|
|
75
|
+
logTxType?: string;
|
|
65
76
|
}
|
|
66
77
|
|
|
67
78
|
declare class Fdr {
|
|
@@ -71,22 +82,19 @@ declare class Fdr {
|
|
|
71
82
|
lnResponseCode?: number;
|
|
72
83
|
txId?: string;
|
|
73
84
|
txName?: string;
|
|
74
|
-
logList?: Array<
|
|
85
|
+
logList?: Array<FiLog>;
|
|
75
86
|
rowsAffected?: number;
|
|
76
87
|
lnTotalCount?: number;
|
|
77
88
|
boFalseExist?: boolean;
|
|
78
89
|
listException?: Array<object>;
|
|
79
90
|
lnStatus?: number;
|
|
80
|
-
getLogListNtn(): Array<
|
|
91
|
+
getLogListNtn(): Array<FiLog>;
|
|
81
92
|
}
|
|
82
93
|
|
|
83
94
|
declare class FiCol {
|
|
84
95
|
ofcTxFieldName?: string;
|
|
85
96
|
ofcTxHeader?: string;
|
|
86
|
-
txLabel?: string;
|
|
87
97
|
ofcTxDbFieldName?: string;
|
|
88
|
-
txGuid?: string;
|
|
89
|
-
ofiTxIdType?: string;
|
|
90
98
|
ofcBoUniqGro1?: boolean;
|
|
91
99
|
ofcBoNullable?: boolean;
|
|
92
100
|
ofcBoUnique?: boolean;
|
|
@@ -101,7 +109,9 @@ declare class FiCol {
|
|
|
101
109
|
ofcTxFieldType?: string;
|
|
102
110
|
ofcTxEntityName?: string;
|
|
103
111
|
oftBoTransient?: boolean;
|
|
104
|
-
|
|
112
|
+
txLabel?: string;
|
|
113
|
+
txGuid?: string;
|
|
114
|
+
ofiTxIdType?: string;
|
|
105
115
|
printSize?: number;
|
|
106
116
|
colType?: string;
|
|
107
117
|
boEditable?: boolean;
|
|
@@ -134,14 +144,52 @@ declare class FiCol {
|
|
|
134
144
|
static bui(txFieldName: string, txHeader: string): FiCol;
|
|
135
145
|
}
|
|
136
146
|
|
|
137
|
-
declare class
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
declare class FkbList {
|
|
148
|
+
fkbList: Array<FiKeybean>;
|
|
149
|
+
constructor();
|
|
150
|
+
add(fkb: FiKeybean): void;
|
|
151
|
+
push(fkb: FiKeybean): void;
|
|
152
|
+
getFkbListInit(): Array<FiKeybean>;
|
|
153
|
+
getArray(): Array<FiKeybean>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare class FicList {
|
|
157
|
+
ficList: Array<FiCol>;
|
|
142
158
|
constructor();
|
|
159
|
+
add(fic: FiCol): void;
|
|
160
|
+
push(fic: FiCol): void;
|
|
161
|
+
getFicListInit(): Array<FiCol>;
|
|
162
|
+
getFl(): FiCol[];
|
|
143
163
|
}
|
|
144
164
|
|
|
145
|
-
declare
|
|
165
|
+
declare class FiLocalStorage {
|
|
166
|
+
/**
|
|
167
|
+
* Anahtar ile localStorage'a veri kaydeder
|
|
168
|
+
* @param key string
|
|
169
|
+
* @param value any
|
|
170
|
+
*/
|
|
171
|
+
static set(key: string, value: any): void;
|
|
172
|
+
/**
|
|
173
|
+
* Anahtar ile localStorage'dan veri okur
|
|
174
|
+
* @param key string
|
|
175
|
+
* @returns any | null
|
|
176
|
+
*/
|
|
177
|
+
static get<T = any>(key: string): T | null;
|
|
178
|
+
/**
|
|
179
|
+
* Anahtar ile localStorage'dan veriyi siler
|
|
180
|
+
* @param key string
|
|
181
|
+
*/
|
|
182
|
+
static remove(key: string): void;
|
|
183
|
+
/**
|
|
184
|
+
* Tüm localStorage verisini temizler
|
|
185
|
+
*/
|
|
186
|
+
static clear(): void;
|
|
187
|
+
/**
|
|
188
|
+
* Anahtar localStorage'da var mı kontrol eder
|
|
189
|
+
* @param key string
|
|
190
|
+
* @returns boolean
|
|
191
|
+
*/
|
|
192
|
+
static exist(key: string): boolean;
|
|
193
|
+
}
|
|
146
194
|
|
|
147
|
-
export { Fdr,
|
|
195
|
+
export { Fdr, FiCol, FiFetchClient, FiHttpClient, FiKeyEntity, FiKeybean, FiLocalStorage, FiLog, FiMeta, FiNumber, FiString, FicList, FkbList, type IFiMeta };
|
package/dist/orak-util-ts.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { JSX } from 'solid-js';
|
|
2
1
|
import { AxiosRequestConfig } from 'axios';
|
|
3
2
|
|
|
4
|
-
declare class Fel {
|
|
5
|
-
jsxElement?: JSX.Element;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
3
|
declare class FiKeyEntity<T> {
|
|
9
4
|
mapData: Map<string, T>;
|
|
10
5
|
fiPut(txKey: string, value: T): FiKeyEntity<T>;
|
|
@@ -12,6 +7,9 @@ declare class FiKeyEntity<T> {
|
|
|
12
7
|
constructor();
|
|
13
8
|
}
|
|
14
9
|
|
|
10
|
+
/**
|
|
11
|
+
* FiFetchClient
|
|
12
|
+
*/
|
|
15
13
|
declare class FiFetchClient {
|
|
16
14
|
private baseUrl;
|
|
17
15
|
private defaultHeaders;
|
|
@@ -23,9 +21,18 @@ declare class FiFetchClient {
|
|
|
23
21
|
delete<T>(endpoint: string, headers?: HeadersInit): Promise<T>;
|
|
24
22
|
}
|
|
25
23
|
|
|
24
|
+
declare class FiKeybean {
|
|
25
|
+
mapData: Map<string, any>;
|
|
26
|
+
fiPut(txKey: string, value: any): FiKeybean;
|
|
27
|
+
fiGetAsStringNtn(txKey: string | undefined): string;
|
|
28
|
+
fiGet(txKey: string | undefined): any;
|
|
29
|
+
getAsObject(): Record<string, any>;
|
|
30
|
+
constructor();
|
|
31
|
+
}
|
|
32
|
+
|
|
26
33
|
declare class FiHttpClient {
|
|
27
34
|
private axiosInstance;
|
|
28
|
-
constructor(baseURL: string, timeout?: number);
|
|
35
|
+
constructor(baseURL: string, timeout?: number, fkbExtraHeaders?: FiKeybean);
|
|
29
36
|
private initializeResponseInterceptor;
|
|
30
37
|
private handleResponse;
|
|
31
38
|
private handleError;
|
|
@@ -36,6 +43,9 @@ declare class FiHttpClient {
|
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
declare class FiString {
|
|
46
|
+
static cropWitDot(musTXTUNVAN: string, arg1: number): string;
|
|
47
|
+
static crop(txValue: string, lnSize: number, txSuffix?: string): string;
|
|
48
|
+
static joinComma(iskProList: any, fnValue: (item: any) => any): any;
|
|
39
49
|
static orEmpty(value: string | undefined): string;
|
|
40
50
|
}
|
|
41
51
|
|
|
@@ -54,14 +64,15 @@ declare class FiMeta implements IFiMeta {
|
|
|
54
64
|
fimTxKey?: string;
|
|
55
65
|
fimTxValue?: string;
|
|
56
66
|
fimLnKey?: number;
|
|
67
|
+
static create(txKey: string): FiMeta;
|
|
57
68
|
getTxKeyNtn(): string;
|
|
58
69
|
getTxValueNtn(): string;
|
|
59
70
|
getLnKeyOrMinusOne(): number;
|
|
60
71
|
}
|
|
61
72
|
|
|
62
|
-
declare class
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
declare class FiLog {
|
|
74
|
+
logTxMessage?: string;
|
|
75
|
+
logTxType?: string;
|
|
65
76
|
}
|
|
66
77
|
|
|
67
78
|
declare class Fdr {
|
|
@@ -71,22 +82,19 @@ declare class Fdr {
|
|
|
71
82
|
lnResponseCode?: number;
|
|
72
83
|
txId?: string;
|
|
73
84
|
txName?: string;
|
|
74
|
-
logList?: Array<
|
|
85
|
+
logList?: Array<FiLog>;
|
|
75
86
|
rowsAffected?: number;
|
|
76
87
|
lnTotalCount?: number;
|
|
77
88
|
boFalseExist?: boolean;
|
|
78
89
|
listException?: Array<object>;
|
|
79
90
|
lnStatus?: number;
|
|
80
|
-
getLogListNtn(): Array<
|
|
91
|
+
getLogListNtn(): Array<FiLog>;
|
|
81
92
|
}
|
|
82
93
|
|
|
83
94
|
declare class FiCol {
|
|
84
95
|
ofcTxFieldName?: string;
|
|
85
96
|
ofcTxHeader?: string;
|
|
86
|
-
txLabel?: string;
|
|
87
97
|
ofcTxDbFieldName?: string;
|
|
88
|
-
txGuid?: string;
|
|
89
|
-
ofiTxIdType?: string;
|
|
90
98
|
ofcBoUniqGro1?: boolean;
|
|
91
99
|
ofcBoNullable?: boolean;
|
|
92
100
|
ofcBoUnique?: boolean;
|
|
@@ -101,7 +109,9 @@ declare class FiCol {
|
|
|
101
109
|
ofcTxFieldType?: string;
|
|
102
110
|
ofcTxEntityName?: string;
|
|
103
111
|
oftBoTransient?: boolean;
|
|
104
|
-
|
|
112
|
+
txLabel?: string;
|
|
113
|
+
txGuid?: string;
|
|
114
|
+
ofiTxIdType?: string;
|
|
105
115
|
printSize?: number;
|
|
106
116
|
colType?: string;
|
|
107
117
|
boEditable?: boolean;
|
|
@@ -134,14 +144,52 @@ declare class FiCol {
|
|
|
134
144
|
static bui(txFieldName: string, txHeader: string): FiCol;
|
|
135
145
|
}
|
|
136
146
|
|
|
137
|
-
declare class
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
declare class FkbList {
|
|
148
|
+
fkbList: Array<FiKeybean>;
|
|
149
|
+
constructor();
|
|
150
|
+
add(fkb: FiKeybean): void;
|
|
151
|
+
push(fkb: FiKeybean): void;
|
|
152
|
+
getFkbListInit(): Array<FiKeybean>;
|
|
153
|
+
getArray(): Array<FiKeybean>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare class FicList {
|
|
157
|
+
ficList: Array<FiCol>;
|
|
142
158
|
constructor();
|
|
159
|
+
add(fic: FiCol): void;
|
|
160
|
+
push(fic: FiCol): void;
|
|
161
|
+
getFicListInit(): Array<FiCol>;
|
|
162
|
+
getFl(): FiCol[];
|
|
143
163
|
}
|
|
144
164
|
|
|
145
|
-
declare
|
|
165
|
+
declare class FiLocalStorage {
|
|
166
|
+
/**
|
|
167
|
+
* Anahtar ile localStorage'a veri kaydeder
|
|
168
|
+
* @param key string
|
|
169
|
+
* @param value any
|
|
170
|
+
*/
|
|
171
|
+
static set(key: string, value: any): void;
|
|
172
|
+
/**
|
|
173
|
+
* Anahtar ile localStorage'dan veri okur
|
|
174
|
+
* @param key string
|
|
175
|
+
* @returns any | null
|
|
176
|
+
*/
|
|
177
|
+
static get<T = any>(key: string): T | null;
|
|
178
|
+
/**
|
|
179
|
+
* Anahtar ile localStorage'dan veriyi siler
|
|
180
|
+
* @param key string
|
|
181
|
+
*/
|
|
182
|
+
static remove(key: string): void;
|
|
183
|
+
/**
|
|
184
|
+
* Tüm localStorage verisini temizler
|
|
185
|
+
*/
|
|
186
|
+
static clear(): void;
|
|
187
|
+
/**
|
|
188
|
+
* Anahtar localStorage'da var mı kontrol eder
|
|
189
|
+
* @param key string
|
|
190
|
+
* @returns boolean
|
|
191
|
+
*/
|
|
192
|
+
static exist(key: string): boolean;
|
|
193
|
+
}
|
|
146
194
|
|
|
147
|
-
export { Fdr,
|
|
195
|
+
export { Fdr, FiCol, FiFetchClient, FiHttpClient, FiKeyEntity, FiKeybean, FiLocalStorage, FiLog, FiMeta, FiNumber, FiString, FicList, FkbList, type IFiMeta };
|