corebasic 1.0.220 → 1.0.221
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/libs/dip/suffix/date.js +7 -7
- package/dist/libs/elabase.js +4 -4
- package/dist/libs/features.js +2 -2
- package/dist/libs/messaging.js +1 -1
- package/dist/libs/utils.js +24 -24
- package/package.json +1 -1
|
@@ -36,13 +36,13 @@ export function formatDate(value, format) {
|
|
|
36
36
|
// years and months and dates are already deduplicated
|
|
37
37
|
const separator = '|';
|
|
38
38
|
const replacements = {
|
|
39
|
-
YYYY:
|
|
40
|
-
YY:
|
|
41
|
-
MMMM:
|
|
42
|
-
MMM:
|
|
43
|
-
MM:
|
|
44
|
-
DD:
|
|
45
|
-
D:
|
|
39
|
+
YYYY: () => years.join(separator),
|
|
40
|
+
YY: () => years.map(y => String(y).slice(-2)).join(separator),
|
|
41
|
+
MMMM: () => months.map(m => MONTH_LONG[m]).join(separator),
|
|
42
|
+
MMM: () => months.map(m => MONTH_SHORT[m]).join(separator),
|
|
43
|
+
MM: () => months.map(m => String(m + 1).padStart(2, "0")).join(separator),
|
|
44
|
+
DD: () => dates.map(d => String(d).padStart(2, "0")).join(separator),
|
|
45
|
+
D: () => dates.join(separator),
|
|
46
46
|
};
|
|
47
47
|
return format.replace(/YYYY|MMMM|MMM|YY|MM|DD|D/g, token => replacements[token]());
|
|
48
48
|
}
|
package/dist/libs/elabase.js
CHANGED
|
@@ -466,7 +466,7 @@ let Essentials = {
|
|
|
466
466
|
};
|
|
467
467
|
function prepareResult(result) {
|
|
468
468
|
let res = result.content?.length === 1 ? result.content[0].items : result.content; // For raw, this resolves to result.content which is ArrayBuffer
|
|
469
|
-
res.metadata =
|
|
469
|
+
res.metadata = () => result.metadata;
|
|
470
470
|
if (result.metadata.executor === "raw")
|
|
471
471
|
setRawBatchIterator(res);
|
|
472
472
|
return res;
|
|
@@ -507,7 +507,7 @@ function parseBinaryResponse(result) {
|
|
|
507
507
|
}
|
|
508
508
|
function setRawBatchIterator(arrayBuffer) {
|
|
509
509
|
arrayBuffer.metadata().items.forEach(batch => {
|
|
510
|
-
batch.kv =
|
|
510
|
+
batch.kv = () => {
|
|
511
511
|
const batchItem = {
|
|
512
512
|
count: batch.count,
|
|
513
513
|
slice: Essentials.sliceArrayBuffer(arrayBuffer, batch.offset, batch.size),
|
|
@@ -636,7 +636,7 @@ function getRawKeyValue(arrayBuffer, offset) {
|
|
|
636
636
|
// Zero-copy view window bounded strictly to the key bytes
|
|
637
637
|
let _id = masterView.subarray(offset, offset + keySize);
|
|
638
638
|
let _id_string;
|
|
639
|
-
_id.toText =
|
|
639
|
+
_id.toText = () => {
|
|
640
640
|
// Fix: Pass the typed array view itself, NOT the underlying root buffer
|
|
641
641
|
_id_string = _id_string === undefined ? _id.buffer.slice(_id.byteOffset, _id.byteOffset + _id.byteLength) : _id_string;
|
|
642
642
|
return bufferToString(_id_string);
|
|
@@ -651,7 +651,7 @@ function getRawKeyValue(arrayBuffer, offset) {
|
|
|
651
651
|
offset += dataSize;
|
|
652
652
|
_val = Essentials.sliceArrayBuffer(arrayBuffer, _val.byteOffset, _val.byteLength);
|
|
653
653
|
// _val = _val.buffer.slice(_val.byteOffset, _val.byteOffset + _val.byteLength);
|
|
654
|
-
_val.toText =
|
|
654
|
+
_val.toText = () => bufferToString(_val);
|
|
655
655
|
return { _id, _val, next: offset };
|
|
656
656
|
}
|
|
657
657
|
// Axios usage
|
package/dist/libs/features.js
CHANGED
|
@@ -22,7 +22,7 @@ const getFeatureUrl = api => api.split(' ')[1];
|
|
|
22
22
|
const getFeature = name => features[name];
|
|
23
23
|
const DEPLOY_TOKEN_SECRET = process.env.DEPLOY_TOKEN_SECRET || "MY_SECRET_DEPLOY_TOKEN";
|
|
24
24
|
const SERVICE_ACCESS_TOKEN = jwt.sign({ app: process.env.APP_DEPLOYMENT_NAME }, DEPLOY_TOKEN_SECRET, { expiresIn: '365d' });
|
|
25
|
-
const NDCURVE_DEVELOPER_LICENSE_ACCESS_TOKEN = await (async (
|
|
25
|
+
const NDCURVE_DEVELOPER_LICENSE_ACCESS_TOKEN = await (async () => { if (process.env.NDCURVE_DEVELOPER_SERVICE)
|
|
26
26
|
try {
|
|
27
27
|
return (await Utils.fileToJson('file://', '/.ndcurve/developer.license.json')).accessToken?.trim();
|
|
28
28
|
}
|
|
@@ -75,7 +75,7 @@ export const send = async (meta, feature, data, params) => {
|
|
|
75
75
|
let response;
|
|
76
76
|
let req = { meta, body: payload, params, method };
|
|
77
77
|
req = JSON.parse(JSON.stringify(req));
|
|
78
|
-
let res = { json: payload => response = payload, end:
|
|
78
|
+
let res = { json: payload => response = payload, end: () => true };
|
|
79
79
|
await apiHandler(req, res);
|
|
80
80
|
return response;
|
|
81
81
|
}
|
package/dist/libs/messaging.js
CHANGED
|
@@ -125,7 +125,7 @@ export async function hdel(key, subkey) {
|
|
|
125
125
|
}
|
|
126
126
|
// Hydrate
|
|
127
127
|
export async function hydrate(callback) {
|
|
128
|
-
setTimeout(async (
|
|
128
|
+
setTimeout(async () => {
|
|
129
129
|
let { user, company, items } = await callback();
|
|
130
130
|
await publish(user, { event: "RPC_hydrate", data: { company, items }, txn: Utils.uid() });
|
|
131
131
|
}, 100);
|
package/dist/libs/utils.js
CHANGED
|
@@ -184,18 +184,18 @@ export function validityToMillisecs(start, validity) {
|
|
|
184
184
|
count = parseIntValue(count);
|
|
185
185
|
period = period.toLowerCase();
|
|
186
186
|
const timeline = {
|
|
187
|
-
year:
|
|
188
|
-
years:
|
|
189
|
-
month:
|
|
190
|
-
months:
|
|
191
|
-
day:
|
|
192
|
-
days:
|
|
193
|
-
week:
|
|
194
|
-
weeks:
|
|
195
|
-
hour:
|
|
196
|
-
hours:
|
|
197
|
-
minute:
|
|
198
|
-
minutes:
|
|
187
|
+
year: () => addYears(now, count),
|
|
188
|
+
years: () => addYears(now, count),
|
|
189
|
+
month: () => addMonths(now, count),
|
|
190
|
+
months: () => addMonths(now, count),
|
|
191
|
+
day: () => now.setDate(now.getDate() + count),
|
|
192
|
+
days: () => now.setDate(now.getDate() + count),
|
|
193
|
+
week: () => now.setDate(now.getDate() + (count * 7)),
|
|
194
|
+
weeks: () => now.setDate(now.getDate() + (count * 7)),
|
|
195
|
+
hour: () => now.setHours(now.getHours() + count),
|
|
196
|
+
hours: () => now.setHours(now.getHours() + count),
|
|
197
|
+
minute: () => now.setMinutes(now.getMinutes() + count),
|
|
198
|
+
minutes: () => now.setMinutes(now.getMinutes() + count),
|
|
199
199
|
};
|
|
200
200
|
timeline[period]();
|
|
201
201
|
return now.getTime();
|
|
@@ -206,18 +206,18 @@ export function validityToUTCMillisecs(start, validity) {
|
|
|
206
206
|
count = parseIntValue(count);
|
|
207
207
|
period = period.toLowerCase();
|
|
208
208
|
const timeline = {
|
|
209
|
-
year:
|
|
210
|
-
years:
|
|
211
|
-
month:
|
|
212
|
-
months:
|
|
213
|
-
day:
|
|
214
|
-
days:
|
|
215
|
-
week:
|
|
216
|
-
weeks:
|
|
217
|
-
hour:
|
|
218
|
-
hours:
|
|
219
|
-
minute:
|
|
220
|
-
minutes:
|
|
209
|
+
year: () => addUTCYears(now, count),
|
|
210
|
+
years: () => addUTCYears(now, count),
|
|
211
|
+
month: () => addUTCMonths(now, count),
|
|
212
|
+
months: () => addUTCMonths(now, count),
|
|
213
|
+
day: () => now.setUTCDate(now.getUTCDate() + count),
|
|
214
|
+
days: () => now.setUTCDate(now.getUTCDate() + count),
|
|
215
|
+
week: () => now.setUTCDate(now.getUTCDate() + (count * 7)),
|
|
216
|
+
weeks: () => now.setUTCDate(now.getUTCDate() + (count * 7)),
|
|
217
|
+
hour: () => now.setUTCHours(now.getUTCHours() + count),
|
|
218
|
+
hours: () => now.setUTCHours(now.getUTCHours() + count),
|
|
219
|
+
minute: () => now.setUTCMinutes(now.getUTCMinutes() + count),
|
|
220
|
+
minutes: () => now.setUTCMinutes(now.getUTCMinutes() + count),
|
|
221
221
|
};
|
|
222
222
|
timeline[period]();
|
|
223
223
|
return now.getTime();
|