@ganaka/sdk 1.6.0 → 1.8.0
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 +165 -132
- package/dist/index.d.ts +196 -0
- package/dist/index.js +872 -477
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +872 -477
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const dayjs = require("dayjs");
|
|
4
4
|
const dotenv = require("dotenv");
|
|
5
|
-
function _mergeNamespaces(n2,
|
|
6
|
-
for (var
|
|
7
|
-
const e =
|
|
5
|
+
function _mergeNamespaces(n2, m) {
|
|
6
|
+
for (var i = 0; i < m.length; i++) {
|
|
7
|
+
const e = m[i];
|
|
8
8
|
if (typeof e !== "string" && !Array.isArray(e)) {
|
|
9
|
-
for (const
|
|
10
|
-
if (
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
Object.defineProperty(n2,
|
|
9
|
+
for (const k in e) {
|
|
10
|
+
if (k !== "default" && !(k in n2)) {
|
|
11
|
+
const d2 = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
if (d2) {
|
|
13
|
+
Object.defineProperty(n2, k, d2.get ? d2 : {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: () => e[
|
|
15
|
+
get: () => e[k]
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -40,10 +40,10 @@ function $constructor(name, initializer2, params) {
|
|
|
40
40
|
initializer2(inst, def);
|
|
41
41
|
const proto = _2.prototype;
|
|
42
42
|
const keys = Object.keys(proto);
|
|
43
|
-
for (let
|
|
44
|
-
const
|
|
45
|
-
if (!(
|
|
46
|
-
inst[
|
|
43
|
+
for (let i = 0; i < keys.length; i++) {
|
|
44
|
+
const k = keys[i];
|
|
45
|
+
if (!(k in inst)) {
|
|
46
|
+
inst[k] = proto[k].bind(inst);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -88,8 +88,8 @@ function config(newConfig) {
|
|
|
88
88
|
return globalConfig;
|
|
89
89
|
}
|
|
90
90
|
function getEnumValues(entries) {
|
|
91
|
-
const numericValues = Object.values(entries).filter((
|
|
92
|
-
const values = Object.entries(entries).filter(([
|
|
91
|
+
const numericValues = Object.values(entries).filter((v2) => typeof v2 === "number");
|
|
92
|
+
const values = Object.entries(entries).filter(([k, _2]) => numericValues.indexOf(+k) === -1).map(([_2, v2]) => v2);
|
|
93
93
|
return values;
|
|
94
94
|
}
|
|
95
95
|
function jsonStringifyReplacer(_2, value) {
|
|
@@ -145,9 +145,9 @@ function defineLazy(object2, key, getter) {
|
|
|
145
145
|
}
|
|
146
146
|
return value;
|
|
147
147
|
},
|
|
148
|
-
set(
|
|
148
|
+
set(v2) {
|
|
149
149
|
Object.defineProperty(object2, key, {
|
|
150
|
-
value:
|
|
150
|
+
value: v2
|
|
151
151
|
// configurable: true,
|
|
152
152
|
});
|
|
153
153
|
},
|
|
@@ -243,8 +243,8 @@ function normalizeParams(_params) {
|
|
|
243
243
|
return params;
|
|
244
244
|
}
|
|
245
245
|
function optionalKeys(shape) {
|
|
246
|
-
return Object.keys(shape).filter((
|
|
247
|
-
return shape[
|
|
246
|
+
return Object.keys(shape).filter((k) => {
|
|
247
|
+
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
const NUMBER_FORMAT_RANGES = {
|
|
@@ -407,11 +407,11 @@ function required(Class, schema, mask) {
|
|
|
407
407
|
});
|
|
408
408
|
return clone(schema, def);
|
|
409
409
|
}
|
|
410
|
-
function aborted(
|
|
411
|
-
if (
|
|
410
|
+
function aborted(x, startIndex = 0) {
|
|
411
|
+
if (x.aborted === true)
|
|
412
412
|
return true;
|
|
413
|
-
for (let
|
|
414
|
-
if (
|
|
413
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
414
|
+
if (x.issues[i]?.continue !== true) {
|
|
415
415
|
return true;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
@@ -505,10 +505,10 @@ function formatError(error, mapper = (issue2) => issue2.message) {
|
|
|
505
505
|
fieldErrors._errors.push(mapper(issue2));
|
|
506
506
|
} else {
|
|
507
507
|
let curr = fieldErrors;
|
|
508
|
-
let
|
|
509
|
-
while (
|
|
510
|
-
const el = issue2.path[
|
|
511
|
-
const terminal =
|
|
508
|
+
let i = 0;
|
|
509
|
+
while (i < issue2.path.length) {
|
|
510
|
+
const el = issue2.path[i];
|
|
511
|
+
const terminal = i === issue2.path.length - 1;
|
|
512
512
|
if (!terminal) {
|
|
513
513
|
curr[el] = curr[el] || { _errors: [] };
|
|
514
514
|
} else {
|
|
@@ -516,7 +516,7 @@ function formatError(error, mapper = (issue2) => issue2.message) {
|
|
|
516
516
|
curr[el]._errors.push(mapper(issue2));
|
|
517
517
|
}
|
|
518
518
|
curr = curr[el];
|
|
519
|
-
|
|
519
|
+
i++;
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
}
|
|
@@ -626,7 +626,7 @@ const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z
|
|
|
626
626
|
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
627
627
|
const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
628
628
|
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
629
|
-
const date$
|
|
629
|
+
const date$3 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
630
630
|
function timeSource(args) {
|
|
631
631
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
632
632
|
const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
@@ -1058,9 +1058,9 @@ class Doc {
|
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
1060
|
const content = arg;
|
|
1061
|
-
const lines = content.split("\n").filter((
|
|
1062
|
-
const minIndent = Math.min(...lines.map((
|
|
1063
|
-
const dedented = lines.map((
|
|
1061
|
+
const lines = content.split("\n").filter((x) => x);
|
|
1062
|
+
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
|
|
1063
|
+
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
1064
1064
|
for (const line of dedented) {
|
|
1065
1065
|
this.content.push(line);
|
|
1066
1066
|
}
|
|
@@ -1069,7 +1069,7 @@ class Doc {
|
|
|
1069
1069
|
const F2 = Function;
|
|
1070
1070
|
const args = this?.args;
|
|
1071
1071
|
const content = this?.content ?? [``];
|
|
1072
|
-
const lines = [...content.map((
|
|
1072
|
+
const lines = [...content.map((x) => ` ${x}`)];
|
|
1073
1073
|
return new F2(...args, lines.join("\n"));
|
|
1074
1074
|
}
|
|
1075
1075
|
}
|
|
@@ -1177,10 +1177,10 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1177
1177
|
inst["~standard"] = {
|
|
1178
1178
|
validate: (value) => {
|
|
1179
1179
|
try {
|
|
1180
|
-
const
|
|
1181
|
-
return
|
|
1180
|
+
const r2 = safeParse$1(inst, value);
|
|
1181
|
+
return r2.success ? { value: r2.data } : { issues: r2.error?.issues };
|
|
1182
1182
|
} catch (_2) {
|
|
1183
|
-
return safeParseAsync$1(inst, value).then((
|
|
1183
|
+
return safeParseAsync$1(inst, value).then((r2) => r2.success ? { value: r2.data } : { issues: r2.error?.issues });
|
|
1184
1184
|
}
|
|
1185
1185
|
},
|
|
1186
1186
|
vendor: "zod",
|
|
@@ -1227,10 +1227,10 @@ const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
|
|
|
1227
1227
|
v7: 7,
|
|
1228
1228
|
v8: 8
|
|
1229
1229
|
};
|
|
1230
|
-
const
|
|
1231
|
-
if (
|
|
1230
|
+
const v2 = versionMap[def.version];
|
|
1231
|
+
if (v2 === void 0)
|
|
1232
1232
|
throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
1233
|
-
def.pattern ?? (def.pattern = uuid$1(
|
|
1233
|
+
def.pattern ?? (def.pattern = uuid$1(v2));
|
|
1234
1234
|
} else
|
|
1235
1235
|
def.pattern ?? (def.pattern = uuid$1());
|
|
1236
1236
|
$ZodStringFormat.init(inst, def);
|
|
@@ -1323,7 +1323,7 @@ const $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, d
|
|
|
1323
1323
|
$ZodStringFormat.init(inst, def);
|
|
1324
1324
|
});
|
|
1325
1325
|
const $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
1326
|
-
def.pattern ?? (def.pattern = date$
|
|
1326
|
+
def.pattern ?? (def.pattern = date$3);
|
|
1327
1327
|
$ZodStringFormat.init(inst, def);
|
|
1328
1328
|
});
|
|
1329
1329
|
const $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
|
|
@@ -1420,7 +1420,7 @@ const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
1420
1420
|
function isValidBase64URL(data) {
|
|
1421
1421
|
if (!base64url.test(data))
|
|
1422
1422
|
return false;
|
|
1423
|
-
const base642 = data.replace(/[-_]/g, (
|
|
1423
|
+
const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1424
1424
|
const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "=");
|
|
1425
1425
|
return isValidBase64(padded);
|
|
1426
1426
|
}
|
|
@@ -1605,16 +1605,16 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
1605
1605
|
}
|
|
1606
1606
|
payload.value = Array(input.length);
|
|
1607
1607
|
const proms = [];
|
|
1608
|
-
for (let
|
|
1609
|
-
const item = input[
|
|
1608
|
+
for (let i = 0; i < input.length; i++) {
|
|
1609
|
+
const item = input[i];
|
|
1610
1610
|
const result = def.element._zod.run({
|
|
1611
1611
|
value: item,
|
|
1612
1612
|
issues: []
|
|
1613
1613
|
}, ctx);
|
|
1614
1614
|
if (result instanceof Promise) {
|
|
1615
|
-
proms.push(result.then((result2) => handleArrayResult(result2, payload,
|
|
1615
|
+
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
1616
1616
|
} else {
|
|
1617
|
-
handleArrayResult(result, payload,
|
|
1617
|
+
handleArrayResult(result, payload, i);
|
|
1618
1618
|
}
|
|
1619
1619
|
}
|
|
1620
1620
|
if (proms.length) {
|
|
@@ -1637,9 +1637,9 @@ function handlePropertyResult(result, final, key, input) {
|
|
|
1637
1637
|
}
|
|
1638
1638
|
function normalizeDef(def) {
|
|
1639
1639
|
const keys = Object.keys(def.shape);
|
|
1640
|
-
for (const
|
|
1641
|
-
if (!def.shape?.[
|
|
1642
|
-
throw new Error(`Invalid element at key "${
|
|
1640
|
+
for (const k of keys) {
|
|
1641
|
+
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
1642
|
+
throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
1643
1643
|
}
|
|
1644
1644
|
}
|
|
1645
1645
|
const okeys = optionalKeys(def.shape);
|
|
@@ -1663,11 +1663,11 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
1663
1663
|
unrecognized.push(key);
|
|
1664
1664
|
continue;
|
|
1665
1665
|
}
|
|
1666
|
-
const
|
|
1667
|
-
if (
|
|
1668
|
-
proms.push(
|
|
1666
|
+
const r2 = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
1667
|
+
if (r2 instanceof Promise) {
|
|
1668
|
+
proms.push(r2.then((r3) => handlePropertyResult(r3, payload, key, input)));
|
|
1669
1669
|
} else {
|
|
1670
|
-
handlePropertyResult(
|
|
1670
|
+
handlePropertyResult(r2, payload, key, input);
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
1673
|
if (unrecognized.length) {
|
|
@@ -1707,8 +1707,8 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
1707
1707
|
const field = shape[key]._zod;
|
|
1708
1708
|
if (field.values) {
|
|
1709
1709
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
1710
|
-
for (const
|
|
1711
|
-
propValues[key].add(
|
|
1710
|
+
for (const v2 of field.values)
|
|
1711
|
+
propValues[key].add(v2);
|
|
1712
1712
|
}
|
|
1713
1713
|
}
|
|
1714
1714
|
return propValues;
|
|
@@ -1733,11 +1733,11 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
1733
1733
|
const shape = value.shape;
|
|
1734
1734
|
for (const key of value.keys) {
|
|
1735
1735
|
const el = shape[key];
|
|
1736
|
-
const
|
|
1737
|
-
if (
|
|
1738
|
-
proms.push(
|
|
1736
|
+
const r2 = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1737
|
+
if (r2 instanceof Promise) {
|
|
1738
|
+
proms.push(r2.then((r3) => handlePropertyResult(r3, payload, key, input)));
|
|
1739
1739
|
} else {
|
|
1740
|
-
handlePropertyResult(
|
|
1740
|
+
handlePropertyResult(r2, payload, key, input);
|
|
1741
1741
|
}
|
|
1742
1742
|
}
|
|
1743
1743
|
if (!catchall) {
|
|
@@ -1754,8 +1754,8 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
|
|
|
1754
1754
|
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
1755
1755
|
const normalized = _normalized.value;
|
|
1756
1756
|
const parseStr = (key) => {
|
|
1757
|
-
const
|
|
1758
|
-
return `shape[${
|
|
1757
|
+
const k = esc(key);
|
|
1758
|
+
return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
1759
1759
|
};
|
|
1760
1760
|
doc.write(`const input = payload.value;`);
|
|
1761
1761
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
@@ -1766,23 +1766,23 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
|
|
|
1766
1766
|
doc.write(`const newResult = {};`);
|
|
1767
1767
|
for (const key of normalized.keys) {
|
|
1768
1768
|
const id = ids[key];
|
|
1769
|
-
const
|
|
1769
|
+
const k = esc(key);
|
|
1770
1770
|
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
1771
1771
|
doc.write(`
|
|
1772
1772
|
if (${id}.issues.length) {
|
|
1773
1773
|
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
1774
1774
|
...iss,
|
|
1775
|
-
path: iss.path ? [${
|
|
1775
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
1776
1776
|
})));
|
|
1777
1777
|
}
|
|
1778
1778
|
|
|
1779
1779
|
|
|
1780
1780
|
if (${id}.value === undefined) {
|
|
1781
|
-
if (${
|
|
1782
|
-
newResult[${
|
|
1781
|
+
if (${k} in input) {
|
|
1782
|
+
newResult[${k}] = undefined;
|
|
1783
1783
|
}
|
|
1784
1784
|
} else {
|
|
1785
|
-
newResult[${
|
|
1785
|
+
newResult[${k}] = ${id}.value;
|
|
1786
1786
|
}
|
|
1787
1787
|
|
|
1788
1788
|
`);
|
|
@@ -1829,7 +1829,7 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
1829
1829
|
return final;
|
|
1830
1830
|
}
|
|
1831
1831
|
}
|
|
1832
|
-
const nonaborted = results.filter((
|
|
1832
|
+
const nonaborted = results.filter((r2) => !aborted(r2));
|
|
1833
1833
|
if (nonaborted.length === 1) {
|
|
1834
1834
|
final.value = nonaborted[0].value;
|
|
1835
1835
|
return nonaborted[0];
|
|
@@ -2066,7 +2066,7 @@ const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
2066
2066
|
const values = getEnumValues(def.entries);
|
|
2067
2067
|
const valuesSet = new Set(values);
|
|
2068
2068
|
inst._zod.values = valuesSet;
|
|
2069
|
-
inst._zod.pattern = new RegExp(`^(${values.filter((
|
|
2069
|
+
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2.toString()).join("|")})$`);
|
|
2070
2070
|
inst._zod.parse = (payload, _ctx) => {
|
|
2071
2071
|
const input = payload.value;
|
|
2072
2072
|
if (valuesSet.has(input)) {
|
|
@@ -2123,7 +2123,7 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
|
|
|
2123
2123
|
if (def.innerType._zod.optin === "optional") {
|
|
2124
2124
|
const result = def.innerType._zod.run(payload, ctx);
|
|
2125
2125
|
if (result instanceof Promise)
|
|
2126
|
-
return result.then((
|
|
2126
|
+
return result.then((r2) => handleOptionalResult(r2, payload.value));
|
|
2127
2127
|
return handleOptionalResult(result, payload.value);
|
|
2128
2128
|
}
|
|
2129
2129
|
if (payload.value === void 0) {
|
|
@@ -2191,8 +2191,8 @@ const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) =>
|
|
|
2191
2191
|
const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
|
|
2192
2192
|
$ZodType.init(inst, def);
|
|
2193
2193
|
defineLazy(inst._zod, "values", () => {
|
|
2194
|
-
const
|
|
2195
|
-
return
|
|
2194
|
+
const v2 = def.innerType._zod.values;
|
|
2195
|
+
return v2 ? new Set([...v2].filter((x) => x !== void 0)) : void 0;
|
|
2196
2196
|
});
|
|
2197
2197
|
inst._zod.parse = (payload, ctx) => {
|
|
2198
2198
|
const result = def.innerType._zod.run(payload, ctx);
|
|
@@ -2310,11 +2310,11 @@ const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
2310
2310
|
};
|
|
2311
2311
|
inst._zod.check = (payload) => {
|
|
2312
2312
|
const input = payload.value;
|
|
2313
|
-
const
|
|
2314
|
-
if (
|
|
2315
|
-
return
|
|
2313
|
+
const r2 = def.fn(input);
|
|
2314
|
+
if (r2 instanceof Promise) {
|
|
2315
|
+
return r2.then((r3) => handleRefineResult(r3, payload, input, inst));
|
|
2316
2316
|
}
|
|
2317
|
-
handleRefineResult(
|
|
2317
|
+
handleRefineResult(r2, payload, input, inst);
|
|
2318
2318
|
return;
|
|
2319
2319
|
};
|
|
2320
2320
|
});
|
|
@@ -2370,8 +2370,8 @@ class $ZodRegistry {
|
|
|
2370
2370
|
if (p2) {
|
|
2371
2371
|
const pm = { ...this.get(p2) ?? {} };
|
|
2372
2372
|
delete pm.id;
|
|
2373
|
-
const
|
|
2374
|
-
return Object.keys(
|
|
2373
|
+
const f = { ...pm, ...this._map.get(schema) };
|
|
2374
|
+
return Object.keys(f).length ? f : void 0;
|
|
2375
2375
|
}
|
|
2376
2376
|
return this._map.get(schema);
|
|
2377
2377
|
}
|
|
@@ -2680,6 +2680,13 @@ function _date(Class, params) {
|
|
|
2680
2680
|
...normalizeParams(params)
|
|
2681
2681
|
});
|
|
2682
2682
|
}
|
|
2683
|
+
function _coercedDate(Class, params) {
|
|
2684
|
+
return new Class({
|
|
2685
|
+
type: "date",
|
|
2686
|
+
coerce: true,
|
|
2687
|
+
...normalizeParams(params)
|
|
2688
|
+
});
|
|
2689
|
+
}
|
|
2683
2690
|
function _lt(value, params) {
|
|
2684
2691
|
return new $ZodCheckLessThan({
|
|
2685
2692
|
check: "less_than",
|
|
@@ -3262,9 +3269,9 @@ const dateProcessor = (_schema, ctx, _json, _params) => {
|
|
|
3262
3269
|
const enumProcessor = (schema, _ctx, json, _params) => {
|
|
3263
3270
|
const def = schema._zod.def;
|
|
3264
3271
|
const values = getEnumValues(def.entries);
|
|
3265
|
-
if (values.every((
|
|
3272
|
+
if (values.every((v2) => typeof v2 === "number"))
|
|
3266
3273
|
json.type = "number";
|
|
3267
|
-
if (values.every((
|
|
3274
|
+
if (values.every((v2) => typeof v2 === "string"))
|
|
3268
3275
|
json.type = "string";
|
|
3269
3276
|
json.enum = values;
|
|
3270
3277
|
};
|
|
@@ -3303,11 +3310,11 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
3303
3310
|
}
|
|
3304
3311
|
const allKeys = new Set(Object.keys(shape));
|
|
3305
3312
|
const requiredKeys = new Set([...allKeys].filter((key) => {
|
|
3306
|
-
const
|
|
3313
|
+
const v2 = def.shape[key]._zod;
|
|
3307
3314
|
if (ctx.io === "input") {
|
|
3308
|
-
return
|
|
3315
|
+
return v2.optin === void 0;
|
|
3309
3316
|
} else {
|
|
3310
|
-
return
|
|
3317
|
+
return v2.optout === void 0;
|
|
3311
3318
|
}
|
|
3312
3319
|
}));
|
|
3313
3320
|
if (requiredKeys.size > 0) {
|
|
@@ -3328,9 +3335,9 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
3328
3335
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
3329
3336
|
const def = schema._zod.def;
|
|
3330
3337
|
const isExclusive = def.inclusive === false;
|
|
3331
|
-
const options = def.options.map((
|
|
3338
|
+
const options = def.options.map((x, i) => process$1(x, ctx, {
|
|
3332
3339
|
...params,
|
|
3333
|
-
path: [...params.path, isExclusive ? "oneOf" : "anyOf",
|
|
3340
|
+
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
3334
3341
|
}));
|
|
3335
3342
|
if (isExclusive) {
|
|
3336
3343
|
json.oneOf = options;
|
|
@@ -3446,7 +3453,7 @@ const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
|
3446
3453
|
$ZodISODate.init(inst, def);
|
|
3447
3454
|
ZodStringFormat.init(inst, def);
|
|
3448
3455
|
});
|
|
3449
|
-
function date$
|
|
3456
|
+
function date$2(params) {
|
|
3450
3457
|
return _isoDate(ZodISODate, params);
|
|
3451
3458
|
}
|
|
3452
3459
|
const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
@@ -3641,7 +3648,7 @@ const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
|
3641
3648
|
inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
|
|
3642
3649
|
inst.e164 = (params) => inst.check(_e164(ZodE164, params));
|
|
3643
3650
|
inst.datetime = (params) => inst.check(datetime(params));
|
|
3644
|
-
inst.date = (params) => inst.check(date$
|
|
3651
|
+
inst.date = (params) => inst.check(date$2(params));
|
|
3645
3652
|
inst.time = (params) => inst.check(time(params));
|
|
3646
3653
|
inst.duration = (params) => inst.check(duration(params));
|
|
3647
3654
|
});
|
|
@@ -3805,11 +3812,11 @@ const ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
|
|
|
3805
3812
|
inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx);
|
|
3806
3813
|
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
3807
3814
|
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
3808
|
-
const
|
|
3809
|
-
inst.minDate =
|
|
3810
|
-
inst.maxDate =
|
|
3815
|
+
const c = inst._zod.bag;
|
|
3816
|
+
inst.minDate = c.minimum ? new Date(c.minimum) : null;
|
|
3817
|
+
inst.maxDate = c.maximum ? new Date(c.maximum) : null;
|
|
3811
3818
|
});
|
|
3812
|
-
function date(params) {
|
|
3819
|
+
function date$1(params) {
|
|
3813
3820
|
return _date(ZodDate, params);
|
|
3814
3821
|
}
|
|
3815
3822
|
const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
@@ -3938,7 +3945,7 @@ const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
3938
3945
|
};
|
|
3939
3946
|
});
|
|
3940
3947
|
function _enum(values, params) {
|
|
3941
|
-
const entries = Array.isArray(values) ? Object.fromEntries(values.map((
|
|
3948
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v2) => [v2, v2])) : values;
|
|
3942
3949
|
return new ZodEnum({
|
|
3943
3950
|
type: "enum",
|
|
3944
3951
|
entries,
|
|
@@ -4106,6 +4113,9 @@ function superRefine(fn) {
|
|
|
4106
4113
|
function number(params) {
|
|
4107
4114
|
return _coercedNumber(ZodNumber, params);
|
|
4108
4115
|
}
|
|
4116
|
+
function date(params) {
|
|
4117
|
+
return _coercedDate(ZodDate, params);
|
|
4118
|
+
}
|
|
4109
4119
|
const t$1 = [
|
|
4110
4120
|
"TOP_GAINERS",
|
|
4111
4121
|
"VOLUME_SHOCKERS"
|
|
@@ -4159,15 +4169,15 @@ const S = object({
|
|
|
4159
4169
|
volume: number$1().nullable(),
|
|
4160
4170
|
week_52_high: number$1().nullable(),
|
|
4161
4171
|
week_52_low: number$1().nullable()
|
|
4162
|
-
}),
|
|
4172
|
+
}), r = object({
|
|
4163
4173
|
status: _enum(["SUCCESS", "FAILURE"]),
|
|
4164
4174
|
payload: S
|
|
4165
|
-
}),
|
|
4175
|
+
}), v = object({
|
|
4166
4176
|
nseSymbol: string(),
|
|
4167
4177
|
name: string(),
|
|
4168
4178
|
price: number$1(),
|
|
4169
|
-
quoteData:
|
|
4170
|
-
}),
|
|
4179
|
+
quoteData: r.nullable().optional()
|
|
4180
|
+
}), u = _enum(o$1), t = object({
|
|
4171
4181
|
statusCode: number$1(),
|
|
4172
4182
|
message: string(),
|
|
4173
4183
|
data: unknown()
|
|
@@ -4190,37 +4200,37 @@ const b = [
|
|
|
4190
4200
|
"1day",
|
|
4191
4201
|
"1week",
|
|
4192
4202
|
"1month"
|
|
4193
|
-
],
|
|
4203
|
+
], o = string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/, {
|
|
4194
4204
|
message: "datetime must be in format YYYY-MM-DDTHH:mm:ss (e.g., 2025-12-26T11:06:00)"
|
|
4195
4205
|
}).refine(
|
|
4196
|
-
(
|
|
4197
|
-
const
|
|
4198
|
-
return !isNaN(
|
|
4206
|
+
(s) => {
|
|
4207
|
+
const c = new Date(s);
|
|
4208
|
+
return !isNaN(c.getTime());
|
|
4199
4209
|
},
|
|
4200
4210
|
{
|
|
4201
4211
|
message: "datetime must be a valid date and time"
|
|
4202
4212
|
}
|
|
4203
|
-
),
|
|
4213
|
+
), n = string().regex(/^\d{4}-\d{2}-\d{2}$/, {
|
|
4204
4214
|
message: "date must be in format YYYY-MM-DD (e.g., 2025-12-26)"
|
|
4205
4215
|
}).refine(
|
|
4206
|
-
(
|
|
4207
|
-
const
|
|
4208
|
-
return !isNaN(
|
|
4216
|
+
(s) => {
|
|
4217
|
+
const c = new Date(s);
|
|
4218
|
+
return !isNaN(c.getTime());
|
|
4209
4219
|
},
|
|
4210
4220
|
{
|
|
4211
4221
|
message: "date must be a valid date"
|
|
4212
4222
|
}
|
|
4213
|
-
),
|
|
4223
|
+
), a = string().regex(/^([A-Za-z_]+\/[A-Za-z_]+|[+-]\d{2}:\d{2})$/, {
|
|
4214
4224
|
message: "timezone must be an IANA identifier (e.g., 'Asia/Kolkata') or offset (e.g., '+05:30')"
|
|
4215
4225
|
}).refine(
|
|
4216
|
-
(
|
|
4217
|
-
if (
|
|
4226
|
+
(s) => {
|
|
4227
|
+
if (s.includes("/"))
|
|
4218
4228
|
try {
|
|
4219
|
-
return new Intl.DateTimeFormat("en-US", { timeZone:
|
|
4229
|
+
return new Intl.DateTimeFormat("en-US", { timeZone: s }), true;
|
|
4220
4230
|
} catch {
|
|
4221
4231
|
return false;
|
|
4222
4232
|
}
|
|
4223
|
-
return /^([+-]\d{2}:\d{2})$/.test(
|
|
4233
|
+
return /^([+-]\d{2}:\d{2})$/.test(s);
|
|
4224
4234
|
},
|
|
4225
4235
|
{
|
|
4226
4236
|
message: "timezone must be a valid IANA identifier or UTC offset"
|
|
@@ -4229,17 +4239,17 @@ const b = [
|
|
|
4229
4239
|
nseSymbol: string(),
|
|
4230
4240
|
name: string(),
|
|
4231
4241
|
price: number$1(),
|
|
4232
|
-
quoteData:
|
|
4233
|
-
}),
|
|
4242
|
+
quoteData: r.nullable().optional()
|
|
4243
|
+
}), d = _enum(["TOP_GAINERS", "VOLUME_SHOCKERS"]), g = _enum(o$1), _ = object({
|
|
4234
4244
|
nseSymbol: string(),
|
|
4235
|
-
quoteData:
|
|
4245
|
+
quoteData: r
|
|
4236
4246
|
});
|
|
4237
4247
|
({
|
|
4238
4248
|
body: object({
|
|
4239
4249
|
data: object({
|
|
4240
|
-
timestamp:
|
|
4241
|
-
timezone:
|
|
4242
|
-
shortlistType:
|
|
4250
|
+
timestamp: o,
|
|
4251
|
+
timezone: a.optional(),
|
|
4252
|
+
shortlistType: d,
|
|
4243
4253
|
entries: array(p),
|
|
4244
4254
|
scope: g.optional()
|
|
4245
4255
|
})
|
|
@@ -4249,7 +4259,7 @@ const b = [
|
|
|
4249
4259
|
id: string(),
|
|
4250
4260
|
timestamp: string(),
|
|
4251
4261
|
// Format: YYYY-MM-DDTHH:mm:ss (UTC)
|
|
4252
|
-
shortlistType:
|
|
4262
|
+
shortlistType: d,
|
|
4253
4263
|
entriesCount: number$1()
|
|
4254
4264
|
})
|
|
4255
4265
|
})
|
|
@@ -4257,8 +4267,8 @@ const b = [
|
|
|
4257
4267
|
({
|
|
4258
4268
|
body: object({
|
|
4259
4269
|
data: object({
|
|
4260
|
-
timestamp:
|
|
4261
|
-
timezone:
|
|
4270
|
+
timestamp: o,
|
|
4271
|
+
timezone: a.optional(),
|
|
4262
4272
|
quotes: array(_)
|
|
4263
4273
|
})
|
|
4264
4274
|
}),
|
|
@@ -4273,9 +4283,9 @@ const b = [
|
|
|
4273
4283
|
({
|
|
4274
4284
|
body: object({
|
|
4275
4285
|
data: object({
|
|
4276
|
-
timestamp:
|
|
4277
|
-
timezone:
|
|
4278
|
-
quoteData:
|
|
4286
|
+
timestamp: o,
|
|
4287
|
+
timezone: a.optional(),
|
|
4288
|
+
quoteData: r,
|
|
4279
4289
|
dayChangePerc: number$1()
|
|
4280
4290
|
})
|
|
4281
4291
|
}),
|
|
@@ -4288,6 +4298,17 @@ const b = [
|
|
|
4288
4298
|
})
|
|
4289
4299
|
})
|
|
4290
4300
|
});
|
|
4301
|
+
({
|
|
4302
|
+
query: object({
|
|
4303
|
+
date: n
|
|
4304
|
+
}),
|
|
4305
|
+
response: t.extend({
|
|
4306
|
+
data: object({
|
|
4307
|
+
isHoliday: boolean(),
|
|
4308
|
+
date: n
|
|
4309
|
+
})
|
|
4310
|
+
})
|
|
4311
|
+
});
|
|
4291
4312
|
const y = object({
|
|
4292
4313
|
status: _enum(["SUCCESS", "FAILURE"]),
|
|
4293
4314
|
payload: object({
|
|
@@ -4300,13 +4321,13 @@ const y = object({
|
|
|
4300
4321
|
end_time: string(),
|
|
4301
4322
|
interval_in_minutes: number$1()
|
|
4302
4323
|
})
|
|
4303
|
-
}),
|
|
4324
|
+
}), O = {
|
|
4304
4325
|
query: object({
|
|
4305
4326
|
symbol: string(),
|
|
4306
4327
|
interval: _enum(b),
|
|
4307
|
-
start_datetime:
|
|
4308
|
-
end_datetime:
|
|
4309
|
-
timezone:
|
|
4328
|
+
start_datetime: o,
|
|
4329
|
+
end_datetime: o,
|
|
4330
|
+
timezone: a.optional()
|
|
4310
4331
|
}),
|
|
4311
4332
|
response: t.extend({
|
|
4312
4333
|
data: y
|
|
@@ -4316,21 +4337,21 @@ const y = object({
|
|
|
4316
4337
|
symbol: string(),
|
|
4317
4338
|
exchange: _enum(["NSE", "BSE"]).optional(),
|
|
4318
4339
|
segment: _enum(["CASH"]).optional(),
|
|
4319
|
-
datetime:
|
|
4320
|
-
timezone:
|
|
4340
|
+
datetime: o.optional(),
|
|
4341
|
+
timezone: a.optional()
|
|
4321
4342
|
}),
|
|
4322
4343
|
response: t.extend({
|
|
4323
|
-
data:
|
|
4344
|
+
data: r.nullable()
|
|
4324
4345
|
})
|
|
4325
|
-
},
|
|
4346
|
+
}, z = {
|
|
4326
4347
|
response: t.extend({
|
|
4327
4348
|
data: string()
|
|
4328
4349
|
})
|
|
4329
4350
|
}, w = {
|
|
4330
4351
|
query: object({
|
|
4331
4352
|
symbol: string(),
|
|
4332
|
-
end_datetime:
|
|
4333
|
-
timezone:
|
|
4353
|
+
end_datetime: o,
|
|
4354
|
+
timezone: a.optional()
|
|
4334
4355
|
}),
|
|
4335
4356
|
response: t.extend({
|
|
4336
4357
|
data: object({
|
|
@@ -4340,7 +4361,7 @@ const y = object({
|
|
|
4340
4361
|
timestamp: string(),
|
|
4341
4362
|
// Format: YYYY-MM-DDTHH:mm:ss (UTC)
|
|
4342
4363
|
nseSymbol: string(),
|
|
4343
|
-
quoteData:
|
|
4364
|
+
quoteData: r,
|
|
4344
4365
|
createdAt: string(),
|
|
4345
4366
|
// Format: YYYY-MM-DDTHH:mm:ss (UTC)
|
|
4346
4367
|
updatedAt: string()
|
|
@@ -4349,10 +4370,10 @@ const y = object({
|
|
|
4349
4370
|
)
|
|
4350
4371
|
})
|
|
4351
4372
|
})
|
|
4352
|
-
},
|
|
4373
|
+
}, A = {
|
|
4353
4374
|
query: object({
|
|
4354
|
-
end_datetime:
|
|
4355
|
-
timezone:
|
|
4375
|
+
end_datetime: o,
|
|
4376
|
+
timezone: a.optional()
|
|
4356
4377
|
}),
|
|
4357
4378
|
response: t.extend({
|
|
4358
4379
|
data: object({
|
|
@@ -4361,7 +4382,7 @@ const y = object({
|
|
|
4361
4382
|
id: string(),
|
|
4362
4383
|
timestamp: string(),
|
|
4363
4384
|
// Format: YYYY-MM-DDTHH:mm:ss (UTC)
|
|
4364
|
-
quoteData:
|
|
4385
|
+
quoteData: r,
|
|
4365
4386
|
createdAt: string(),
|
|
4366
4387
|
// Format: YYYY-MM-DDTHH:mm:ss (UTC)
|
|
4367
4388
|
updatedAt: string()
|
|
@@ -4370,48 +4391,48 @@ const y = object({
|
|
|
4370
4391
|
)
|
|
4371
4392
|
})
|
|
4372
4393
|
})
|
|
4373
|
-
},
|
|
4394
|
+
}, D = {
|
|
4374
4395
|
query: object({
|
|
4375
|
-
datetime:
|
|
4376
|
-
timezone:
|
|
4396
|
+
datetime: o.optional(),
|
|
4397
|
+
timezone: a.optional()
|
|
4377
4398
|
}),
|
|
4378
4399
|
response: t.extend({
|
|
4379
|
-
data:
|
|
4400
|
+
data: r.nullable()
|
|
4380
4401
|
})
|
|
4381
|
-
},
|
|
4402
|
+
}, Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4382
4403
|
__proto__: null,
|
|
4383
|
-
getGrowwHistoricalCandles:
|
|
4384
|
-
getGrowwNiftyQuote:
|
|
4385
|
-
getGrowwNiftyQuoteTimeline:
|
|
4404
|
+
getGrowwHistoricalCandles: O,
|
|
4405
|
+
getGrowwNiftyQuote: D,
|
|
4406
|
+
getGrowwNiftyQuoteTimeline: A,
|
|
4386
4407
|
getGrowwQuote: q,
|
|
4387
4408
|
getGrowwQuoteTimeline: w,
|
|
4388
|
-
getGrowwToken:
|
|
4409
|
+
getGrowwToken: z,
|
|
4389
4410
|
growwHistoricalCandlesSchema: y
|
|
4390
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4411
|
+
}, Symbol.toStringTag, { value: "Module" })), j = object({
|
|
4391
4412
|
name: string(),
|
|
4392
4413
|
price: number$1(),
|
|
4393
4414
|
nseSymbol: string()
|
|
4394
|
-
}),
|
|
4415
|
+
}), M = {
|
|
4395
4416
|
query: object({
|
|
4396
4417
|
type: _enum(["top-gainers", "volume-shockers"]),
|
|
4397
|
-
datetime:
|
|
4398
|
-
timezone:
|
|
4399
|
-
scope:
|
|
4418
|
+
datetime: o.optional(),
|
|
4419
|
+
timezone: a.optional(),
|
|
4420
|
+
scope: u.optional()
|
|
4400
4421
|
}),
|
|
4401
4422
|
response: t.extend({
|
|
4402
|
-
data: array(
|
|
4423
|
+
data: array(j).nullable()
|
|
4403
4424
|
})
|
|
4404
|
-
},
|
|
4425
|
+
}, Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4405
4426
|
__proto__: null,
|
|
4406
|
-
getLists:
|
|
4407
|
-
listSchema:
|
|
4408
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4427
|
+
getLists: M,
|
|
4428
|
+
listSchema: j
|
|
4429
|
+
}, Symbol.toStringTag, { value: "Module" })), C = {
|
|
4409
4430
|
query: object({
|
|
4410
4431
|
type: _enum(["top-gainers", "volume-shockers"]),
|
|
4411
|
-
start_datetime:
|
|
4412
|
-
end_datetime:
|
|
4413
|
-
timezone:
|
|
4414
|
-
scope:
|
|
4432
|
+
start_datetime: o,
|
|
4433
|
+
end_datetime: o,
|
|
4434
|
+
timezone: a.optional(),
|
|
4435
|
+
scope: u.optional()
|
|
4415
4436
|
}),
|
|
4416
4437
|
response: t.extend({
|
|
4417
4438
|
data: object({
|
|
@@ -4430,10 +4451,40 @@ const y = object({
|
|
|
4430
4451
|
)
|
|
4431
4452
|
})
|
|
4432
4453
|
})
|
|
4433
|
-
},
|
|
4454
|
+
}, ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4434
4455
|
__proto__: null,
|
|
4435
|
-
getShortlistPersistence:
|
|
4436
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
4456
|
+
getShortlistPersistence: C
|
|
4457
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4458
|
+
({
|
|
4459
|
+
query: object({}),
|
|
4460
|
+
response: t.extend({
|
|
4461
|
+
data: object({
|
|
4462
|
+
dates: array(
|
|
4463
|
+
object({
|
|
4464
|
+
date: string(),
|
|
4465
|
+
// Format: YYYY-MM-DD
|
|
4466
|
+
timestamps: array(string())
|
|
4467
|
+
// Format: YYYY-MM-DDTHH:mm:ss (UTC)
|
|
4468
|
+
})
|
|
4469
|
+
)
|
|
4470
|
+
})
|
|
4471
|
+
})
|
|
4472
|
+
});
|
|
4473
|
+
({
|
|
4474
|
+
response: t.extend({
|
|
4475
|
+
data: object({
|
|
4476
|
+
holidays: array(
|
|
4477
|
+
object({
|
|
4478
|
+
id: string().uuid(),
|
|
4479
|
+
date: n,
|
|
4480
|
+
createdAt: date(),
|
|
4481
|
+
updatedAt: date()
|
|
4482
|
+
})
|
|
4483
|
+
)
|
|
4484
|
+
})
|
|
4485
|
+
})
|
|
4486
|
+
});
|
|
4487
|
+
const E = {
|
|
4437
4488
|
query: object({}),
|
|
4438
4489
|
response: t.extend({
|
|
4439
4490
|
data: object({
|
|
@@ -4447,13 +4498,13 @@ const y = object({
|
|
|
4447
4498
|
)
|
|
4448
4499
|
})
|
|
4449
4500
|
})
|
|
4450
|
-
},
|
|
4501
|
+
}, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4451
4502
|
__proto__: null,
|
|
4452
|
-
getAvailableDatetimes:
|
|
4453
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4503
|
+
getAvailableDatetimes: E
|
|
4504
|
+
}, Symbol.toStringTag, { value: "Module" })), L = {
|
|
4454
4505
|
query: object({
|
|
4455
4506
|
symbol: string(),
|
|
4456
|
-
date:
|
|
4507
|
+
date: n,
|
|
4457
4508
|
interval: _enum(b).optional()
|
|
4458
4509
|
}),
|
|
4459
4510
|
response: t.extend({
|
|
@@ -4472,12 +4523,12 @@ const y = object({
|
|
|
4472
4523
|
interval_in_minutes: number$1()
|
|
4473
4524
|
})
|
|
4474
4525
|
})
|
|
4475
|
-
},
|
|
4526
|
+
}, I = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4476
4527
|
__proto__: null,
|
|
4477
|
-
getCandles:
|
|
4478
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4528
|
+
getCandles: L
|
|
4529
|
+
}, Symbol.toStringTag, { value: "Module" })), N = {
|
|
4479
4530
|
query: object({
|
|
4480
|
-
date:
|
|
4531
|
+
date: n,
|
|
4481
4532
|
type: _enum(t$1)
|
|
4482
4533
|
}),
|
|
4483
4534
|
response: t.extend({
|
|
@@ -4495,12 +4546,12 @@ const y = object({
|
|
|
4495
4546
|
)
|
|
4496
4547
|
})
|
|
4497
4548
|
})
|
|
4498
|
-
},
|
|
4549
|
+
}, $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4499
4550
|
__proto__: null,
|
|
4500
|
-
getDailyPersistentCompanies:
|
|
4501
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4551
|
+
getDailyPersistentCompanies: N
|
|
4552
|
+
}, Symbol.toStringTag, { value: "Module" })), G = {
|
|
4502
4553
|
query: object({
|
|
4503
|
-
date:
|
|
4554
|
+
date: n,
|
|
4504
4555
|
type: _enum(t$1)
|
|
4505
4556
|
}),
|
|
4506
4557
|
response: t.extend({
|
|
@@ -4510,26 +4561,26 @@ const y = object({
|
|
|
4510
4561
|
uniqueCount: number$1()
|
|
4511
4562
|
})
|
|
4512
4563
|
})
|
|
4513
|
-
},
|
|
4564
|
+
}, Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4514
4565
|
__proto__: null,
|
|
4515
|
-
getDailyUniqueCompanies:
|
|
4516
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4566
|
+
getDailyUniqueCompanies: G
|
|
4567
|
+
}, Symbol.toStringTag, { value: "Module" })), U = object({
|
|
4517
4568
|
id: uuid(),
|
|
4518
4569
|
username: string()
|
|
4519
|
-
}),
|
|
4570
|
+
}), Y = {
|
|
4520
4571
|
body: object({
|
|
4521
4572
|
developerToken: string().nonempty("Developer token is required")
|
|
4522
4573
|
}),
|
|
4523
4574
|
response: t.extend({
|
|
4524
|
-
data:
|
|
4575
|
+
data: U
|
|
4525
4576
|
})
|
|
4526
|
-
},
|
|
4577
|
+
}, F = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4527
4578
|
__proto__: null,
|
|
4528
|
-
signIn:
|
|
4529
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4579
|
+
signIn: Y
|
|
4580
|
+
}, Symbol.toStringTag, { value: "Module" })), B = {
|
|
4530
4581
|
query: object({
|
|
4531
4582
|
symbol: string(),
|
|
4532
|
-
date:
|
|
4583
|
+
date: n
|
|
4533
4584
|
}),
|
|
4534
4585
|
response: t.extend({
|
|
4535
4586
|
data: object({
|
|
@@ -4539,7 +4590,7 @@ const y = object({
|
|
|
4539
4590
|
timestamp: string(),
|
|
4540
4591
|
// Format: YYYY-MM-DDTHH:mm:ss (UTC)
|
|
4541
4592
|
nseSymbol: string(),
|
|
4542
|
-
quoteData:
|
|
4593
|
+
quoteData: r,
|
|
4543
4594
|
createdAt: string(),
|
|
4544
4595
|
// Format: YYYY-MM-DDTHH:mm:ss (UTC)
|
|
4545
4596
|
updatedAt: string()
|
|
@@ -4548,10 +4599,10 @@ const y = object({
|
|
|
4548
4599
|
)
|
|
4549
4600
|
})
|
|
4550
4601
|
})
|
|
4551
|
-
},
|
|
4602
|
+
}, K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4552
4603
|
__proto__: null,
|
|
4553
|
-
getQuoteTimeline:
|
|
4554
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4604
|
+
getQuoteTimeline: B
|
|
4605
|
+
}, Symbol.toStringTag, { value: "Module" })), Z = object({
|
|
4555
4606
|
id: uuid(),
|
|
4556
4607
|
start_datetime: string(),
|
|
4557
4608
|
end_datetime: string(),
|
|
@@ -4559,15 +4610,15 @@ const y = object({
|
|
|
4559
4610
|
orderCount: number$1(),
|
|
4560
4611
|
name: string().nullable().optional(),
|
|
4561
4612
|
tags: array(string()).optional()
|
|
4562
|
-
}),
|
|
4613
|
+
}), V = record(
|
|
4563
4614
|
string(),
|
|
4564
4615
|
// date string (YYYY-MM-DD)
|
|
4565
|
-
array(
|
|
4566
|
-
),
|
|
4616
|
+
array(Z)
|
|
4617
|
+
), W = {
|
|
4567
4618
|
response: t.extend({
|
|
4568
|
-
data:
|
|
4619
|
+
data: V
|
|
4569
4620
|
})
|
|
4570
|
-
},
|
|
4621
|
+
}, J = object({
|
|
4571
4622
|
id: uuid(),
|
|
4572
4623
|
nseSymbol: string(),
|
|
4573
4624
|
entryPrice: number(),
|
|
@@ -4586,7 +4637,7 @@ const y = object({
|
|
|
4586
4637
|
stopLossHit: boolean().optional(),
|
|
4587
4638
|
stopLossTimestamp: string().optional(),
|
|
4588
4639
|
timeToStopLossMinutes: number$1().optional()
|
|
4589
|
-
}),
|
|
4640
|
+
}), X = {
|
|
4590
4641
|
params: object({
|
|
4591
4642
|
runId: uuid()
|
|
4592
4643
|
}),
|
|
@@ -4594,46 +4645,46 @@ const y = object({
|
|
|
4594
4645
|
targetGainPercentage: number().optional()
|
|
4595
4646
|
}),
|
|
4596
4647
|
response: t.extend({
|
|
4597
|
-
data: array(
|
|
4648
|
+
data: array(J)
|
|
4598
4649
|
})
|
|
4599
|
-
},
|
|
4600
|
-
start_datetime:
|
|
4601
|
-
end_datetime:
|
|
4602
|
-
timezone:
|
|
4650
|
+
}, ee = object({
|
|
4651
|
+
start_datetime: o,
|
|
4652
|
+
end_datetime: o,
|
|
4653
|
+
timezone: a.optional(),
|
|
4603
4654
|
name: string().optional(),
|
|
4604
4655
|
tags: array(string().min(1).max(50)).optional()
|
|
4605
|
-
}),
|
|
4656
|
+
}), te = object({
|
|
4606
4657
|
id: uuid(),
|
|
4607
|
-
start_datetime:
|
|
4608
|
-
end_datetime:
|
|
4658
|
+
start_datetime: o,
|
|
4659
|
+
end_datetime: o,
|
|
4609
4660
|
completed: boolean(),
|
|
4610
4661
|
name: string().nullable().optional(),
|
|
4611
4662
|
tags: array(string()).optional()
|
|
4612
|
-
}),
|
|
4613
|
-
body:
|
|
4663
|
+
}), oe = {
|
|
4664
|
+
body: ee,
|
|
4614
4665
|
response: t.extend({
|
|
4615
|
-
data:
|
|
4666
|
+
data: te
|
|
4616
4667
|
})
|
|
4617
|
-
},
|
|
4668
|
+
}, ne = object({
|
|
4618
4669
|
completed: boolean().optional(),
|
|
4619
4670
|
name: string().nullable().optional(),
|
|
4620
4671
|
tags: array(string().min(1).max(50)).optional()
|
|
4621
|
-
}),
|
|
4672
|
+
}), ae = object({
|
|
4622
4673
|
id: uuid(),
|
|
4623
4674
|
start_datetime: string(),
|
|
4624
4675
|
end_datetime: string(),
|
|
4625
4676
|
completed: boolean(),
|
|
4626
4677
|
name: string().nullable().optional(),
|
|
4627
4678
|
tags: array(string()).optional()
|
|
4628
|
-
}),
|
|
4679
|
+
}), re = {
|
|
4629
4680
|
params: object({
|
|
4630
4681
|
runId: uuid()
|
|
4631
4682
|
}),
|
|
4632
|
-
body:
|
|
4683
|
+
body: ne,
|
|
4633
4684
|
response: t.extend({
|
|
4634
|
-
data:
|
|
4685
|
+
data: ae
|
|
4635
4686
|
})
|
|
4636
|
-
},
|
|
4687
|
+
}, se = {
|
|
4637
4688
|
params: object({
|
|
4638
4689
|
runId: uuid()
|
|
4639
4690
|
}),
|
|
@@ -4642,14 +4693,14 @@ const y = object({
|
|
|
4642
4693
|
id: uuid()
|
|
4643
4694
|
})
|
|
4644
4695
|
})
|
|
4645
|
-
},
|
|
4696
|
+
}, ie = object({
|
|
4646
4697
|
nseSymbol: string(),
|
|
4647
4698
|
entryPrice: number(),
|
|
4648
4699
|
stopLossPrice: number(),
|
|
4649
4700
|
takeProfitPrice: number(),
|
|
4650
|
-
datetime:
|
|
4651
|
-
timezone:
|
|
4652
|
-
}),
|
|
4701
|
+
datetime: o,
|
|
4702
|
+
timezone: a.optional()
|
|
4703
|
+
}), le = object({
|
|
4653
4704
|
id: uuid(),
|
|
4654
4705
|
nseSymbol: string(),
|
|
4655
4706
|
entryPrice: number(),
|
|
@@ -4657,28 +4708,28 @@ const y = object({
|
|
|
4657
4708
|
takeProfitPrice: number(),
|
|
4658
4709
|
datetime: string(),
|
|
4659
4710
|
runId: uuid()
|
|
4660
|
-
}),
|
|
4711
|
+
}), ce = {
|
|
4661
4712
|
params: object({
|
|
4662
4713
|
runId: uuid()
|
|
4663
4714
|
}),
|
|
4664
|
-
body:
|
|
4715
|
+
body: ie,
|
|
4665
4716
|
response: t.extend({
|
|
4666
|
-
data:
|
|
4717
|
+
data: le
|
|
4667
4718
|
})
|
|
4668
|
-
},
|
|
4719
|
+
}, de = {
|
|
4669
4720
|
response: t.extend({
|
|
4670
4721
|
data: array(string())
|
|
4671
4722
|
})
|
|
4672
|
-
},
|
|
4723
|
+
}, ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4673
4724
|
__proto__: null,
|
|
4674
|
-
createOrder:
|
|
4675
|
-
createRun:
|
|
4676
|
-
deleteRun:
|
|
4677
|
-
getRunOrders:
|
|
4678
|
-
getRunTags:
|
|
4679
|
-
getRuns:
|
|
4680
|
-
updateRun:
|
|
4681
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4725
|
+
createOrder: ce,
|
|
4726
|
+
createRun: oe,
|
|
4727
|
+
deleteRun: se,
|
|
4728
|
+
getRunOrders: X,
|
|
4729
|
+
getRunTags: de,
|
|
4730
|
+
getRuns: W,
|
|
4731
|
+
updateRun: re
|
|
4732
|
+
}, Symbol.toStringTag, { value: "Module" })), h = v.extend({
|
|
4682
4733
|
// Target and stop loss prices
|
|
4683
4734
|
targetPrice: number$1().optional(),
|
|
4684
4735
|
stopLossPrice: number$1().optional(),
|
|
@@ -4690,12 +4741,12 @@ const y = object({
|
|
|
4690
4741
|
timeToStopLossMinutes: number$1().optional(),
|
|
4691
4742
|
targetTimestamp: string().optional(),
|
|
4692
4743
|
stopLossTimestamp: string().optional()
|
|
4693
|
-
}),
|
|
4744
|
+
}), me = {
|
|
4694
4745
|
query: object({
|
|
4695
|
-
datetime:
|
|
4696
|
-
timezone:
|
|
4746
|
+
datetime: o,
|
|
4747
|
+
timezone: a.optional(),
|
|
4697
4748
|
type: _enum(t$1),
|
|
4698
|
-
scope:
|
|
4749
|
+
scope: u.optional(),
|
|
4699
4750
|
takeProfitPercentage: number().min(0).optional().default(2),
|
|
4700
4751
|
stopLossPercentage: number().min(0).max(100).optional().default(1.5)
|
|
4701
4752
|
}),
|
|
@@ -4706,24 +4757,24 @@ const y = object({
|
|
|
4706
4757
|
timestamp: string(),
|
|
4707
4758
|
// Format: YYYY-MM-DDTHH:mm:ss (UTC)
|
|
4708
4759
|
shortlistType: _enum(t$1),
|
|
4709
|
-
entries: array(
|
|
4760
|
+
entries: array(h)
|
|
4710
4761
|
}).nullable()
|
|
4711
4762
|
})
|
|
4712
4763
|
})
|
|
4713
|
-
},
|
|
4764
|
+
}, be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4714
4765
|
__proto__: null,
|
|
4715
|
-
getShortlists:
|
|
4716
|
-
shortlistEntryWithMetricsSchema:
|
|
4717
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4766
|
+
getShortlists: me,
|
|
4767
|
+
shortlistEntryWithMetricsSchema: h
|
|
4768
|
+
}, Symbol.toStringTag, { value: "Module" })), Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4718
4769
|
__proto__: null,
|
|
4719
|
-
v1_dashboard_auth_schemas:
|
|
4720
|
-
v1_dashboard_available_datetimes_schemas:
|
|
4721
|
-
v1_dashboard_candles_schemas:
|
|
4722
|
-
v1_dashboard_daily_persistent_companies_schemas:
|
|
4723
|
-
v1_dashboard_daily_unique_companies_schemas:
|
|
4724
|
-
v1_dashboard_quote_timeline_schemas:
|
|
4725
|
-
v1_dashboard_runs_schemas:
|
|
4726
|
-
v1_dashboard_shortlists_schemas:
|
|
4770
|
+
v1_dashboard_auth_schemas: F,
|
|
4771
|
+
v1_dashboard_available_datetimes_schemas: H,
|
|
4772
|
+
v1_dashboard_candles_schemas: I,
|
|
4773
|
+
v1_dashboard_daily_persistent_companies_schemas: $,
|
|
4774
|
+
v1_dashboard_daily_unique_companies_schemas: Q,
|
|
4775
|
+
v1_dashboard_quote_timeline_schemas: K,
|
|
4776
|
+
v1_dashboard_runs_schemas: ue,
|
|
4777
|
+
v1_dashboard_shortlists_schemas: be
|
|
4727
4778
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4728
4779
|
({
|
|
4729
4780
|
response: t.extend({
|
|
@@ -4739,8 +4790,8 @@ const l = object({
|
|
|
4739
4790
|
id: uuid(),
|
|
4740
4791
|
username: string(),
|
|
4741
4792
|
token: string(),
|
|
4742
|
-
createdAt: date(),
|
|
4743
|
-
updatedAt: date()
|
|
4793
|
+
createdAt: date$1(),
|
|
4794
|
+
updatedAt: date$1()
|
|
4744
4795
|
});
|
|
4745
4796
|
({
|
|
4746
4797
|
query: object({
|
|
@@ -4789,29 +4840,102 @@ const l = object({
|
|
|
4789
4840
|
})
|
|
4790
4841
|
})
|
|
4791
4842
|
});
|
|
4843
|
+
({
|
|
4844
|
+
query: object({}),
|
|
4845
|
+
response: t.extend({
|
|
4846
|
+
data: object({
|
|
4847
|
+
dates: array(
|
|
4848
|
+
object({
|
|
4849
|
+
date: n,
|
|
4850
|
+
shortlistCount: number$1(),
|
|
4851
|
+
quoteCount: number$1(),
|
|
4852
|
+
niftyCount: number$1()
|
|
4853
|
+
})
|
|
4854
|
+
)
|
|
4855
|
+
})
|
|
4856
|
+
})
|
|
4857
|
+
});
|
|
4858
|
+
({
|
|
4859
|
+
body: object({
|
|
4860
|
+
dates: array(n).min(1)
|
|
4861
|
+
}),
|
|
4862
|
+
response: t.extend({
|
|
4863
|
+
data: object({
|
|
4864
|
+
deleted: object({
|
|
4865
|
+
shortlists: number$1(),
|
|
4866
|
+
quotes: number$1(),
|
|
4867
|
+
niftyQuotes: number$1()
|
|
4868
|
+
})
|
|
4869
|
+
})
|
|
4870
|
+
})
|
|
4871
|
+
});
|
|
4872
|
+
({
|
|
4873
|
+
response: t.extend({
|
|
4874
|
+
data: object({
|
|
4875
|
+
holidays: array(
|
|
4876
|
+
object({
|
|
4877
|
+
id: string().uuid(),
|
|
4878
|
+
date: n,
|
|
4879
|
+
createdAt: date(),
|
|
4880
|
+
updatedAt: date()
|
|
4881
|
+
})
|
|
4882
|
+
)
|
|
4883
|
+
})
|
|
4884
|
+
})
|
|
4885
|
+
});
|
|
4886
|
+
({
|
|
4887
|
+
body: object({
|
|
4888
|
+
dates: array(n).min(1)
|
|
4889
|
+
}),
|
|
4890
|
+
response: t.extend({
|
|
4891
|
+
data: object({
|
|
4892
|
+
holidays: array(
|
|
4893
|
+
object({
|
|
4894
|
+
id: string().uuid(),
|
|
4895
|
+
date: n,
|
|
4896
|
+
createdAt: date(),
|
|
4897
|
+
updatedAt: date()
|
|
4898
|
+
})
|
|
4899
|
+
)
|
|
4900
|
+
})
|
|
4901
|
+
})
|
|
4902
|
+
});
|
|
4903
|
+
({
|
|
4904
|
+
body: object({
|
|
4905
|
+
dates: array(n).min(1)
|
|
4906
|
+
}),
|
|
4907
|
+
response: t.extend({
|
|
4908
|
+
data: object({
|
|
4909
|
+
deleted: object({
|
|
4910
|
+
count: number$1(),
|
|
4911
|
+
dates: array(n)
|
|
4912
|
+
})
|
|
4913
|
+
})
|
|
4914
|
+
})
|
|
4915
|
+
});
|
|
4792
4916
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
4793
|
-
function getDefaultExportFromCjs(
|
|
4794
|
-
return
|
|
4917
|
+
function getDefaultExportFromCjs(x) {
|
|
4918
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4795
4919
|
}
|
|
4796
4920
|
function getAugmentedNamespace(n2) {
|
|
4797
4921
|
if (n2.__esModule) return n2;
|
|
4798
|
-
var
|
|
4799
|
-
if (typeof
|
|
4922
|
+
var f = n2.default;
|
|
4923
|
+
if (typeof f == "function") {
|
|
4800
4924
|
var a2 = function a3() {
|
|
4801
4925
|
if (this instanceof a3) {
|
|
4802
|
-
return Reflect.construct(
|
|
4926
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
4803
4927
|
}
|
|
4804
|
-
return
|
|
4928
|
+
return f.apply(this, arguments);
|
|
4805
4929
|
};
|
|
4806
|
-
a2.prototype =
|
|
4930
|
+
a2.prototype = f.prototype;
|
|
4807
4931
|
} else a2 = {};
|
|
4808
4932
|
Object.defineProperty(a2, "__esModule", { value: true });
|
|
4809
|
-
Object.keys(n2).forEach(function(
|
|
4810
|
-
var
|
|
4811
|
-
Object.defineProperty(a2,
|
|
4933
|
+
Object.keys(n2).forEach(function(k) {
|
|
4934
|
+
var d2 = Object.getOwnPropertyDescriptor(n2, k);
|
|
4935
|
+
Object.defineProperty(a2, k, d2.get ? d2 : {
|
|
4812
4936
|
enumerable: true,
|
|
4813
4937
|
get: function() {
|
|
4814
|
-
return n2[
|
|
4938
|
+
return n2[k];
|
|
4815
4939
|
}
|
|
4816
4940
|
});
|
|
4817
4941
|
});
|
|
@@ -4819,73 +4943,73 @@ function getAugmentedNamespace(n2) {
|
|
|
4819
4943
|
}
|
|
4820
4944
|
var utc$1 = { exports: {} };
|
|
4821
4945
|
(function(module2, exports$1) {
|
|
4822
|
-
!function(t2,
|
|
4823
|
-
module2.exports =
|
|
4946
|
+
!function(t2, i) {
|
|
4947
|
+
module2.exports = i();
|
|
4824
4948
|
}(commonjsGlobal, function() {
|
|
4825
|
-
var t2 = "minute",
|
|
4826
|
-
return function(s,
|
|
4827
|
-
var
|
|
4949
|
+
var t2 = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e = /([+-]|\d\d)/g;
|
|
4950
|
+
return function(s, f, n2) {
|
|
4951
|
+
var u2 = f.prototype;
|
|
4828
4952
|
n2.utc = function(t3) {
|
|
4829
|
-
var
|
|
4830
|
-
return new
|
|
4831
|
-
},
|
|
4953
|
+
var i2 = { date: t3, utc: true, args: arguments };
|
|
4954
|
+
return new f(i2);
|
|
4955
|
+
}, u2.utc = function(i2) {
|
|
4832
4956
|
var e2 = n2(this.toDate(), { locale: this.$L, utc: true });
|
|
4833
|
-
return
|
|
4834
|
-
},
|
|
4957
|
+
return i2 ? e2.add(this.utcOffset(), t2) : e2;
|
|
4958
|
+
}, u2.local = function() {
|
|
4835
4959
|
return n2(this.toDate(), { locale: this.$L, utc: false });
|
|
4836
4960
|
};
|
|
4837
|
-
var
|
|
4838
|
-
|
|
4839
|
-
t3.utc && (this.$u = true), this.$utils().u(t3.$offset) || (this.$offset = t3.$offset),
|
|
4961
|
+
var r2 = u2.parse;
|
|
4962
|
+
u2.parse = function(t3) {
|
|
4963
|
+
t3.utc && (this.$u = true), this.$utils().u(t3.$offset) || (this.$offset = t3.$offset), r2.call(this, t3);
|
|
4840
4964
|
};
|
|
4841
|
-
var o2 =
|
|
4842
|
-
|
|
4965
|
+
var o2 = u2.init;
|
|
4966
|
+
u2.init = function() {
|
|
4843
4967
|
if (this.$u) {
|
|
4844
4968
|
var t3 = this.$d;
|
|
4845
4969
|
this.$y = t3.getUTCFullYear(), this.$M = t3.getUTCMonth(), this.$D = t3.getUTCDate(), this.$W = t3.getUTCDay(), this.$H = t3.getUTCHours(), this.$m = t3.getUTCMinutes(), this.$s = t3.getUTCSeconds(), this.$ms = t3.getUTCMilliseconds();
|
|
4846
4970
|
} else o2.call(this);
|
|
4847
4971
|
};
|
|
4848
|
-
var a2 =
|
|
4849
|
-
|
|
4972
|
+
var a2 = u2.utcOffset;
|
|
4973
|
+
u2.utcOffset = function(s2, f2) {
|
|
4850
4974
|
var n3 = this.$utils().u;
|
|
4851
4975
|
if (n3(s2)) return this.$u ? 0 : n3(this.$offset) ? a2.call(this) : this.$offset;
|
|
4852
4976
|
if ("string" == typeof s2 && (s2 = function(t3) {
|
|
4853
4977
|
void 0 === t3 && (t3 = "");
|
|
4854
|
-
var s3 = t3.match(
|
|
4978
|
+
var s3 = t3.match(i);
|
|
4855
4979
|
if (!s3) return null;
|
|
4856
|
-
var
|
|
4857
|
-
return 0 ===
|
|
4980
|
+
var f3 = ("" + s3[0]).match(e) || ["-", 0, 0], n4 = f3[0], u4 = 60 * +f3[1] + +f3[2];
|
|
4981
|
+
return 0 === u4 ? 0 : "+" === n4 ? u4 : -u4;
|
|
4858
4982
|
}(s2), null === s2)) return this;
|
|
4859
|
-
var
|
|
4860
|
-
if (0 ===
|
|
4861
|
-
var
|
|
4862
|
-
if (
|
|
4983
|
+
var u3 = Math.abs(s2) <= 16 ? 60 * s2 : s2;
|
|
4984
|
+
if (0 === u3) return this.utc(f2);
|
|
4985
|
+
var r3 = this.clone();
|
|
4986
|
+
if (f2) return r3.$offset = u3, r3.$u = false, r3;
|
|
4863
4987
|
var o3 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
4864
|
-
return (
|
|
4988
|
+
return (r3 = this.local().add(u3 + o3, t2)).$offset = u3, r3.$x.$localOffset = o3, r3;
|
|
4865
4989
|
};
|
|
4866
|
-
var h2 =
|
|
4867
|
-
|
|
4868
|
-
var
|
|
4869
|
-
return h2.call(this,
|
|
4870
|
-
},
|
|
4990
|
+
var h2 = u2.format;
|
|
4991
|
+
u2.format = function(t3) {
|
|
4992
|
+
var i2 = t3 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
4993
|
+
return h2.call(this, i2);
|
|
4994
|
+
}, u2.valueOf = function() {
|
|
4871
4995
|
var t3 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
4872
4996
|
return this.$d.valueOf() - 6e4 * t3;
|
|
4873
|
-
},
|
|
4997
|
+
}, u2.isUTC = function() {
|
|
4874
4998
|
return !!this.$u;
|
|
4875
|
-
},
|
|
4999
|
+
}, u2.toISOString = function() {
|
|
4876
5000
|
return this.toDate().toISOString();
|
|
4877
|
-
},
|
|
5001
|
+
}, u2.toString = function() {
|
|
4878
5002
|
return this.toDate().toUTCString();
|
|
4879
5003
|
};
|
|
4880
|
-
var l2 =
|
|
4881
|
-
|
|
5004
|
+
var l2 = u2.toDate;
|
|
5005
|
+
u2.toDate = function(t3) {
|
|
4882
5006
|
return "s" === t3 && this.$offset ? n2(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l2.call(this);
|
|
4883
5007
|
};
|
|
4884
|
-
var
|
|
4885
|
-
|
|
4886
|
-
if (t3 && this.$u === t3.$u) return
|
|
4887
|
-
var s2 = this.local(),
|
|
4888
|
-
return
|
|
5008
|
+
var c = u2.diff;
|
|
5009
|
+
u2.diff = function(t3, i2, e2) {
|
|
5010
|
+
if (t3 && this.$u === t3.$u) return c.call(this, t3, i2, e2);
|
|
5011
|
+
var s2 = this.local(), f2 = n2(t3).local();
|
|
5012
|
+
return c.call(s2, f2, i2, e2);
|
|
4889
5013
|
};
|
|
4890
5014
|
};
|
|
4891
5015
|
});
|
|
@@ -4898,57 +5022,57 @@ var timezone$1 = { exports: {} };
|
|
|
4898
5022
|
module2.exports = e();
|
|
4899
5023
|
}(commonjsGlobal, function() {
|
|
4900
5024
|
var t2 = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {};
|
|
4901
|
-
return function(n2,
|
|
4902
|
-
var
|
|
4903
|
-
void 0 ===
|
|
4904
|
-
var o3 = new Date(t3),
|
|
5025
|
+
return function(n2, i, o2) {
|
|
5026
|
+
var r2, a2 = function(t3, n3, i2) {
|
|
5027
|
+
void 0 === i2 && (i2 = {});
|
|
5028
|
+
var o3 = new Date(t3), r3 = function(t4, n4) {
|
|
4905
5029
|
void 0 === n4 && (n4 = {});
|
|
4906
|
-
var
|
|
4907
|
-
return
|
|
4908
|
-
}(n3,
|
|
4909
|
-
return
|
|
4910
|
-
},
|
|
4911
|
-
for (var
|
|
4912
|
-
var
|
|
4913
|
-
|
|
5030
|
+
var i3 = n4.timeZoneName || "short", o4 = t4 + "|" + i3, r4 = e[o4];
|
|
5031
|
+
return r4 || (r4 = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: t4, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i3 }), e[o4] = r4), r4;
|
|
5032
|
+
}(n3, i2);
|
|
5033
|
+
return r3.formatToParts(o3);
|
|
5034
|
+
}, u2 = function(e2, n3) {
|
|
5035
|
+
for (var i2 = a2(e2, n3), r3 = [], u3 = 0; u3 < i2.length; u3 += 1) {
|
|
5036
|
+
var f2 = i2[u3], s2 = f2.type, m = f2.value, c = t2[s2];
|
|
5037
|
+
c >= 0 && (r3[c] = parseInt(m, 10));
|
|
4914
5038
|
}
|
|
4915
|
-
var
|
|
4916
|
-
return (o2.utc(h2).valueOf() - (
|
|
4917
|
-
},
|
|
4918
|
-
|
|
4919
|
-
void 0 === t3 && (t3 =
|
|
4920
|
-
var n3,
|
|
5039
|
+
var d2 = r3[3], l2 = 24 === d2 ? 0 : d2, h2 = r3[0] + "-" + r3[1] + "-" + r3[2] + " " + l2 + ":" + r3[4] + ":" + r3[5] + ":000", v2 = +e2;
|
|
5040
|
+
return (o2.utc(h2).valueOf() - (v2 -= v2 % 1e3)) / 6e4;
|
|
5041
|
+
}, f = i.prototype;
|
|
5042
|
+
f.tz = function(t3, e2) {
|
|
5043
|
+
void 0 === t3 && (t3 = r2);
|
|
5044
|
+
var n3, i2 = this.utcOffset(), a3 = this.toDate(), u3 = a3.toLocaleString("en-US", { timeZone: t3 }), f2 = Math.round((a3 - new Date(u3)) / 1e3 / 60), s2 = 15 * -Math.round(a3.getTimezoneOffset() / 15) - f2;
|
|
4921
5045
|
if (!Number(s2)) n3 = this.utcOffset(0, e2);
|
|
4922
|
-
else if (n3 = o2(
|
|
4923
|
-
var
|
|
4924
|
-
n3 = n3.add(
|
|
5046
|
+
else if (n3 = o2(u3, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s2, true), e2) {
|
|
5047
|
+
var m = n3.utcOffset();
|
|
5048
|
+
n3 = n3.add(i2 - m, "minute");
|
|
4925
5049
|
}
|
|
4926
5050
|
return n3.$x.$timezone = t3, n3;
|
|
4927
|
-
},
|
|
5051
|
+
}, f.offsetName = function(t3) {
|
|
4928
5052
|
var e2 = this.$x.$timezone || o2.tz.guess(), n3 = a2(this.valueOf(), e2, { timeZoneName: t3 }).find(function(t4) {
|
|
4929
5053
|
return "timezonename" === t4.type.toLowerCase();
|
|
4930
5054
|
});
|
|
4931
5055
|
return n3 && n3.value;
|
|
4932
5056
|
};
|
|
4933
|
-
var s =
|
|
4934
|
-
|
|
5057
|
+
var s = f.startOf;
|
|
5058
|
+
f.startOf = function(t3, e2) {
|
|
4935
5059
|
if (!this.$x || !this.$x.$timezone) return s.call(this, t3, e2);
|
|
4936
5060
|
var n3 = o2(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
4937
5061
|
return s.call(n3, t3, e2).tz(this.$x.$timezone, true);
|
|
4938
5062
|
}, o2.tz = function(t3, e2, n3) {
|
|
4939
|
-
var
|
|
5063
|
+
var i2 = n3 && e2, a3 = n3 || e2 || r2, f2 = u2(+o2(), a3);
|
|
4940
5064
|
if ("string" != typeof t3) return o2(t3).tz(a3);
|
|
4941
5065
|
var s2 = function(t4, e3, n4) {
|
|
4942
|
-
var
|
|
4943
|
-
if (e3 === o3) return [
|
|
4944
|
-
var
|
|
4945
|
-
return o3 ===
|
|
4946
|
-
}(o2.utc(t3,
|
|
4947
|
-
return
|
|
5066
|
+
var i3 = t4 - 60 * e3 * 1e3, o3 = u2(i3, n4);
|
|
5067
|
+
if (e3 === o3) return [i3, e3];
|
|
5068
|
+
var r3 = u2(i3 -= 60 * (o3 - e3) * 1e3, n4);
|
|
5069
|
+
return o3 === r3 ? [i3, o3] : [t4 - 60 * Math.min(o3, r3) * 1e3, Math.max(o3, r3)];
|
|
5070
|
+
}(o2.utc(t3, i2).valueOf(), f2, a3), m = s2[0], c = s2[1], d2 = o2(m).utcOffset(c);
|
|
5071
|
+
return d2.$x.$timezone = a3, d2;
|
|
4948
5072
|
}, o2.tz.guess = function() {
|
|
4949
5073
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
4950
5074
|
}, o2.tz.setDefault = function(t3) {
|
|
4951
|
-
|
|
5075
|
+
r2 = t3;
|
|
4952
5076
|
};
|
|
4953
5077
|
};
|
|
4954
5078
|
});
|
|
@@ -5026,14 +5150,14 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
|
5026
5150
|
if (obj === null || typeof obj === "undefined") {
|
|
5027
5151
|
return;
|
|
5028
5152
|
}
|
|
5029
|
-
let
|
|
5153
|
+
let i;
|
|
5030
5154
|
let l2;
|
|
5031
5155
|
if (typeof obj !== "object") {
|
|
5032
5156
|
obj = [obj];
|
|
5033
5157
|
}
|
|
5034
5158
|
if (isArray(obj)) {
|
|
5035
|
-
for (
|
|
5036
|
-
fn.call(null, obj[
|
|
5159
|
+
for (i = 0, l2 = obj.length; i < l2; i++) {
|
|
5160
|
+
fn.call(null, obj[i], i, obj);
|
|
5037
5161
|
}
|
|
5038
5162
|
} else {
|
|
5039
5163
|
if (isBuffer(obj)) {
|
|
@@ -5042,8 +5166,8 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
|
5042
5166
|
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
5043
5167
|
const len = keys.length;
|
|
5044
5168
|
let key;
|
|
5045
|
-
for (
|
|
5046
|
-
key = keys[
|
|
5169
|
+
for (i = 0; i < len; i++) {
|
|
5170
|
+
key = keys[i];
|
|
5047
5171
|
fn.call(null, obj[key], key, obj);
|
|
5048
5172
|
}
|
|
5049
5173
|
}
|
|
@@ -5054,10 +5178,10 @@ function findKey(obj, key) {
|
|
|
5054
5178
|
}
|
|
5055
5179
|
key = key.toLowerCase();
|
|
5056
5180
|
const keys = Object.keys(obj);
|
|
5057
|
-
let
|
|
5181
|
+
let i = keys.length;
|
|
5058
5182
|
let _key;
|
|
5059
|
-
while (
|
|
5060
|
-
_key = keys[
|
|
5183
|
+
while (i-- > 0) {
|
|
5184
|
+
_key = keys[i];
|
|
5061
5185
|
if (key === _key.toLowerCase()) {
|
|
5062
5186
|
return _key;
|
|
5063
5187
|
}
|
|
@@ -5084,8 +5208,8 @@ function merge() {
|
|
|
5084
5208
|
result[targetKey] = val;
|
|
5085
5209
|
}
|
|
5086
5210
|
};
|
|
5087
|
-
for (let
|
|
5088
|
-
arguments[
|
|
5211
|
+
for (let i = 0, l2 = arguments.length; i < l2; i++) {
|
|
5212
|
+
arguments[i] && forEach(arguments[i], assignValue);
|
|
5089
5213
|
}
|
|
5090
5214
|
return result;
|
|
5091
5215
|
}
|
|
@@ -5115,16 +5239,16 @@ const inherits = (constructor, superConstructor, props, descriptors2) => {
|
|
|
5115
5239
|
};
|
|
5116
5240
|
const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
|
|
5117
5241
|
let props;
|
|
5118
|
-
let
|
|
5242
|
+
let i;
|
|
5119
5243
|
let prop;
|
|
5120
5244
|
const merged = {};
|
|
5121
5245
|
destObj = destObj || {};
|
|
5122
5246
|
if (sourceObj == null) return destObj;
|
|
5123
5247
|
do {
|
|
5124
5248
|
props = Object.getOwnPropertyNames(sourceObj);
|
|
5125
|
-
|
|
5126
|
-
while (
|
|
5127
|
-
prop = props[
|
|
5249
|
+
i = props.length;
|
|
5250
|
+
while (i-- > 0) {
|
|
5251
|
+
prop = props[i];
|
|
5128
5252
|
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
5129
5253
|
destObj[prop] = sourceObj[prop];
|
|
5130
5254
|
merged[prop] = true;
|
|
@@ -5146,11 +5270,11 @@ const endsWith = (str, searchString, position) => {
|
|
|
5146
5270
|
const toArray = (thing) => {
|
|
5147
5271
|
if (!thing) return null;
|
|
5148
5272
|
if (isArray(thing)) return thing;
|
|
5149
|
-
let
|
|
5150
|
-
if (!isNumber(
|
|
5151
|
-
const arr = new Array(
|
|
5152
|
-
while (
|
|
5153
|
-
arr[
|
|
5273
|
+
let i = thing.length;
|
|
5274
|
+
if (!isNumber(i)) return null;
|
|
5275
|
+
const arr = new Array(i);
|
|
5276
|
+
while (i-- > 0) {
|
|
5277
|
+
arr[i] = thing[i];
|
|
5154
5278
|
}
|
|
5155
5279
|
return arr;
|
|
5156
5280
|
};
|
|
@@ -5180,7 +5304,7 @@ const isHTMLForm = kindOfTest("HTMLFormElement");
|
|
|
5180
5304
|
const toCamelCase = (str) => {
|
|
5181
5305
|
return str.toLowerCase().replace(
|
|
5182
5306
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
5183
|
-
function replacer(
|
|
5307
|
+
function replacer(m, p1, p2) {
|
|
5184
5308
|
return p1.toUpperCase() + p2;
|
|
5185
5309
|
}
|
|
5186
5310
|
);
|
|
@@ -5237,7 +5361,7 @@ function isSpecCompliantForm(thing) {
|
|
|
5237
5361
|
}
|
|
5238
5362
|
const toJSONObject = (obj) => {
|
|
5239
5363
|
const stack = new Array(10);
|
|
5240
|
-
const visit = (source,
|
|
5364
|
+
const visit = (source, i) => {
|
|
5241
5365
|
if (isObject(source)) {
|
|
5242
5366
|
if (stack.indexOf(source) >= 0) {
|
|
5243
5367
|
return;
|
|
@@ -5246,13 +5370,13 @@ const toJSONObject = (obj) => {
|
|
|
5246
5370
|
return source;
|
|
5247
5371
|
}
|
|
5248
5372
|
if (!("toJSON" in source)) {
|
|
5249
|
-
stack[
|
|
5373
|
+
stack[i] = source;
|
|
5250
5374
|
const target = isArray(source) ? [] : {};
|
|
5251
5375
|
forEach(source, (value, key) => {
|
|
5252
|
-
const reducedValue = visit(value,
|
|
5376
|
+
const reducedValue = visit(value, i + 1);
|
|
5253
5377
|
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
5254
5378
|
});
|
|
5255
|
-
stack[
|
|
5379
|
+
stack[i] = void 0;
|
|
5256
5380
|
return target;
|
|
5257
5381
|
}
|
|
5258
5382
|
}
|
|
@@ -5428,9 +5552,9 @@ function removeBrackets(key) {
|
|
|
5428
5552
|
}
|
|
5429
5553
|
function renderKey(path, key, dots) {
|
|
5430
5554
|
if (!path) return key;
|
|
5431
|
-
return path.concat(key).map(function each(token,
|
|
5555
|
+
return path.concat(key).map(function each(token, i) {
|
|
5432
5556
|
token = removeBrackets(token);
|
|
5433
|
-
return !dots &&
|
|
5557
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
5434
5558
|
}).join(dots ? "." : "");
|
|
5435
5559
|
}
|
|
5436
5560
|
function isFlatArray(arr) {
|
|
@@ -5709,11 +5833,11 @@ function parsePropPath(name) {
|
|
|
5709
5833
|
function arrayToObject(arr) {
|
|
5710
5834
|
const obj = {};
|
|
5711
5835
|
const keys = Object.keys(arr);
|
|
5712
|
-
let
|
|
5836
|
+
let i;
|
|
5713
5837
|
const len = keys.length;
|
|
5714
5838
|
let key;
|
|
5715
|
-
for (
|
|
5716
|
-
key = keys[
|
|
5839
|
+
for (i = 0; i < len; i++) {
|
|
5840
|
+
key = keys[i];
|
|
5717
5841
|
obj[key] = arr[key];
|
|
5718
5842
|
}
|
|
5719
5843
|
return obj;
|
|
@@ -5880,11 +6004,11 @@ const parseHeaders = (rawHeaders) => {
|
|
|
5880
6004
|
const parsed = {};
|
|
5881
6005
|
let key;
|
|
5882
6006
|
let val;
|
|
5883
|
-
let
|
|
6007
|
+
let i;
|
|
5884
6008
|
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
5885
|
-
|
|
5886
|
-
key = line.substring(0,
|
|
5887
|
-
val = line.substring(
|
|
6009
|
+
i = line.indexOf(":");
|
|
6010
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
6011
|
+
val = line.substring(i + 1).trim();
|
|
5888
6012
|
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
|
|
5889
6013
|
return;
|
|
5890
6014
|
}
|
|
@@ -6038,10 +6162,10 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
6038
6162
|
}
|
|
6039
6163
|
clear(matcher) {
|
|
6040
6164
|
const keys = Object.keys(this);
|
|
6041
|
-
let
|
|
6165
|
+
let i = keys.length;
|
|
6042
6166
|
let deleted = false;
|
|
6043
|
-
while (
|
|
6044
|
-
const key = keys[
|
|
6167
|
+
while (i--) {
|
|
6168
|
+
const key = keys[i];
|
|
6045
6169
|
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
6046
6170
|
delete this[key];
|
|
6047
6171
|
deleted = true;
|
|
@@ -6181,11 +6305,11 @@ function speedometer(samplesCount, min) {
|
|
|
6181
6305
|
}
|
|
6182
6306
|
bytes[head] = chunkLength;
|
|
6183
6307
|
timestamps[head] = now;
|
|
6184
|
-
let
|
|
6308
|
+
let i = tail;
|
|
6185
6309
|
let bytesCount = 0;
|
|
6186
|
-
while (
|
|
6187
|
-
bytesCount += bytes[
|
|
6188
|
-
|
|
6310
|
+
while (i !== head) {
|
|
6311
|
+
bytesCount += bytes[i++];
|
|
6312
|
+
i = i % samplesCount;
|
|
6189
6313
|
}
|
|
6190
6314
|
head = (head + 1) % samplesCount;
|
|
6191
6315
|
if (head === tail) {
|
|
@@ -6873,11 +6997,11 @@ const getFetch = (config2) => {
|
|
|
6873
6997
|
Response,
|
|
6874
6998
|
fetch2
|
|
6875
6999
|
];
|
|
6876
|
-
let len = seeds.length,
|
|
6877
|
-
while (
|
|
6878
|
-
seed = seeds[
|
|
7000
|
+
let len = seeds.length, i = len, seed, target, map = seedCache;
|
|
7001
|
+
while (i--) {
|
|
7002
|
+
seed = seeds[i];
|
|
6879
7003
|
target = map.get(seed);
|
|
6880
|
-
target === void 0 && map.set(seed, target =
|
|
7004
|
+
target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
|
|
6881
7005
|
map = target;
|
|
6882
7006
|
}
|
|
6883
7007
|
return target;
|
|
@@ -6907,8 +7031,8 @@ function getAdapter$1(adapters2, config2) {
|
|
|
6907
7031
|
let nameOrAdapter;
|
|
6908
7032
|
let adapter;
|
|
6909
7033
|
const rejectedReasons = {};
|
|
6910
|
-
for (let
|
|
6911
|
-
nameOrAdapter = adapters2[
|
|
7034
|
+
for (let i = 0; i < length; i++) {
|
|
7035
|
+
nameOrAdapter = adapters2[i];
|
|
6912
7036
|
let id;
|
|
6913
7037
|
adapter = nameOrAdapter;
|
|
6914
7038
|
if (!isResolvedHandle(nameOrAdapter)) {
|
|
@@ -6920,7 +7044,7 @@ function getAdapter$1(adapters2, config2) {
|
|
|
6920
7044
|
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config2)))) {
|
|
6921
7045
|
break;
|
|
6922
7046
|
}
|
|
6923
|
-
rejectedReasons[id || "#" +
|
|
7047
|
+
rejectedReasons[id || "#" + i] = adapter;
|
|
6924
7048
|
}
|
|
6925
7049
|
if (!adapter) {
|
|
6926
7050
|
const reasons = Object.entries(rejectedReasons).map(
|
|
@@ -6991,9 +7115,9 @@ function dispatchRequest(config2) {
|
|
|
6991
7115
|
}
|
|
6992
7116
|
const VERSION$1 = "1.13.2";
|
|
6993
7117
|
const validators$1 = {};
|
|
6994
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach((type,
|
|
7118
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
6995
7119
|
validators$1[type] = function validator2(thing) {
|
|
6996
|
-
return typeof thing === type || "a" + (
|
|
7120
|
+
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
6997
7121
|
};
|
|
6998
7122
|
});
|
|
6999
7123
|
const deprecatedWarnings = {};
|
|
@@ -7031,9 +7155,9 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
7031
7155
|
throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
7032
7156
|
}
|
|
7033
7157
|
const keys = Object.keys(options);
|
|
7034
|
-
let
|
|
7035
|
-
while (
|
|
7036
|
-
const opt = keys[
|
|
7158
|
+
let i = keys.length;
|
|
7159
|
+
while (i-- > 0) {
|
|
7160
|
+
const opt = keys[i];
|
|
7037
7161
|
const validator2 = schema[opt];
|
|
7038
7162
|
if (validator2) {
|
|
7039
7163
|
const value = options[opt];
|
|
@@ -7153,7 +7277,7 @@ let Axios$1 = class Axios {
|
|
|
7153
7277
|
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
7154
7278
|
});
|
|
7155
7279
|
let promise;
|
|
7156
|
-
let
|
|
7280
|
+
let i = 0;
|
|
7157
7281
|
let len;
|
|
7158
7282
|
if (!synchronousRequestInterceptors) {
|
|
7159
7283
|
const chain = [dispatchRequest.bind(this), void 0];
|
|
@@ -7161,16 +7285,16 @@ let Axios$1 = class Axios {
|
|
|
7161
7285
|
chain.push(...responseInterceptorChain);
|
|
7162
7286
|
len = chain.length;
|
|
7163
7287
|
promise = Promise.resolve(config2);
|
|
7164
|
-
while (
|
|
7165
|
-
promise = promise.then(chain[
|
|
7288
|
+
while (i < len) {
|
|
7289
|
+
promise = promise.then(chain[i++], chain[i++]);
|
|
7166
7290
|
}
|
|
7167
7291
|
return promise;
|
|
7168
7292
|
}
|
|
7169
7293
|
len = requestInterceptorChain.length;
|
|
7170
7294
|
let newConfig = config2;
|
|
7171
|
-
while (
|
|
7172
|
-
const onFulfilled = requestInterceptorChain[
|
|
7173
|
-
const onRejected = requestInterceptorChain[
|
|
7295
|
+
while (i < len) {
|
|
7296
|
+
const onFulfilled = requestInterceptorChain[i++];
|
|
7297
|
+
const onRejected = requestInterceptorChain[i++];
|
|
7174
7298
|
try {
|
|
7175
7299
|
newConfig = onFulfilled(newConfig);
|
|
7176
7300
|
} catch (error) {
|
|
@@ -7183,10 +7307,10 @@ let Axios$1 = class Axios {
|
|
|
7183
7307
|
} catch (error) {
|
|
7184
7308
|
return Promise.reject(error);
|
|
7185
7309
|
}
|
|
7186
|
-
|
|
7310
|
+
i = 0;
|
|
7187
7311
|
len = responseInterceptorChain.length;
|
|
7188
|
-
while (
|
|
7189
|
-
promise = promise.then(responseInterceptorChain[
|
|
7312
|
+
while (i < len) {
|
|
7313
|
+
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
7190
7314
|
}
|
|
7191
7315
|
return promise;
|
|
7192
7316
|
}
|
|
@@ -7233,9 +7357,9 @@ let CancelToken$1 = class CancelToken {
|
|
|
7233
7357
|
const token = this;
|
|
7234
7358
|
this.promise.then((cancel) => {
|
|
7235
7359
|
if (!token._listeners) return;
|
|
7236
|
-
let
|
|
7237
|
-
while (
|
|
7238
|
-
token._listeners[
|
|
7360
|
+
let i = token._listeners.length;
|
|
7361
|
+
while (i-- > 0) {
|
|
7362
|
+
token._listeners[i](cancel);
|
|
7239
7363
|
}
|
|
7240
7364
|
token._listeners = null;
|
|
7241
7365
|
});
|
|
@@ -7307,8 +7431,8 @@ let CancelToken$1 = class CancelToken {
|
|
|
7307
7431
|
*/
|
|
7308
7432
|
static source() {
|
|
7309
7433
|
let cancel;
|
|
7310
|
-
const token = new CancelToken(function executor(
|
|
7311
|
-
cancel =
|
|
7434
|
+
const token = new CancelToken(function executor(c) {
|
|
7435
|
+
cancel = c;
|
|
7312
7436
|
});
|
|
7313
7437
|
return {
|
|
7314
7438
|
token,
|
|
@@ -7455,52 +7579,52 @@ function tryStringify(o2) {
|
|
|
7455
7579
|
}
|
|
7456
7580
|
}
|
|
7457
7581
|
var quickFormatUnescaped = format$1;
|
|
7458
|
-
function format$1(
|
|
7582
|
+
function format$1(f, args, opts) {
|
|
7459
7583
|
var ss = opts && opts.stringify || tryStringify;
|
|
7460
7584
|
var offset = 1;
|
|
7461
|
-
if (typeof
|
|
7585
|
+
if (typeof f === "object" && f !== null) {
|
|
7462
7586
|
var len = args.length + offset;
|
|
7463
|
-
if (len === 1) return
|
|
7587
|
+
if (len === 1) return f;
|
|
7464
7588
|
var objects = new Array(len);
|
|
7465
|
-
objects[0] = ss(
|
|
7589
|
+
objects[0] = ss(f);
|
|
7466
7590
|
for (var index2 = 1; index2 < len; index2++) {
|
|
7467
7591
|
objects[index2] = ss(args[index2]);
|
|
7468
7592
|
}
|
|
7469
7593
|
return objects.join(" ");
|
|
7470
7594
|
}
|
|
7471
|
-
if (typeof
|
|
7472
|
-
return
|
|
7595
|
+
if (typeof f !== "string") {
|
|
7596
|
+
return f;
|
|
7473
7597
|
}
|
|
7474
7598
|
var argLen = args.length;
|
|
7475
|
-
if (argLen === 0) return
|
|
7599
|
+
if (argLen === 0) return f;
|
|
7476
7600
|
var str = "";
|
|
7477
7601
|
var a2 = 1 - offset;
|
|
7478
7602
|
var lastPos = -1;
|
|
7479
|
-
var flen =
|
|
7480
|
-
for (var
|
|
7481
|
-
if (
|
|
7603
|
+
var flen = f && f.length || 0;
|
|
7604
|
+
for (var i = 0; i < flen; ) {
|
|
7605
|
+
if (f.charCodeAt(i) === 37 && i + 1 < flen) {
|
|
7482
7606
|
lastPos = lastPos > -1 ? lastPos : 0;
|
|
7483
|
-
switch (
|
|
7607
|
+
switch (f.charCodeAt(i + 1)) {
|
|
7484
7608
|
case 100:
|
|
7485
7609
|
case 102:
|
|
7486
7610
|
if (a2 >= argLen)
|
|
7487
7611
|
break;
|
|
7488
7612
|
if (args[a2] == null) break;
|
|
7489
|
-
if (lastPos <
|
|
7490
|
-
str +=
|
|
7613
|
+
if (lastPos < i)
|
|
7614
|
+
str += f.slice(lastPos, i);
|
|
7491
7615
|
str += Number(args[a2]);
|
|
7492
|
-
lastPos =
|
|
7493
|
-
|
|
7616
|
+
lastPos = i + 2;
|
|
7617
|
+
i++;
|
|
7494
7618
|
break;
|
|
7495
7619
|
case 105:
|
|
7496
7620
|
if (a2 >= argLen)
|
|
7497
7621
|
break;
|
|
7498
7622
|
if (args[a2] == null) break;
|
|
7499
|
-
if (lastPos <
|
|
7500
|
-
str +=
|
|
7623
|
+
if (lastPos < i)
|
|
7624
|
+
str += f.slice(lastPos, i);
|
|
7501
7625
|
str += Math.floor(Number(args[a2]));
|
|
7502
|
-
lastPos =
|
|
7503
|
-
|
|
7626
|
+
lastPos = i + 2;
|
|
7627
|
+
i++;
|
|
7504
7628
|
break;
|
|
7505
7629
|
case 79:
|
|
7506
7630
|
case 111:
|
|
@@ -7508,51 +7632,51 @@ function format$1(f2, args, opts) {
|
|
|
7508
7632
|
if (a2 >= argLen)
|
|
7509
7633
|
break;
|
|
7510
7634
|
if (args[a2] === void 0) break;
|
|
7511
|
-
if (lastPos <
|
|
7512
|
-
str +=
|
|
7635
|
+
if (lastPos < i)
|
|
7636
|
+
str += f.slice(lastPos, i);
|
|
7513
7637
|
var type = typeof args[a2];
|
|
7514
7638
|
if (type === "string") {
|
|
7515
7639
|
str += "'" + args[a2] + "'";
|
|
7516
|
-
lastPos =
|
|
7517
|
-
|
|
7640
|
+
lastPos = i + 2;
|
|
7641
|
+
i++;
|
|
7518
7642
|
break;
|
|
7519
7643
|
}
|
|
7520
7644
|
if (type === "function") {
|
|
7521
7645
|
str += args[a2].name || "<anonymous>";
|
|
7522
|
-
lastPos =
|
|
7523
|
-
|
|
7646
|
+
lastPos = i + 2;
|
|
7647
|
+
i++;
|
|
7524
7648
|
break;
|
|
7525
7649
|
}
|
|
7526
7650
|
str += ss(args[a2]);
|
|
7527
|
-
lastPos =
|
|
7528
|
-
|
|
7651
|
+
lastPos = i + 2;
|
|
7652
|
+
i++;
|
|
7529
7653
|
break;
|
|
7530
7654
|
case 115:
|
|
7531
7655
|
if (a2 >= argLen)
|
|
7532
7656
|
break;
|
|
7533
|
-
if (lastPos <
|
|
7534
|
-
str +=
|
|
7657
|
+
if (lastPos < i)
|
|
7658
|
+
str += f.slice(lastPos, i);
|
|
7535
7659
|
str += String(args[a2]);
|
|
7536
|
-
lastPos =
|
|
7537
|
-
|
|
7660
|
+
lastPos = i + 2;
|
|
7661
|
+
i++;
|
|
7538
7662
|
break;
|
|
7539
7663
|
case 37:
|
|
7540
|
-
if (lastPos <
|
|
7541
|
-
str +=
|
|
7664
|
+
if (lastPos < i)
|
|
7665
|
+
str += f.slice(lastPos, i);
|
|
7542
7666
|
str += "%";
|
|
7543
|
-
lastPos =
|
|
7544
|
-
|
|
7667
|
+
lastPos = i + 2;
|
|
7668
|
+
i++;
|
|
7545
7669
|
a2--;
|
|
7546
7670
|
break;
|
|
7547
7671
|
}
|
|
7548
7672
|
++a2;
|
|
7549
7673
|
}
|
|
7550
|
-
++
|
|
7674
|
+
++i;
|
|
7551
7675
|
}
|
|
7552
7676
|
if (lastPos === -1)
|
|
7553
|
-
return
|
|
7677
|
+
return f;
|
|
7554
7678
|
else if (lastPos < flen) {
|
|
7555
|
-
str +=
|
|
7679
|
+
str += f.slice(lastPos);
|
|
7556
7680
|
}
|
|
7557
7681
|
return str;
|
|
7558
7682
|
}
|
|
@@ -7605,8 +7729,8 @@ function setupBaseLogFunctions(logger2, levels, proto) {
|
|
|
7605
7729
|
}
|
|
7606
7730
|
function shouldSerialize(serialize, serializers) {
|
|
7607
7731
|
if (Array.isArray(serialize)) {
|
|
7608
|
-
const hasToFilter = serialize.filter(function(
|
|
7609
|
-
return
|
|
7732
|
+
const hasToFilter = serialize.filter(function(k) {
|
|
7733
|
+
return k !== "!stdSerializers.err";
|
|
7610
7734
|
});
|
|
7611
7735
|
return hasToFilter;
|
|
7612
7736
|
} else if (serialize === true) {
|
|
@@ -7817,7 +7941,7 @@ function createWrap(self2, opts, rootLogger, level) {
|
|
|
7817
7941
|
const ts = opts.timestamp();
|
|
7818
7942
|
const args = new Array(arguments.length);
|
|
7819
7943
|
const proto = Object.getPrototypeOf && Object.getPrototypeOf(this) === _console ? _console : this;
|
|
7820
|
-
for (var
|
|
7944
|
+
for (var i = 0; i < args.length; i++) args[i] = arguments[i];
|
|
7821
7945
|
var argsIsSerialized = false;
|
|
7822
7946
|
if (opts.serialize) {
|
|
7823
7947
|
applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize);
|
|
@@ -7883,13 +8007,13 @@ function asObject(logger2, level, args, ts, opts) {
|
|
|
7883
8007
|
}
|
|
7884
8008
|
}
|
|
7885
8009
|
function applySerializers(args, serialize, serializers, stdErrSerialize) {
|
|
7886
|
-
for (const
|
|
7887
|
-
if (stdErrSerialize && args[
|
|
7888
|
-
args[
|
|
7889
|
-
} else if (typeof args[
|
|
7890
|
-
for (const
|
|
7891
|
-
if (serialize.indexOf(
|
|
7892
|
-
args[
|
|
8010
|
+
for (const i in args) {
|
|
8011
|
+
if (stdErrSerialize && args[i] instanceof Error) {
|
|
8012
|
+
args[i] = pino$1.stdSerializers.err(args[i]);
|
|
8013
|
+
} else if (typeof args[i] === "object" && !Array.isArray(args[i]) && serialize) {
|
|
8014
|
+
for (const k in args[i]) {
|
|
8015
|
+
if (serialize.indexOf(k) > -1 && k in serializers) {
|
|
8016
|
+
args[i][k] = serializers[k](args[i][k]);
|
|
7893
8017
|
}
|
|
7894
8018
|
}
|
|
7895
8019
|
}
|
|
@@ -8012,7 +8136,7 @@ const fetchCandles = ({
|
|
|
8012
8136
|
);
|
|
8013
8137
|
}
|
|
8014
8138
|
try {
|
|
8015
|
-
const validatedParams =
|
|
8139
|
+
const validatedParams = Ce.getGrowwHistoricalCandles.query.parse(params);
|
|
8016
8140
|
const headers = {
|
|
8017
8141
|
Authorization: `Bearer ${developerToken}`
|
|
8018
8142
|
};
|
|
@@ -8056,7 +8180,7 @@ const fetchQuote = ({
|
|
|
8056
8180
|
);
|
|
8057
8181
|
}
|
|
8058
8182
|
try {
|
|
8059
|
-
const validatedParams =
|
|
8183
|
+
const validatedParams = Ce.getGrowwQuote.query.parse(params);
|
|
8060
8184
|
const headers = {
|
|
8061
8185
|
Authorization: `Bearer ${developerToken}`
|
|
8062
8186
|
};
|
|
@@ -8096,7 +8220,7 @@ const fetchQuoteTimeline = ({
|
|
|
8096
8220
|
throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
|
|
8097
8221
|
}
|
|
8098
8222
|
try {
|
|
8099
|
-
const validatedParams =
|
|
8223
|
+
const validatedParams = Ce.getGrowwQuoteTimeline.query.parse({
|
|
8100
8224
|
symbol,
|
|
8101
8225
|
end_datetime
|
|
8102
8226
|
});
|
|
@@ -8143,7 +8267,7 @@ const fetchShortlist = ({
|
|
|
8143
8267
|
);
|
|
8144
8268
|
}
|
|
8145
8269
|
try {
|
|
8146
|
-
const validatedParams =
|
|
8270
|
+
const validatedParams = Re.getLists.query.parse(queryParams);
|
|
8147
8271
|
const headers = {
|
|
8148
8272
|
Authorization: `Bearer ${developerToken}`
|
|
8149
8273
|
};
|
|
@@ -8187,7 +8311,7 @@ const fetchShortlistPersistence = ({
|
|
|
8187
8311
|
);
|
|
8188
8312
|
}
|
|
8189
8313
|
try {
|
|
8190
|
-
const validatedParams =
|
|
8314
|
+
const validatedParams = ke.getShortlistPersistence.query.parse(queryParams);
|
|
8191
8315
|
const headers = {
|
|
8192
8316
|
Authorization: `Bearer ${developerToken}`
|
|
8193
8317
|
};
|
|
@@ -8231,7 +8355,7 @@ const fetchNiftyQuote = ({
|
|
|
8231
8355
|
throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
|
|
8232
8356
|
}
|
|
8233
8357
|
try {
|
|
8234
|
-
const validatedParams =
|
|
8358
|
+
const validatedParams = Ce.getGrowwNiftyQuote.query.parse(params);
|
|
8235
8359
|
const headers = {
|
|
8236
8360
|
Authorization: `Bearer ${developerToken}`
|
|
8237
8361
|
};
|
|
@@ -8273,7 +8397,7 @@ const fetchNiftyQuoteTimeline = ({
|
|
|
8273
8397
|
throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
|
|
8274
8398
|
}
|
|
8275
8399
|
try {
|
|
8276
|
-
const validatedParams =
|
|
8400
|
+
const validatedParams = Ce.getGrowwNiftyQuoteTimeline.query.parse({
|
|
8277
8401
|
end_datetime
|
|
8278
8402
|
});
|
|
8279
8403
|
const headers = {
|
|
@@ -8304,6 +8428,86 @@ const fetchNiftyQuoteTimeline = ({
|
|
|
8304
8428
|
throw error;
|
|
8305
8429
|
}
|
|
8306
8430
|
};
|
|
8431
|
+
const fetchAvailableDates = ({
|
|
8432
|
+
developerToken,
|
|
8433
|
+
apiDomain,
|
|
8434
|
+
runId,
|
|
8435
|
+
currentTimestamp,
|
|
8436
|
+
currentTimezone = "Asia/Kolkata"
|
|
8437
|
+
}) => async () => {
|
|
8438
|
+
if (!developerToken) {
|
|
8439
|
+
throw new Error(
|
|
8440
|
+
"Developer token not found. Please set DEVELOPER_TOKEN environment variable."
|
|
8441
|
+
);
|
|
8442
|
+
}
|
|
8443
|
+
try {
|
|
8444
|
+
const headers = {
|
|
8445
|
+
Authorization: `Bearer ${developerToken}`
|
|
8446
|
+
};
|
|
8447
|
+
if (runId) {
|
|
8448
|
+
headers["X-Run-Id"] = runId;
|
|
8449
|
+
}
|
|
8450
|
+
if (currentTimestamp) {
|
|
8451
|
+
headers["X-Current-Timestamp"] = currentTimestamp;
|
|
8452
|
+
}
|
|
8453
|
+
if (currentTimezone) {
|
|
8454
|
+
headers["X-Current-Timezone"] = currentTimezone;
|
|
8455
|
+
}
|
|
8456
|
+
const response = await axios.get(`${apiDomain}/v1/developer/available-dates`, {
|
|
8457
|
+
headers
|
|
8458
|
+
});
|
|
8459
|
+
return response.data.data;
|
|
8460
|
+
} catch (error) {
|
|
8461
|
+
if (axios.isAxiosError(error)) {
|
|
8462
|
+
logger.error(`Error fetching available dates: ${error.message}`);
|
|
8463
|
+
throw new Error(
|
|
8464
|
+
`Failed to fetch available dates: ${error.response?.data?.message || error.message}`
|
|
8465
|
+
);
|
|
8466
|
+
}
|
|
8467
|
+
logger.error(`Unexpected error fetching available dates: ${error}`);
|
|
8468
|
+
throw error;
|
|
8469
|
+
}
|
|
8470
|
+
};
|
|
8471
|
+
const fetchHolidays = ({
|
|
8472
|
+
developerToken,
|
|
8473
|
+
apiDomain,
|
|
8474
|
+
runId,
|
|
8475
|
+
currentTimestamp,
|
|
8476
|
+
currentTimezone = "Asia/Kolkata"
|
|
8477
|
+
}) => async () => {
|
|
8478
|
+
if (!developerToken) {
|
|
8479
|
+
throw new Error(
|
|
8480
|
+
"Developer token not found. Please set DEVELOPER_TOKEN environment variable."
|
|
8481
|
+
);
|
|
8482
|
+
}
|
|
8483
|
+
try {
|
|
8484
|
+
const headers = {
|
|
8485
|
+
Authorization: `Bearer ${developerToken}`
|
|
8486
|
+
};
|
|
8487
|
+
if (runId) {
|
|
8488
|
+
headers["X-Run-Id"] = runId;
|
|
8489
|
+
}
|
|
8490
|
+
if (currentTimestamp) {
|
|
8491
|
+
headers["X-Current-Timestamp"] = currentTimestamp;
|
|
8492
|
+
}
|
|
8493
|
+
if (currentTimezone) {
|
|
8494
|
+
headers["X-Current-Timezone"] = currentTimezone;
|
|
8495
|
+
}
|
|
8496
|
+
const response = await axios.get(`${apiDomain}/v1/developer/holidays`, {
|
|
8497
|
+
headers
|
|
8498
|
+
});
|
|
8499
|
+
return response.data.data;
|
|
8500
|
+
} catch (error) {
|
|
8501
|
+
if (axios.isAxiosError(error)) {
|
|
8502
|
+
logger.error(`Error fetching holidays: ${error.message}`);
|
|
8503
|
+
throw new Error(
|
|
8504
|
+
`Failed to fetch holidays: ${error.response?.data?.message || error.message}`
|
|
8505
|
+
);
|
|
8506
|
+
}
|
|
8507
|
+
logger.error(`Unexpected error fetching holidays: ${error}`);
|
|
8508
|
+
throw error;
|
|
8509
|
+
}
|
|
8510
|
+
};
|
|
8307
8511
|
function isRetryableError(error) {
|
|
8308
8512
|
if (axios.isAxiosError(error)) {
|
|
8309
8513
|
const axiosError = error;
|
|
@@ -8382,7 +8586,7 @@ const placeOrder = ({ runId, apiClient }) => async (data) => {
|
|
|
8382
8586
|
try {
|
|
8383
8587
|
await retryWithBackoff(
|
|
8384
8588
|
async () => {
|
|
8385
|
-
const validatedData =
|
|
8589
|
+
const validatedData = Le.v1_dashboard_runs_schemas.createOrder.body.parse(data);
|
|
8386
8590
|
await apiClient.post(`/v1/dashboard/runs/${runId}/orders`, validatedData);
|
|
8387
8591
|
logger.debug(`Order persisted for ${data.nseSymbol} in runId: ${runId}`);
|
|
8388
8592
|
},
|
|
@@ -8499,9 +8703,9 @@ var calendar$1 = { exports: {} };
|
|
|
8499
8703
|
module2.exports = t2();
|
|
8500
8704
|
}(commonjsGlobal, function() {
|
|
8501
8705
|
return function(e, t2, a2) {
|
|
8502
|
-
var n2 = "h:mm A",
|
|
8706
|
+
var n2 = "h:mm A", d2 = { lastDay: "[Yesterday at] " + n2, sameDay: "[Today at] " + n2, nextDay: "[Tomorrow at] " + n2, nextWeek: "dddd [at] " + n2, lastWeek: "[Last] dddd [at] " + n2, sameElse: "MM/DD/YYYY" };
|
|
8503
8707
|
t2.prototype.calendar = function(e2, t3) {
|
|
8504
|
-
var n3 = t3 || this.$locale().calendar ||
|
|
8708
|
+
var n3 = t3 || this.$locale().calendar || d2, o2 = a2(e2 || void 0).startOf("d"), s = this.diff(o2, "d", true), i = "sameElse", f = s < -6 ? i : s < -1 ? "lastWeek" : s < 0 ? "lastDay" : s < 1 ? "sameDay" : s < 2 ? "nextDay" : s < 7 ? "nextWeek" : i, l2 = n3[f] || d2[f];
|
|
8505
8709
|
return "function" == typeof l2 ? l2.call(this, a2()) : this.format(l2);
|
|
8506
8710
|
};
|
|
8507
8711
|
};
|
|
@@ -8511,42 +8715,42 @@ var calendarExports = calendar$1.exports;
|
|
|
8511
8715
|
const calendar = /* @__PURE__ */ getDefaultExportFromCjs(calendarExports);
|
|
8512
8716
|
var relativeTime$1 = { exports: {} };
|
|
8513
8717
|
(function(module2, exports$1) {
|
|
8514
|
-
!function(
|
|
8718
|
+
!function(r2, e) {
|
|
8515
8719
|
module2.exports = e();
|
|
8516
8720
|
}(commonjsGlobal, function() {
|
|
8517
|
-
return function(
|
|
8518
|
-
|
|
8721
|
+
return function(r2, e, t2) {
|
|
8722
|
+
r2 = r2 || {};
|
|
8519
8723
|
var n2 = e.prototype, o2 = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
|
|
8520
|
-
function
|
|
8521
|
-
return n2.fromToBase(
|
|
8522
|
-
}
|
|
8523
|
-
t2.en.relativeTime = o2, n2.fromToBase = function(e2, n3,
|
|
8524
|
-
for (var
|
|
8525
|
-
var y2 = h2[
|
|
8526
|
-
y2.d && (
|
|
8527
|
-
var p2 = (
|
|
8528
|
-
if (s =
|
|
8529
|
-
p2 <= 1 &&
|
|
8530
|
-
var
|
|
8531
|
-
|
|
8724
|
+
function i(r3, e2, t3, o3) {
|
|
8725
|
+
return n2.fromToBase(r3, e2, t3, o3);
|
|
8726
|
+
}
|
|
8727
|
+
t2.en.relativeTime = o2, n2.fromToBase = function(e2, n3, i2, d3, u2) {
|
|
8728
|
+
for (var f, a2, s, l2 = i2.$locale().relativeTime || o2, h2 = r2.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h2.length, c = 0; c < m; c += 1) {
|
|
8729
|
+
var y2 = h2[c];
|
|
8730
|
+
y2.d && (f = d3 ? t2(e2).diff(i2, y2.d, true) : i2.diff(e2, y2.d, true));
|
|
8731
|
+
var p2 = (r2.rounding || Math.round)(Math.abs(f));
|
|
8732
|
+
if (s = f > 0, p2 <= y2.r || !y2.r) {
|
|
8733
|
+
p2 <= 1 && c > 0 && (y2 = h2[c - 1]);
|
|
8734
|
+
var v2 = l2[y2.l];
|
|
8735
|
+
u2 && (p2 = u2("" + p2)), a2 = "string" == typeof v2 ? v2.replace("%d", p2) : v2(p2, n3, y2.l, s);
|
|
8532
8736
|
break;
|
|
8533
8737
|
}
|
|
8534
8738
|
}
|
|
8535
8739
|
if (n3) return a2;
|
|
8536
8740
|
var M2 = s ? l2.future : l2.past;
|
|
8537
8741
|
return "function" == typeof M2 ? M2(a2) : M2.replace("%s", a2);
|
|
8538
|
-
}, n2.to = function(
|
|
8539
|
-
return
|
|
8540
|
-
}, n2.from = function(
|
|
8541
|
-
return
|
|
8742
|
+
}, n2.to = function(r3, e2) {
|
|
8743
|
+
return i(r3, e2, this, true);
|
|
8744
|
+
}, n2.from = function(r3, e2) {
|
|
8745
|
+
return i(r3, e2, this);
|
|
8542
8746
|
};
|
|
8543
|
-
var
|
|
8544
|
-
return
|
|
8747
|
+
var d2 = function(r3) {
|
|
8748
|
+
return r3.$u ? t2.utc() : t2();
|
|
8545
8749
|
};
|
|
8546
|
-
n2.toNow = function(
|
|
8547
|
-
return this.to(
|
|
8548
|
-
}, n2.fromNow = function(
|
|
8549
|
-
return this.from(
|
|
8750
|
+
n2.toNow = function(r3) {
|
|
8751
|
+
return this.to(d2(this), r3);
|
|
8752
|
+
}, n2.fromNow = function(r3) {
|
|
8753
|
+
return this.from(d2(this), r3);
|
|
8550
8754
|
};
|
|
8551
8755
|
};
|
|
8552
8756
|
});
|
|
@@ -8633,6 +8837,182 @@ async function runMinuteLoop({
|
|
|
8633
8837
|
nextBoundaryDayJS = nextBoundaryDayJS.add(intervalMinutes, "minute");
|
|
8634
8838
|
}
|
|
8635
8839
|
}
|
|
8840
|
+
class GanakaClient {
|
|
8841
|
+
constructor(config2) {
|
|
8842
|
+
this.developerToken = config2?.developerToken || process.env.DEVELOPER_KEY || "";
|
|
8843
|
+
this.apiDomain = config2?.apiDomain || process.env.API_DOMAIN || "https://api.ganaka.live";
|
|
8844
|
+
if (!this.developerToken) {
|
|
8845
|
+
throw new Error(
|
|
8846
|
+
"Developer token not found. Please provide developerToken in constructor or set DEVELOPER_KEY environment variable."
|
|
8847
|
+
);
|
|
8848
|
+
}
|
|
8849
|
+
}
|
|
8850
|
+
/**
|
|
8851
|
+
* Fetch historical candles for a symbol.
|
|
8852
|
+
*
|
|
8853
|
+
* @param params - Query parameters for fetching candles
|
|
8854
|
+
* @param params.symbol - The symbol to fetch candles for
|
|
8855
|
+
* @param params.interval - The interval for candles (e.g., "1minute", "5minute", "1day")
|
|
8856
|
+
* @param params.start_datetime - Start datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
8857
|
+
* @param params.end_datetime - End datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
8858
|
+
* @returns Promise resolving to candle data
|
|
8859
|
+
*/
|
|
8860
|
+
async fetchCandles(params) {
|
|
8861
|
+
const callback = fetchCandles({
|
|
8862
|
+
developerToken: this.developerToken,
|
|
8863
|
+
apiDomain: this.apiDomain,
|
|
8864
|
+
runId: null,
|
|
8865
|
+
currentTimestamp: "",
|
|
8866
|
+
currentTimezone: "Asia/Kolkata"
|
|
8867
|
+
});
|
|
8868
|
+
return callback(params);
|
|
8869
|
+
}
|
|
8870
|
+
/**
|
|
8871
|
+
* Fetch quote for a symbol at a specific datetime.
|
|
8872
|
+
*
|
|
8873
|
+
* @param params - Query parameters for fetching quote
|
|
8874
|
+
* @param params.symbol - The symbol to fetch quote for
|
|
8875
|
+
* @param params.datetime - Datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
8876
|
+
* @returns Promise resolving to quote data or null
|
|
8877
|
+
*/
|
|
8878
|
+
async fetchQuote(params) {
|
|
8879
|
+
const callback = fetchQuote({
|
|
8880
|
+
developerToken: this.developerToken,
|
|
8881
|
+
apiDomain: this.apiDomain,
|
|
8882
|
+
runId: null,
|
|
8883
|
+
currentTimestamp: "",
|
|
8884
|
+
currentTimezone: "Asia/Kolkata"
|
|
8885
|
+
});
|
|
8886
|
+
return callback(params);
|
|
8887
|
+
}
|
|
8888
|
+
/**
|
|
8889
|
+
* Fetch quote timeline for a symbol.
|
|
8890
|
+
* Given a symbol and an end_datetime, returns the quote timeline for the given date.
|
|
8891
|
+
*
|
|
8892
|
+
* @param symbol - The symbol to fetch quote timeline for
|
|
8893
|
+
* @param end_datetime - End datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
8894
|
+
* @returns Promise resolving to quote timeline data
|
|
8895
|
+
*/
|
|
8896
|
+
async fetchQuoteTimeline(symbol, end_datetime) {
|
|
8897
|
+
const callback = fetchQuoteTimeline({
|
|
8898
|
+
developerToken: this.developerToken,
|
|
8899
|
+
apiDomain: this.apiDomain,
|
|
8900
|
+
runId: null,
|
|
8901
|
+
currentTimestamp: "",
|
|
8902
|
+
currentTimezone: "Asia/Kolkata"
|
|
8903
|
+
});
|
|
8904
|
+
return callback(symbol, end_datetime);
|
|
8905
|
+
}
|
|
8906
|
+
/**
|
|
8907
|
+
* Fetch NIFTY quote at a specific datetime.
|
|
8908
|
+
*
|
|
8909
|
+
* @param params - Query parameters for fetching NIFTY quote
|
|
8910
|
+
* @param params.datetime - Datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
8911
|
+
* @returns Promise resolving to NIFTY quote data or null
|
|
8912
|
+
*/
|
|
8913
|
+
async fetchNiftyQuote(params) {
|
|
8914
|
+
const callback = fetchNiftyQuote({
|
|
8915
|
+
developerToken: this.developerToken,
|
|
8916
|
+
apiDomain: this.apiDomain,
|
|
8917
|
+
runId: null,
|
|
8918
|
+
currentTimestamp: "",
|
|
8919
|
+
currentTimezone: "Asia/Kolkata"
|
|
8920
|
+
});
|
|
8921
|
+
return callback(params);
|
|
8922
|
+
}
|
|
8923
|
+
/**
|
|
8924
|
+
* Fetch NIFTY quote timeline.
|
|
8925
|
+
* Given an end_datetime, returns the NIFTY quote timeline for the given date.
|
|
8926
|
+
*
|
|
8927
|
+
* @param end_datetime - End datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
8928
|
+
* @returns Promise resolving to NIFTY quote timeline data
|
|
8929
|
+
*/
|
|
8930
|
+
async fetchNiftyQuoteTimeline(end_datetime) {
|
|
8931
|
+
const callback = fetchNiftyQuoteTimeline({
|
|
8932
|
+
developerToken: this.developerToken,
|
|
8933
|
+
apiDomain: this.apiDomain,
|
|
8934
|
+
runId: null,
|
|
8935
|
+
currentTimestamp: "",
|
|
8936
|
+
currentTimezone: "Asia/Kolkata"
|
|
8937
|
+
});
|
|
8938
|
+
return callback(end_datetime);
|
|
8939
|
+
}
|
|
8940
|
+
/**
|
|
8941
|
+
* Fetch shortlist for a specific type and datetime.
|
|
8942
|
+
*
|
|
8943
|
+
* @param queryParams - Query parameters for fetching shortlist
|
|
8944
|
+
* @param queryParams.type - The type of shortlist (e.g., "top-gainers", "top-losers")
|
|
8945
|
+
* @param queryParams.datetime - Datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
8946
|
+
* @returns Promise resolving to shortlist data or null
|
|
8947
|
+
*/
|
|
8948
|
+
async fetchShortlist(queryParams) {
|
|
8949
|
+
const callback = fetchShortlist({
|
|
8950
|
+
developerToken: this.developerToken,
|
|
8951
|
+
apiDomain: this.apiDomain,
|
|
8952
|
+
runId: null,
|
|
8953
|
+
currentTimestamp: "",
|
|
8954
|
+
currentTimezone: "Asia/Kolkata"
|
|
8955
|
+
});
|
|
8956
|
+
return callback(queryParams);
|
|
8957
|
+
}
|
|
8958
|
+
/**
|
|
8959
|
+
* Fetch shortlist persistence.
|
|
8960
|
+
* Given a shortlist type and a start and end datetime,
|
|
8961
|
+
* returns the list of instruments that appeared in the shortlist during the time range
|
|
8962
|
+
* in descending order of appearance count.
|
|
8963
|
+
*
|
|
8964
|
+
* This helps identify the stocks that have been consistently appearing in the shortlist
|
|
8965
|
+
* over a given period of time.
|
|
8966
|
+
*
|
|
8967
|
+
* @param queryParams - Query parameters for fetching shortlist persistence
|
|
8968
|
+
* @param queryParams.type - The type of shortlist (e.g., "top-gainers", "top-losers")
|
|
8969
|
+
* @param queryParams.start_datetime - Start datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
8970
|
+
* @param queryParams.end_datetime - End datetime in IST string format (YYYY-MM-DDTHH:mm:ss)
|
|
8971
|
+
* @returns Promise resolving to shortlist persistence data or null
|
|
8972
|
+
*/
|
|
8973
|
+
async fetchShortlistPersistence(queryParams) {
|
|
8974
|
+
const callback = fetchShortlistPersistence({
|
|
8975
|
+
developerToken: this.developerToken,
|
|
8976
|
+
apiDomain: this.apiDomain,
|
|
8977
|
+
runId: null,
|
|
8978
|
+
currentTimestamp: "",
|
|
8979
|
+
currentTimezone: "Asia/Kolkata"
|
|
8980
|
+
});
|
|
8981
|
+
return callback(queryParams);
|
|
8982
|
+
}
|
|
8983
|
+
/**
|
|
8984
|
+
* Fetch available dates with timestamps.
|
|
8985
|
+
* Returns which dates have data available, grouped by date with all timestamps for each date.
|
|
8986
|
+
*
|
|
8987
|
+
* @returns Promise resolving to available dates data with dates and timestamps
|
|
8988
|
+
*/
|
|
8989
|
+
async fetchAvailableDates() {
|
|
8990
|
+
const callback = fetchAvailableDates({
|
|
8991
|
+
developerToken: this.developerToken,
|
|
8992
|
+
apiDomain: this.apiDomain,
|
|
8993
|
+
runId: null,
|
|
8994
|
+
currentTimestamp: "",
|
|
8995
|
+
currentTimezone: "Asia/Kolkata"
|
|
8996
|
+
});
|
|
8997
|
+
return callback();
|
|
8998
|
+
}
|
|
8999
|
+
/**
|
|
9000
|
+
* Fetch market holidays.
|
|
9001
|
+
* Returns all dates marked as market holidays.
|
|
9002
|
+
*
|
|
9003
|
+
* @returns Promise resolving to holidays data
|
|
9004
|
+
*/
|
|
9005
|
+
async fetchHolidays() {
|
|
9006
|
+
const callback = fetchHolidays({
|
|
9007
|
+
developerToken: this.developerToken,
|
|
9008
|
+
apiDomain: this.apiDomain,
|
|
9009
|
+
runId: null,
|
|
9010
|
+
currentTimestamp: "",
|
|
9011
|
+
currentTimezone: "Asia/Kolkata"
|
|
9012
|
+
});
|
|
9013
|
+
return callback();
|
|
9014
|
+
}
|
|
9015
|
+
}
|
|
8636
9016
|
dotenv.config();
|
|
8637
9017
|
dayjs.extend(utc);
|
|
8638
9018
|
dayjs.extend(timezone);
|
|
@@ -8742,6 +9122,20 @@ async function ganaka({
|
|
|
8742
9122
|
currentTimestamp,
|
|
8743
9123
|
currentTimezone: "Asia/Kolkata"
|
|
8744
9124
|
}),
|
|
9125
|
+
fetchAvailableDates: fetchAvailableDates({
|
|
9126
|
+
developerToken,
|
|
9127
|
+
apiDomain,
|
|
9128
|
+
runId,
|
|
9129
|
+
currentTimestamp,
|
|
9130
|
+
currentTimezone: "Asia/Kolkata"
|
|
9131
|
+
}),
|
|
9132
|
+
fetchHolidays: fetchHolidays({
|
|
9133
|
+
developerToken,
|
|
9134
|
+
apiDomain,
|
|
9135
|
+
runId,
|
|
9136
|
+
currentTimestamp,
|
|
9137
|
+
currentTimezone: "Asia/Kolkata"
|
|
9138
|
+
}),
|
|
8745
9139
|
currentTimestamp
|
|
8746
9140
|
});
|
|
8747
9141
|
}
|
|
@@ -8768,7 +9162,8 @@ async function ganaka({
|
|
|
8768
9162
|
}
|
|
8769
9163
|
}
|
|
8770
9164
|
}
|
|
9165
|
+
exports.GanakaClient = GanakaClient;
|
|
8771
9166
|
exports.ganaka = ganaka;
|
|
8772
9167
|
exports.growwQuotePayloadSchema = S;
|
|
8773
|
-
exports.growwQuoteSchema =
|
|
9168
|
+
exports.growwQuoteSchema = r;
|
|
8774
9169
|
//# sourceMappingURL=index.js.map
|