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.
@@ -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,t)=>{for(var r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of __getOwnPropNames(t))__hasOwnProp.call(e,n)||n===r||__defProp(e,n,{get:()=>t[n],enumerable:!(s=__getOwnPropDesc(t,n))||s.enumerable});return e},__toESM=(e,t,r)=>(r=null!=e?__create(__getProtoOf(e)):{},__copyProps(!t&&e&&e.__esModule?r:__defProp(r,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),src_exports={};__export(src_exports,{Fdr:()=>Fdr,Fel:()=>Fel,FiCol:()=>FiCol,FiFetchClient:()=>FiFetchClient,FiHttpClient:()=>FiHttpClient,FiKeyEntity:()=>FiKeyEntity,FiKeybean:()=>FiKeybean,FiMeta:()=>FiMeta,FiNumber:()=>FiNumber,FiString:()=>FiString,OreLog:()=>OreLog,greet:()=>greet}),module.exports=__toCommonJS(src_exports);var Fel=class{},FiKeyEntity=class{constructor(){this.mapData=new Map}fiPut(e,t){return this.mapData.set(e,t),this}fiGet(e){if(null!=e)return this.mapData.get(e)}},FiFetchClient=class{constructor(e,t={}){this.baseUrl=e,this.defaultHeaders=t}async request(e,t={}){const r=`${this.baseUrl}${e}`,s={...this.defaultHeaders,...t.headers||{}};try{const e=await fetch(r,{...t,headers:s});if(!e.ok)throw new Error(`Fetch error: ${e.status} - ${e.statusText}`);return e.headers.get("Content-Type")?.includes("application/json")?await e.json():await e.text()}catch(e){throw console.error("Request failed:",e),e}}async get(e,t){return this.request(e,{method:"GET",headers:t})}async post(e,t,r){return this.request(e,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)})}async put(e,t,r){return this.request(e,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)})}async delete(e,t){return this.request(e,{method:"DELETE",headers:t})}},import_axios=__toESM(require("axios"),1),FiHttpClient=class{constructor(e,t=1e4){this.axiosInstance=import_axios.default.create({baseURL:e,timeout:t,headers:{"Content-Type":"application/json"}}),this.initializeResponseInterceptor()}initializeResponseInterceptor(){this.axiosInstance.interceptors.response.use(this.handleResponse,this.handleError)}handleResponse({data:e}){return e}handleError(e){return console.error("API Hatası:",e),Promise.reject(e.message||"Bir hata oluştu")}async get(e,t){return this.axiosInstance.get(e,t)}async post(e,t,r){return this.axiosInstance.post(e,t,r)}async put(e,t,r){return this.axiosInstance.put(e,t,r)}async delete(e,t){return this.axiosInstance.delete(e,t)}},FiString=class{static orEmpty(e){return null==e?"":e}},FiNumber=class{static orZero(e){return null==e?0:e}static orMinusOne(e){return null==e?-1:e}},FiMeta=class{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}},OreLog=class{},FiCol=class _FiCol{static bui(e,t){let r=new _FiCol;return r.ofcTxFieldName=e,r.ofcTxHeader=t,r}},FiKeybean=class{constructor(){this.mapData=new Map}fiPut(e,t){return this.mapData.set(e,t),this}fiGetAsStringNtn(e){return null==e?"":this.mapData.has(e)?this.mapData.get(e).toString():""}fiGet(e){if(null!=e)return this.mapData.get(e)}};function greet(e){return`Hello, ${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}}};
@@ -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 OreLog {
63
- orlTxMessage?: string;
64
- orlTxLogType?: string;
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<OreLog>;
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<OreLog>;
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
- ficTxSqlFieldDefinition?: string;
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 FiKeybean {
138
- mapData: Map<string, any>;
139
- fiPut(txKey: string, value: any): FiKeybean;
140
- fiGetAsStringNtn(txKey: string | undefined): string;
141
- fiGet(txKey: string | undefined): any;
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 function greet(name: string): string;
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, Fel, FiCol, FiFetchClient, FiHttpClient, FiKeyEntity, FiKeybean, FiMeta, FiNumber, FiString, type IFiMeta, OreLog, greet };
195
+ export { Fdr, FiCol, FiFetchClient, FiHttpClient, FiKeyEntity, FiKeybean, FiLocalStorage, FiLog, FiMeta, FiNumber, FiString, FicList, FkbList, type IFiMeta };
@@ -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 OreLog {
63
- orlTxMessage?: string;
64
- orlTxLogType?: string;
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<OreLog>;
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<OreLog>;
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
- ficTxSqlFieldDefinition?: string;
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 FiKeybean {
138
- mapData: Map<string, any>;
139
- fiPut(txKey: string, value: any): FiKeybean;
140
- fiGetAsStringNtn(txKey: string | undefined): string;
141
- fiGet(txKey: string | undefined): any;
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 function greet(name: string): string;
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, Fel, FiCol, FiFetchClient, FiHttpClient, FiKeyEntity, FiKeybean, FiMeta, FiNumber, FiString, type IFiMeta, OreLog, greet };
195
+ export { Fdr, FiCol, FiFetchClient, FiHttpClient, FiKeyEntity, FiKeybean, FiLocalStorage, FiLog, FiMeta, FiNumber, FiString, FicList, FkbList, type IFiMeta };