api-core-lib 12.0.26 → 12.0.27
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/{apiModule.types-Bn0tJF7b.d.cts → apiModule.types-Bg7m0Xoy.d.cts} +1 -1
- package/dist/{apiModule.types-Bn0tJF7b.d.ts → apiModule.types-Bg7m0Xoy.d.ts} +1 -1
- package/dist/chunk-NCMDUWNO.cjs +388 -0
- package/dist/chunk-NRV3EMIJ.js +8 -0
- package/dist/chunk-QOOQGLEX.cjs +8 -0
- package/dist/chunk-UWAVU6EF.js +388 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +107 -0
- package/dist/client.cjs +105 -520
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +12 -387
- package/dist/index.cjs +46 -457
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -380
- package/dist/server.cjs +12 -303
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +7 -263
- package/dist/{useApiRecord.types-CWhwCAB6.d.ts → useApiRecord.types-BsemqlQl.d.ts} +1 -1
- package/dist/{useApiRecord.types-NZtPRga3.d.cts → useApiRecord.types-CT4BDrvj.d.cts} +1 -1
- package/package.json +1 -1
|
@@ -287,4 +287,4 @@ type ActionMethods<TAction extends ActionConfigModule<any, any>> = {
|
|
|
287
287
|
}) => void;
|
|
288
288
|
};
|
|
289
289
|
|
|
290
|
-
export type {
|
|
290
|
+
export type { ApiError as A, ExecutableAction as E, InputOf as I, LogLevel as L, ModuleStates as M, OutputOf as O, PaginationMeta as P, QueryOptions as Q, RequestConfig as R, StandardResponse as S, Tokens as T, UseApiConfig as U, ValidationError as V, ActionOptions as a, ActionConfigModule as b, ApiModuleConfig as c, UseApiModuleOptions as d, UseApiModuleReturn as e, ModuleActions as f, UseApiQuery as g, ApiClientConfig as h, ActionStateModule as i, TokenManager as j, MiddlewareContext as k, Middleware as l, RefreshTokenConfig as m, ActionConfig as n, UseApiState as o, ActionState as p, ExecuteOptions as q, ActionsWithQuery as r, ActionMethods as s, t };
|
|
@@ -287,4 +287,4 @@ type ActionMethods<TAction extends ActionConfigModule<any, any>> = {
|
|
|
287
287
|
}) => void;
|
|
288
288
|
};
|
|
289
289
|
|
|
290
|
-
export type {
|
|
290
|
+
export type { ApiError as A, ExecutableAction as E, InputOf as I, LogLevel as L, ModuleStates as M, OutputOf as O, PaginationMeta as P, QueryOptions as Q, RequestConfig as R, StandardResponse as S, Tokens as T, UseApiConfig as U, ValidationError as V, ActionOptions as a, ActionConfigModule as b, ApiModuleConfig as c, UseApiModuleOptions as d, UseApiModuleReturn as e, ModuleActions as f, UseApiQuery as g, ApiClientConfig as h, ActionStateModule as i, TokenManager as j, MiddlewareContext as k, Middleware as l, RefreshTokenConfig as m, ActionConfig as n, UseApiState as o, ActionState as p, ExecuteOptions as q, ActionsWithQuery as r, ActionMethods as s, t };
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
3
|
+
|
|
4
|
+
var _chunkQOOQGLEXcjs = require('./chunk-QOOQGLEX.cjs');
|
|
5
|
+
|
|
6
|
+
// src/core/utils.ts
|
|
7
|
+
var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
|
|
8
|
+
function isAxiosResponse(obj) {
|
|
9
|
+
return obj && obj.data !== void 0 && obj.status !== void 0 && obj.config !== void 0;
|
|
10
|
+
}
|
|
11
|
+
function buildPaginateQuery(options) {
|
|
12
|
+
const params = new URLSearchParams();
|
|
13
|
+
for (const key in options) {
|
|
14
|
+
const value = options[key];
|
|
15
|
+
if (value === null || value === void 0) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
if (key === "filter" && typeof value === "object" && !Array.isArray(value)) {
|
|
19
|
+
for (const filterKey in value) {
|
|
20
|
+
const filterValue = value[filterKey];
|
|
21
|
+
if (filterValue !== null && filterValue !== void 0) {
|
|
22
|
+
params.append(`filter[${filterKey}]`, String(filterValue));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
} else if (key === "sortBy" && Array.isArray(value)) {
|
|
26
|
+
value.forEach((sortItem) => {
|
|
27
|
+
if (sortItem && sortItem.key && sortItem.direction) {
|
|
28
|
+
params.append("sortBy[]", `${sortItem.key}:${sortItem.direction}`);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
params.append(key, String(value));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return params.toString();
|
|
36
|
+
}
|
|
37
|
+
function isServerError(error) {
|
|
38
|
+
return _axios2.default.isAxiosError(error) && error.response !== void 0;
|
|
39
|
+
}
|
|
40
|
+
function isNetworkError(error) {
|
|
41
|
+
return _axios2.default.isAxiosError(error) && error.response === void 0 && error.request !== void 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/core/processor.ts
|
|
45
|
+
|
|
46
|
+
var processResponse = (responseOrError) => {
|
|
47
|
+
if (isAxiosResponse(responseOrError)) {
|
|
48
|
+
const response = responseOrError;
|
|
49
|
+
const rawData = response.data;
|
|
50
|
+
const isStandardApiResponse = rawData && typeof rawData.success === "boolean" && rawData.data !== void 0;
|
|
51
|
+
return {
|
|
52
|
+
data: isStandardApiResponse ? rawData.data : rawData,
|
|
53
|
+
links: isStandardApiResponse ? rawData.links : void 0,
|
|
54
|
+
meta: isStandardApiResponse ? rawData.meta : void 0,
|
|
55
|
+
rawResponse: rawData,
|
|
56
|
+
loading: false,
|
|
57
|
+
success: true,
|
|
58
|
+
error: null,
|
|
59
|
+
message: isStandardApiResponse ? rawData.message : "Request successful.",
|
|
60
|
+
validationErrors: []
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (isServerError(responseOrError)) {
|
|
64
|
+
const error = responseOrError;
|
|
65
|
+
const responseData = error.response.data;
|
|
66
|
+
const status = error.response.status;
|
|
67
|
+
let defaultMessage = "An unexpected server error occurred.";
|
|
68
|
+
switch (status) {
|
|
69
|
+
case 400:
|
|
70
|
+
defaultMessage = "Bad Request";
|
|
71
|
+
break;
|
|
72
|
+
case 401:
|
|
73
|
+
defaultMessage = "Unauthorized";
|
|
74
|
+
break;
|
|
75
|
+
case 403:
|
|
76
|
+
defaultMessage = "Forbidden";
|
|
77
|
+
break;
|
|
78
|
+
case 404:
|
|
79
|
+
defaultMessage = "Not Found";
|
|
80
|
+
break;
|
|
81
|
+
case 422:
|
|
82
|
+
defaultMessage = "Validation Failed";
|
|
83
|
+
break;
|
|
84
|
+
case 500:
|
|
85
|
+
defaultMessage = "Internal Server Error";
|
|
86
|
+
break;
|
|
87
|
+
case 503:
|
|
88
|
+
defaultMessage = "Service Unavailable";
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
defaultMessage = `Server Error (${status})`;
|
|
92
|
+
}
|
|
93
|
+
const finalApiError = {
|
|
94
|
+
message: _optionalChain([responseData, 'optionalAccess', _ => _.message]) || defaultMessage,
|
|
95
|
+
status,
|
|
96
|
+
code: _optionalChain([responseData, 'optionalAccess', _2 => _2.code]) || error.code,
|
|
97
|
+
errors: _optionalChain([responseData, 'optionalAccess', _3 => _3.errors]) || []
|
|
98
|
+
};
|
|
99
|
+
return {
|
|
100
|
+
data: null,
|
|
101
|
+
rawResponse: responseData,
|
|
102
|
+
error: finalApiError,
|
|
103
|
+
validationErrors: finalApiError.errors,
|
|
104
|
+
success: false,
|
|
105
|
+
loading: false,
|
|
106
|
+
message: finalApiError.message
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
if (isNetworkError(responseOrError)) {
|
|
110
|
+
const error = responseOrError;
|
|
111
|
+
return {
|
|
112
|
+
data: null,
|
|
113
|
+
rawResponse: error.request,
|
|
114
|
+
error: { message: "Network Error: Unable to connect.", status: 0, code: error.code },
|
|
115
|
+
success: false,
|
|
116
|
+
loading: false,
|
|
117
|
+
message: "Network Error."
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if (_axios2.default.isCancel(responseOrError)) {
|
|
121
|
+
return {
|
|
122
|
+
data: null,
|
|
123
|
+
rawResponse: null,
|
|
124
|
+
error: { message: "Request Canceled.", status: 499 },
|
|
125
|
+
success: false,
|
|
126
|
+
loading: false,
|
|
127
|
+
message: "Request Canceled."
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
data: null,
|
|
132
|
+
rawResponse: responseOrError,
|
|
133
|
+
error: { message: "An unknown error occurred.", status: -1 },
|
|
134
|
+
success: false,
|
|
135
|
+
loading: false,
|
|
136
|
+
message: "An unknown error occurred."
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// src/core/buildDynamicUrl.ts
|
|
141
|
+
function buildDynamicUrl(template, params) {
|
|
142
|
+
if (!params) {
|
|
143
|
+
return template;
|
|
144
|
+
}
|
|
145
|
+
return template.replace(/\{(\w+)\}/g, (placeholder, key) => {
|
|
146
|
+
return params.hasOwnProperty(key) ? String(params[key]) : placeholder;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// src/services/crud.ts
|
|
151
|
+
function createApiServices(axiosInstance, baseEndpoint) {
|
|
152
|
+
const resolveUrl = (config = {}, id) => {
|
|
153
|
+
const endpointTemplate = config.endpoint || (id != null ? `${baseEndpoint}/{id}` : baseEndpoint);
|
|
154
|
+
const params = id != null ? { id, tenant: id, tenantId: id, recordId: id } : {};
|
|
155
|
+
return buildDynamicUrl(endpointTemplate, params);
|
|
156
|
+
};
|
|
157
|
+
const get = async (id, config) => {
|
|
158
|
+
const url = resolveUrl(config, id);
|
|
159
|
+
try {
|
|
160
|
+
const response = await axiosInstance.get(url, config);
|
|
161
|
+
return processResponse(response);
|
|
162
|
+
} catch (error) {
|
|
163
|
+
return processResponse(error);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
const getWithQuery = async (query, config) => {
|
|
167
|
+
const url = `${baseEndpoint}?${query}`;
|
|
168
|
+
try {
|
|
169
|
+
const response = await axiosInstance.get(url, config);
|
|
170
|
+
return processResponse(response);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
return processResponse(error);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const post = async (data, config) => {
|
|
176
|
+
const url = resolveUrl(config);
|
|
177
|
+
try {
|
|
178
|
+
const response = await axiosInstance.post(url, data, config);
|
|
179
|
+
console.log("[lib] response POST: ", response);
|
|
180
|
+
console.log("[lib] response processResponse POST: ", processResponse(response));
|
|
181
|
+
return processResponse(response);
|
|
182
|
+
} catch (error) {
|
|
183
|
+
console.log("[lib] response error POST: ", processResponse(error));
|
|
184
|
+
return processResponse(error);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const put = async (id, data, config) => {
|
|
188
|
+
const url = resolveUrl(config, id);
|
|
189
|
+
try {
|
|
190
|
+
const response = await axiosInstance.put(url, data, config);
|
|
191
|
+
return processResponse(response);
|
|
192
|
+
} catch (error) {
|
|
193
|
+
return processResponse(error);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
const patch = async (id, data, config) => {
|
|
197
|
+
const url = resolveUrl(config, id);
|
|
198
|
+
try {
|
|
199
|
+
const response = await axiosInstance.patch(url, data, config);
|
|
200
|
+
return processResponse(response);
|
|
201
|
+
} catch (error) {
|
|
202
|
+
return processResponse(error);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const remove = async (id, config) => {
|
|
206
|
+
const url = resolveUrl(config, id);
|
|
207
|
+
try {
|
|
208
|
+
const response = await axiosInstance.delete(url, config);
|
|
209
|
+
return processResponse(response);
|
|
210
|
+
} catch (error) {
|
|
211
|
+
return processResponse(error);
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const bulkDelete = async (ids, config) => {
|
|
215
|
+
const url = resolveUrl(config);
|
|
216
|
+
try {
|
|
217
|
+
const response = await axiosInstance.delete(url, { data: { ids }, ...config });
|
|
218
|
+
return processResponse(response);
|
|
219
|
+
} catch (error) {
|
|
220
|
+
return processResponse(error);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
const upload = async (file, additionalData, config) => {
|
|
224
|
+
const url = resolveUrl(config);
|
|
225
|
+
const formData = new FormData();
|
|
226
|
+
formData.append("file", file);
|
|
227
|
+
if (additionalData) {
|
|
228
|
+
Object.keys(additionalData).forEach((key) => formData.append(key, String(additionalData[key])));
|
|
229
|
+
}
|
|
230
|
+
try {
|
|
231
|
+
const response = await axiosInstance.post(url, formData, {
|
|
232
|
+
...config,
|
|
233
|
+
headers: { ..._optionalChain([config, 'optionalAccess', _4 => _4.headers]), "Content-Type": "multipart/form-data" }
|
|
234
|
+
});
|
|
235
|
+
return processResponse(response);
|
|
236
|
+
} catch (error) {
|
|
237
|
+
return processResponse(error);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
return { get, getWithQuery, post, put, patch, remove, bulkDelete, upload };
|
|
241
|
+
}
|
|
242
|
+
async function callDynamicApi(axiosInstance, baseEndpoint, actionConfig, params) {
|
|
243
|
+
const { pathParams, body, config } = params;
|
|
244
|
+
const urlTemplate = `${baseEndpoint}${actionConfig.path}`;
|
|
245
|
+
const finalUrl = buildDynamicUrl(urlTemplate, pathParams || {});
|
|
246
|
+
try {
|
|
247
|
+
const { method } = actionConfig;
|
|
248
|
+
let response;
|
|
249
|
+
if (method === "POST" || method === "PUT" || method === "PATCH") {
|
|
250
|
+
response = await axiosInstance[method.toLowerCase()](finalUrl, body, config);
|
|
251
|
+
} else if (method === "DELETE") {
|
|
252
|
+
response = await axiosInstance.delete(finalUrl, { data: body, ...config });
|
|
253
|
+
} else {
|
|
254
|
+
response = await axiosInstance.get(finalUrl, { params: body, ...config });
|
|
255
|
+
}
|
|
256
|
+
return processResponse(response);
|
|
257
|
+
} catch (error) {
|
|
258
|
+
return processResponse(error);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// src/core/globalStateManager.ts
|
|
263
|
+
var createInitialState = () => ({
|
|
264
|
+
data: null,
|
|
265
|
+
links: void 0,
|
|
266
|
+
meta: void 0,
|
|
267
|
+
error: null,
|
|
268
|
+
loading: false,
|
|
269
|
+
success: false,
|
|
270
|
+
called: false,
|
|
271
|
+
isStale: false,
|
|
272
|
+
message: void 0,
|
|
273
|
+
validationErrors: [],
|
|
274
|
+
rawResponse: null
|
|
275
|
+
});
|
|
276
|
+
var GlobalStateManager = class {
|
|
277
|
+
constructor() {
|
|
278
|
+
_chunkQOOQGLEXcjs.__publicField.call(void 0, this, "store", /* @__PURE__ */ new Map());
|
|
279
|
+
}
|
|
280
|
+
getSnapshot(key) {
|
|
281
|
+
if (!this.store.has(key)) {
|
|
282
|
+
const initialState = createInitialState();
|
|
283
|
+
this.store.set(key, { state: initialState, listeners: /* @__PURE__ */ new Set() });
|
|
284
|
+
}
|
|
285
|
+
return this.store.get(key).state;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* يسجل دالة callback للاستماع إلى التغييرات على مفتاح معين.
|
|
289
|
+
* @returns دالة لإلغاء الاشتراك.
|
|
290
|
+
*/
|
|
291
|
+
subscribe(key, callback) {
|
|
292
|
+
if (!this.store.has(key)) {
|
|
293
|
+
this.store.set(key, { state: createInitialState(), listeners: /* @__PURE__ */ new Set() });
|
|
294
|
+
}
|
|
295
|
+
const item = this.store.get(key);
|
|
296
|
+
item.listeners.add(callback);
|
|
297
|
+
return () => {
|
|
298
|
+
item.listeners.delete(callback);
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
|
|
303
|
+
*/
|
|
304
|
+
setState(key, updater) {
|
|
305
|
+
const currentState = this.getSnapshot(key);
|
|
306
|
+
const newState = updater(currentState);
|
|
307
|
+
if (Object.is(currentState, newState)) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
const item = this.store.get(key);
|
|
311
|
+
item.state = newState;
|
|
312
|
+
item.listeners.forEach((listener) => listener());
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* يجعل البيانات المرتبطة بمفتاح معين "قديمة" (stale).
|
|
316
|
+
*/
|
|
317
|
+
invalidate(key) {
|
|
318
|
+
const state = this.getSnapshot(key);
|
|
319
|
+
if (state.called) {
|
|
320
|
+
this.setState(key, (prev) => ({ ...prev, isStale: true }));
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* [نسخة محدثة وأكثر قوة]
|
|
325
|
+
* يجعل كل البيانات التي تبدأ بمفتاح معين "قديمة" (stale).
|
|
326
|
+
* @example invalidateByPrefix('myModule/list::') سيبطل كل صفحات القائمة.
|
|
327
|
+
*/
|
|
328
|
+
invalidateByPrefix(prefix) {
|
|
329
|
+
this.store.forEach((value, key) => {
|
|
330
|
+
if (key.startsWith(prefix)) {
|
|
331
|
+
const state = this.getSnapshot(key);
|
|
332
|
+
if (state.called) {
|
|
333
|
+
this.setState(key, (prev) => ({ ...prev, isStale: true }));
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Serializes the current state of the query store into a JSON string.
|
|
340
|
+
* This is used on the server to pass the initial state to the client.
|
|
341
|
+
* @returns A JSON string representing the dehydrated state.
|
|
342
|
+
*/
|
|
343
|
+
dehydrate() {
|
|
344
|
+
const stateToPersist = {};
|
|
345
|
+
this.store.forEach((value, key) => {
|
|
346
|
+
if (value.state.called) {
|
|
347
|
+
stateToPersist[key] = value.state;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
return JSON.stringify(stateToPersist);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Merges a dehydrated state object into the current store.
|
|
354
|
+
* This is used on the client to hydrate the state received from the server.
|
|
355
|
+
* @param hydratedState - A JSON string from the `dehydrate` method.
|
|
356
|
+
*/
|
|
357
|
+
rehydrate(hydratedState) {
|
|
358
|
+
try {
|
|
359
|
+
const parsedState = JSON.parse(hydratedState);
|
|
360
|
+
for (const key in parsedState) {
|
|
361
|
+
this.setState(key, () => parsedState[key]);
|
|
362
|
+
}
|
|
363
|
+
} catch (e) {
|
|
364
|
+
console.error("[api-core-lib] Failed to rehydrate state:", e);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
var globalStateManager = new GlobalStateManager();
|
|
369
|
+
|
|
370
|
+
// src/core/cacheKey.ts
|
|
371
|
+
var generateCacheKey = (moduleName, actionName, input, callOptions = {}) => {
|
|
372
|
+
const params = { path: callOptions.pathParams, body: input };
|
|
373
|
+
try {
|
|
374
|
+
return `${moduleName}/${actionName}::${JSON.stringify(params)}`;
|
|
375
|
+
} catch (error) {
|
|
376
|
+
console.warn("Could not stringify cache key params, falling back to timestamp.", { moduleName, actionName, error });
|
|
377
|
+
return `${moduleName}/${actionName}::${Date.now()}`;
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
exports.buildPaginateQuery = buildPaginateQuery; exports.processResponse = processResponse; exports.createApiServices = createApiServices; exports.callDynamicApi = callDynamicApi; exports.globalStateManager = globalStateManager; exports.generateCacheKey = generateCacheKey;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
__publicField
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.__publicField = __publicField;
|