@ganaka/sdk 1.0.3 → 1.2.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/dist/index.mjs CHANGED
@@ -326,10 +326,10 @@ function safeExtend(schema, shape) {
326
326
  };
327
327
  return clone(schema, def);
328
328
  }
329
- function merge$1(a, b2) {
330
- const def = mergeDefs(a._zod.def, {
329
+ function merge$1(a2, b2) {
330
+ const def = mergeDefs(a2._zod.def, {
331
331
  get shape() {
332
- const _shape = { ...a._zod.def.shape, ...b2._zod.def.shape };
332
+ const _shape = { ...a2._zod.def.shape, ...b2._zod.def.shape };
333
333
  assignProp(this, "shape", _shape);
334
334
  return _shape;
335
335
  },
@@ -339,7 +339,7 @@ function merge$1(a, b2) {
339
339
  checks: []
340
340
  // delete existing checks
341
341
  });
342
- return clone(a, def);
342
+ return clone(a2, def);
343
343
  }
344
344
  function partial(Class, schema, mask) {
345
345
  const def = mergeDefs(schema._zod.def, {
@@ -1175,10 +1175,10 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1175
1175
  inst["~standard"] = {
1176
1176
  validate: (value) => {
1177
1177
  try {
1178
- const r2 = safeParse$1(inst, value);
1179
- return r2.success ? { value: r2.data } : { issues: r2.error?.issues };
1178
+ const r = safeParse$1(inst, value);
1179
+ return r.success ? { value: r.data } : { issues: r.error?.issues };
1180
1180
  } catch (_2) {
1181
- return safeParseAsync$1(inst, value).then((r2) => r2.success ? { value: r2.data } : { issues: r2.error?.issues });
1181
+ return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
1182
1182
  }
1183
1183
  },
1184
1184
  vendor: "zod",
@@ -1661,11 +1661,11 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1661
1661
  unrecognized.push(key);
1662
1662
  continue;
1663
1663
  }
1664
- const r2 = _catchall.run({ value: input[key], issues: [] }, ctx);
1665
- if (r2 instanceof Promise) {
1666
- proms.push(r2.then((r3) => handlePropertyResult(r3, payload, key, input)));
1664
+ const r = _catchall.run({ value: input[key], issues: [] }, ctx);
1665
+ if (r instanceof Promise) {
1666
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
1667
1667
  } else {
1668
- handlePropertyResult(r2, payload, key, input);
1668
+ handlePropertyResult(r, payload, key, input);
1669
1669
  }
1670
1670
  }
1671
1671
  if (unrecognized.length) {
@@ -1731,11 +1731,11 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1731
1731
  const shape = value.shape;
1732
1732
  for (const key of value.keys) {
1733
1733
  const el = shape[key];
1734
- const r2 = el._zod.run({ value: input[key], issues: [] }, ctx);
1735
- if (r2 instanceof Promise) {
1736
- proms.push(r2.then((r3) => handlePropertyResult(r3, payload, key, input)));
1734
+ const r = el._zod.run({ value: input[key], issues: [] }, ctx);
1735
+ if (r instanceof Promise) {
1736
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
1737
1737
  } else {
1738
- handlePropertyResult(r2, payload, key, input);
1738
+ handlePropertyResult(r, payload, key, input);
1739
1739
  }
1740
1740
  }
1741
1741
  if (!catchall) {
@@ -1827,7 +1827,7 @@ function handleUnionResults(results, final, inst, ctx) {
1827
1827
  return final;
1828
1828
  }
1829
1829
  }
1830
- const nonaborted = results.filter((r2) => !aborted(r2));
1830
+ const nonaborted = results.filter((r) => !aborted(r));
1831
1831
  if (nonaborted.length === 1) {
1832
1832
  final.value = nonaborted[0].value;
1833
1833
  return nonaborted[0];
@@ -1901,19 +1901,19 @@ const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst,
1901
1901
  return handleIntersectionResults(payload, left, right);
1902
1902
  };
1903
1903
  });
1904
- function mergeValues(a, b2) {
1905
- if (a === b2) {
1906
- return { valid: true, data: a };
1904
+ function mergeValues(a2, b2) {
1905
+ if (a2 === b2) {
1906
+ return { valid: true, data: a2 };
1907
1907
  }
1908
- if (a instanceof Date && b2 instanceof Date && +a === +b2) {
1909
- return { valid: true, data: a };
1908
+ if (a2 instanceof Date && b2 instanceof Date && +a2 === +b2) {
1909
+ return { valid: true, data: a2 };
1910
1910
  }
1911
- if (isPlainObject$1(a) && isPlainObject$1(b2)) {
1911
+ if (isPlainObject$1(a2) && isPlainObject$1(b2)) {
1912
1912
  const bKeys = Object.keys(b2);
1913
- const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1914
- const newObj = { ...a, ...b2 };
1913
+ const sharedKeys = Object.keys(a2).filter((key) => bKeys.indexOf(key) !== -1);
1914
+ const newObj = { ...a2, ...b2 };
1915
1915
  for (const key of sharedKeys) {
1916
- const sharedValue = mergeValues(a[key], b2[key]);
1916
+ const sharedValue = mergeValues(a2[key], b2[key]);
1917
1917
  if (!sharedValue.valid) {
1918
1918
  return {
1919
1919
  valid: false,
@@ -1924,13 +1924,13 @@ function mergeValues(a, b2) {
1924
1924
  }
1925
1925
  return { valid: true, data: newObj };
1926
1926
  }
1927
- if (Array.isArray(a) && Array.isArray(b2)) {
1928
- if (a.length !== b2.length) {
1927
+ if (Array.isArray(a2) && Array.isArray(b2)) {
1928
+ if (a2.length !== b2.length) {
1929
1929
  return { valid: false, mergeErrorPath: [] };
1930
1930
  }
1931
1931
  const newArray = [];
1932
- for (let index2 = 0; index2 < a.length; index2++) {
1933
- const itemA = a[index2];
1932
+ for (let index2 = 0; index2 < a2.length; index2++) {
1933
+ const itemA = a2[index2];
1934
1934
  const itemB = b2[index2];
1935
1935
  const sharedValue = mergeValues(itemA, itemB);
1936
1936
  if (!sharedValue.valid) {
@@ -2121,7 +2121,7 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
2121
2121
  if (def.innerType._zod.optin === "optional") {
2122
2122
  const result = def.innerType._zod.run(payload, ctx);
2123
2123
  if (result instanceof Promise)
2124
- return result.then((r2) => handleOptionalResult(r2, payload.value));
2124
+ return result.then((r) => handleOptionalResult(r, payload.value));
2125
2125
  return handleOptionalResult(result, payload.value);
2126
2126
  }
2127
2127
  if (payload.value === void 0) {
@@ -2308,11 +2308,11 @@ const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
2308
2308
  };
2309
2309
  inst._zod.check = (payload) => {
2310
2310
  const input = payload.value;
2311
- const r2 = def.fn(input);
2312
- if (r2 instanceof Promise) {
2313
- return r2.then((r3) => handleRefineResult(r3, payload, input, inst));
2311
+ const r = def.fn(input);
2312
+ if (r instanceof Promise) {
2313
+ return r.then((r2) => handleRefineResult(r2, payload, input, inst));
2314
2314
  }
2315
- handleRefineResult(r2, payload, input, inst);
2315
+ handleRefineResult(r, payload, input, inst);
2316
2316
  return;
2317
2317
  };
2318
2318
  });
@@ -3338,7 +3338,7 @@ const unionProcessor = (schema, ctx, json, params) => {
3338
3338
  };
3339
3339
  const intersectionProcessor = (schema, ctx, json, params) => {
3340
3340
  const def = schema._zod.def;
3341
- const a = process$1(def.left, ctx, {
3341
+ const a2 = process$1(def.left, ctx, {
3342
3342
  ...params,
3343
3343
  path: [...params.path, "allOf", 0]
3344
3344
  });
@@ -3348,7 +3348,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
3348
3348
  });
3349
3349
  const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
3350
3350
  const allOf = [
3351
- ...isSimpleIntersection(a) ? a.allOf : [a],
3351
+ ...isSimpleIntersection(a2) ? a2.allOf : [a2],
3352
3352
  ...isSimpleIntersection(b2) ? b2.allOf : [b2]
3353
3353
  ];
3354
3354
  json.allOf = allOf;
@@ -4108,7 +4108,7 @@ const t$1 = [
4108
4108
  "TOP_GAINERS",
4109
4109
  "VOLUME_SHOCKERS"
4110
4110
  ];
4111
- const g = object({
4111
+ const _ = object({
4112
4112
  average_price: number$1().nullable(),
4113
4113
  bid_quantity: number$1().nullable(),
4114
4114
  bid_price: number$1().nullable(),
@@ -4154,14 +4154,14 @@ const g = object({
4154
4154
  volume: number$1().nullable(),
4155
4155
  week_52_high: number$1().nullable(),
4156
4156
  week_52_low: number$1().nullable()
4157
- }), r = object({
4157
+ }), a = object({
4158
4158
  status: _enum(["SUCCESS", "FAILURE"]),
4159
- payload: g
4159
+ payload: _
4160
4160
  }), y = object({
4161
4161
  nseSymbol: string(),
4162
4162
  name: string(),
4163
4163
  price: number$1(),
4164
- quoteData: r.nullable().optional()
4164
+ quoteData: a.nullable().optional()
4165
4165
  }), t = object({
4166
4166
  statusCode: number$1(),
4167
4167
  message: string(),
@@ -4188,8 +4188,8 @@ const m = [
4188
4188
  ], n = string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/, {
4189
4189
  message: "datetime must be in format YYYY-MM-DDTHH:mm:ss (e.g., 2025-12-26T11:06:00)"
4190
4190
  }).refine(
4191
- (a) => {
4192
- const u = new Date(a);
4191
+ (r) => {
4192
+ const u = new Date(r);
4193
4193
  return !isNaN(u.getTime());
4194
4194
  },
4195
4195
  {
@@ -4198,8 +4198,8 @@ const m = [
4198
4198
  ), i = string().regex(/^\d{4}-\d{2}-\d{2}$/, {
4199
4199
  message: "date must be in format YYYY-MM-DD (e.g., 2025-12-26)"
4200
4200
  }).refine(
4201
- (a) => {
4202
- const u = new Date(a);
4201
+ (r) => {
4202
+ const u = new Date(r);
4203
4203
  return !isNaN(u.getTime());
4204
4204
  },
4205
4205
  {
@@ -4208,14 +4208,14 @@ const m = [
4208
4208
  ), o = string().regex(/^([A-Za-z_]+\/[A-Za-z_]+|[+-]\d{2}:\d{2})$/, {
4209
4209
  message: "timezone must be an IANA identifier (e.g., 'Asia/Kolkata') or offset (e.g., '+05:30')"
4210
4210
  }).refine(
4211
- (a) => {
4212
- if (a.includes("/"))
4211
+ (r) => {
4212
+ if (r.includes("/"))
4213
4213
  try {
4214
- return new Intl.DateTimeFormat("en-US", { timeZone: a }), true;
4214
+ return new Intl.DateTimeFormat("en-US", { timeZone: r }), true;
4215
4215
  } catch {
4216
4216
  return false;
4217
4217
  }
4218
- return /^([+-]\d{2}:\d{2})$/.test(a);
4218
+ return /^([+-]\d{2}:\d{2})$/.test(r);
4219
4219
  },
4220
4220
  {
4221
4221
  message: "timezone must be a valid IANA identifier or UTC offset"
@@ -4224,10 +4224,10 @@ const m = [
4224
4224
  nseSymbol: string(),
4225
4225
  name: string(),
4226
4226
  price: number$1(),
4227
- quoteData: r.nullable().optional()
4227
+ quoteData: a.nullable().optional()
4228
4228
  }), c = _enum(["TOP_GAINERS", "VOLUME_SHOCKERS"]), b = object({
4229
4229
  nseSymbol: string(),
4230
- quoteData: r
4230
+ quoteData: a
4231
4231
  });
4232
4232
  ({
4233
4233
  body: object({
@@ -4269,7 +4269,7 @@ const m = [
4269
4269
  data: object({
4270
4270
  timestamp: n,
4271
4271
  timezone: o.optional(),
4272
- quoteData: r,
4272
+ quoteData: a,
4273
4273
  dayChangePerc: number$1()
4274
4274
  })
4275
4275
  }),
@@ -4294,7 +4294,7 @@ const p = object({
4294
4294
  end_time: string(),
4295
4295
  interval_in_minutes: number$1()
4296
4296
  })
4297
- }), v = {
4297
+ }), f = {
4298
4298
  query: object({
4299
4299
  symbol: string(),
4300
4300
  interval: _enum(m),
@@ -4305,7 +4305,7 @@ const p = object({
4305
4305
  response: t.extend({
4306
4306
  data: p
4307
4307
  })
4308
- }, f = {
4308
+ }, v = {
4309
4309
  query: object({
4310
4310
  symbol: string(),
4311
4311
  exchange: _enum(["NSE", "BSE"]).optional(),
@@ -4314,13 +4314,13 @@ const p = object({
4314
4314
  timezone: o.optional()
4315
4315
  }),
4316
4316
  response: t.extend({
4317
- data: r.nullable()
4317
+ data: a.nullable()
4318
4318
  })
4319
4319
  }, T = {
4320
4320
  response: t.extend({
4321
4321
  data: string()
4322
4322
  })
4323
- }, P = {
4323
+ }, x = {
4324
4324
  query: object({
4325
4325
  symbol: string(),
4326
4326
  date: i
@@ -4333,7 +4333,7 @@ const p = object({
4333
4333
  timestamp: string(),
4334
4334
  // Format: YYYY-MM-DDTHH:mm:ss (UTC)
4335
4335
  nseSymbol: string(),
4336
- quoteData: r,
4336
+ quoteData: a,
4337
4337
  createdAt: string(),
4338
4338
  // Format: YYYY-MM-DDTHH:mm:ss (UTC)
4339
4339
  updatedAt: string()
@@ -4342,31 +4342,40 @@ const p = object({
4342
4342
  )
4343
4343
  })
4344
4344
  })
4345
- }, _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4345
+ }, P = {
4346
+ query: object({
4347
+ datetime: n.optional(),
4348
+ timezone: o.optional()
4349
+ }),
4350
+ response: t.extend({
4351
+ data: a.nullable()
4352
+ })
4353
+ }, ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4346
4354
  __proto__: null,
4347
- getGrowwHistoricalCandles: v,
4348
- getGrowwQuote: f,
4349
- getGrowwQuoteTimeline: P,
4355
+ getGrowwHistoricalCandles: f,
4356
+ getGrowwNiftyQuote: P,
4357
+ getGrowwQuote: v,
4358
+ getGrowwQuoteTimeline: x,
4350
4359
  getGrowwToken: T,
4351
4360
  growwHistoricalCandlesSchema: p
4352
- }, Symbol.toStringTag, { value: "Module" })), _ = object({
4361
+ }, Symbol.toStringTag, { value: "Module" })), g = object({
4353
4362
  name: string(),
4354
4363
  price: number$1(),
4355
4364
  nseSymbol: string()
4356
- }), O = {
4365
+ }), q = {
4357
4366
  query: object({
4358
4367
  type: _enum(["top-gainers", "volume-shockers"]),
4359
4368
  datetime: n.optional(),
4360
4369
  timezone: o.optional()
4361
4370
  }),
4362
4371
  response: t.extend({
4363
- data: array(_).nullable()
4372
+ data: array(g).nullable()
4364
4373
  })
4365
- }, ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4374
+ }, je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4366
4375
  __proto__: null,
4367
- getLists: O,
4368
- listSchema: _
4369
- }, Symbol.toStringTag, { value: "Module" })), q = {
4376
+ getLists: q,
4377
+ listSchema: g
4378
+ }, Symbol.toStringTag, { value: "Module" })), O = {
4370
4379
  query: object({}),
4371
4380
  response: t.extend({
4372
4381
  data: object({
@@ -4380,10 +4389,10 @@ const p = object({
4380
4389
  )
4381
4390
  })
4382
4391
  })
4383
- }, x = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4392
+ }, w = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4384
4393
  __proto__: null,
4385
- getAvailableDatetimes: q
4386
- }, Symbol.toStringTag, { value: "Module" })), w = {
4394
+ getAvailableDatetimes: O
4395
+ }, Symbol.toStringTag, { value: "Module" })), z = {
4387
4396
  query: object({
4388
4397
  symbol: string(),
4389
4398
  date: i,
@@ -4405,10 +4414,10 @@ const p = object({
4405
4414
  interval_in_minutes: number$1()
4406
4415
  })
4407
4416
  })
4408
- }, z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4417
+ }, D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4409
4418
  __proto__: null,
4410
- getCandles: w
4411
- }, Symbol.toStringTag, { value: "Module" })), D = {
4419
+ getCandles: z
4420
+ }, Symbol.toStringTag, { value: "Module" })), C = {
4412
4421
  query: object({
4413
4422
  date: i,
4414
4423
  type: _enum(t$1)
@@ -4428,10 +4437,10 @@ const p = object({
4428
4437
  )
4429
4438
  })
4430
4439
  })
4431
- }, C = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4440
+ }, M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4432
4441
  __proto__: null,
4433
- getDailyPersistentCompanies: D
4434
- }, Symbol.toStringTag, { value: "Module" })), M = {
4442
+ getDailyPersistentCompanies: C
4443
+ }, Symbol.toStringTag, { value: "Module" })), R = {
4435
4444
  query: object({
4436
4445
  date: i,
4437
4446
  type: _enum(t$1)
@@ -4445,21 +4454,21 @@ const p = object({
4445
4454
  })
4446
4455
  }, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4447
4456
  __proto__: null,
4448
- getDailyUniqueCompanies: M
4449
- }, Symbol.toStringTag, { value: "Module" })), R = object({
4457
+ getDailyUniqueCompanies: R
4458
+ }, Symbol.toStringTag, { value: "Module" })), k = object({
4450
4459
  id: uuid(),
4451
4460
  username: string()
4452
- }), k = {
4461
+ }), E = {
4453
4462
  body: object({
4454
4463
  developerToken: string().nonempty("Developer token is required")
4455
4464
  }),
4456
4465
  response: t.extend({
4457
- data: R
4466
+ data: k
4458
4467
  })
4459
- }, E = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4468
+ }, I = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4460
4469
  __proto__: null,
4461
- signIn: k
4462
- }, Symbol.toStringTag, { value: "Module" })), I = {
4470
+ signIn: E
4471
+ }, Symbol.toStringTag, { value: "Module" })), L = {
4463
4472
  query: object({
4464
4473
  symbol: string(),
4465
4474
  date: i
@@ -4472,7 +4481,7 @@ const p = object({
4472
4481
  timestamp: string(),
4473
4482
  // Format: YYYY-MM-DDTHH:mm:ss (UTC)
4474
4483
  nseSymbol: string(),
4475
- quoteData: r,
4484
+ quoteData: a,
4476
4485
  createdAt: string(),
4477
4486
  // Format: YYYY-MM-DDTHH:mm:ss (UTC)
4478
4487
  updatedAt: string()
@@ -4481,20 +4490,22 @@ const p = object({
4481
4490
  )
4482
4491
  })
4483
4492
  })
4484
- }, L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4493
+ }, N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4485
4494
  __proto__: null,
4486
- getQuoteTimeline: I
4487
- }, Symbol.toStringTag, { value: "Module" })), N = object({
4495
+ getQuoteTimeline: L
4496
+ }, Symbol.toStringTag, { value: "Module" })), G = object({
4488
4497
  id: uuid(),
4489
4498
  start_datetime: string(),
4490
4499
  end_datetime: string(),
4491
4500
  completed: boolean(),
4492
- orderCount: number$1()
4501
+ orderCount: number$1(),
4502
+ name: string().nullable().optional(),
4503
+ tags: array(string()).optional()
4493
4504
  }), U = record(
4494
4505
  string(),
4495
4506
  // date string (YYYY-MM-DD)
4496
- array(N)
4497
- ), G = {
4507
+ array(G)
4508
+ ), Q = {
4498
4509
  response: t.extend({
4499
4510
  data: U
4500
4511
  })
@@ -4527,36 +4538,44 @@ const p = object({
4527
4538
  response: t.extend({
4528
4539
  data: array(Y)
4529
4540
  })
4530
- }, Q = object({
4541
+ }, $ = object({
4531
4542
  start_datetime: n,
4532
4543
  end_datetime: n,
4533
- timezone: o.optional()
4534
- }), $ = object({
4544
+ timezone: o.optional(),
4545
+ name: string().optional(),
4546
+ tags: array(string().min(1).max(50)).optional()
4547
+ }), F = object({
4535
4548
  id: uuid(),
4536
4549
  start_datetime: n,
4537
4550
  end_datetime: n,
4538
- completed: boolean()
4539
- }), F = {
4540
- body: Q,
4551
+ completed: boolean(),
4552
+ name: string().nullable().optional(),
4553
+ tags: array(string()).optional()
4554
+ }), B = {
4555
+ body: $,
4541
4556
  response: t.extend({
4542
- data: $
4557
+ data: F
4543
4558
  })
4544
- }, B = object({
4545
- completed: boolean().optional()
4546
- }), K = object({
4559
+ }, K = object({
4560
+ completed: boolean().optional(),
4561
+ name: string().nullable().optional(),
4562
+ tags: array(string().min(1).max(50)).optional()
4563
+ }), Z = object({
4547
4564
  id: uuid(),
4548
4565
  start_datetime: string(),
4549
4566
  end_datetime: string(),
4550
- completed: boolean()
4551
- }), Z = {
4567
+ completed: boolean(),
4568
+ name: string().nullable().optional(),
4569
+ tags: array(string()).optional()
4570
+ }), V = {
4552
4571
  params: object({
4553
4572
  runId: uuid()
4554
4573
  }),
4555
- body: B,
4574
+ body: K,
4556
4575
  response: t.extend({
4557
- data: K
4576
+ data: Z
4558
4577
  })
4559
- }, V = {
4578
+ }, J = {
4560
4579
  params: object({
4561
4580
  runId: uuid()
4562
4581
  }),
@@ -4565,14 +4584,14 @@ const p = object({
4565
4584
  id: uuid()
4566
4585
  })
4567
4586
  })
4568
- }, J = object({
4587
+ }, W = object({
4569
4588
  nseSymbol: string(),
4570
4589
  entryPrice: number(),
4571
4590
  stopLossPrice: number(),
4572
4591
  takeProfitPrice: number(),
4573
4592
  datetime: n,
4574
4593
  timezone: o.optional()
4575
- }), W = object({
4594
+ }), X = object({
4576
4595
  id: uuid(),
4577
4596
  nseSymbol: string(),
4578
4597
  entryPrice: number(),
@@ -4580,23 +4599,28 @@ const p = object({
4580
4599
  takeProfitPrice: number(),
4581
4600
  datetime: string(),
4582
4601
  runId: uuid()
4583
- }), X = {
4602
+ }), ee = {
4584
4603
  params: object({
4585
4604
  runId: uuid()
4586
4605
  }),
4587
- body: J,
4606
+ body: W,
4588
4607
  response: t.extend({
4589
- data: W
4608
+ data: X
4590
4609
  })
4591
- }, ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4610
+ }, te = {
4611
+ response: t.extend({
4612
+ data: array(string())
4613
+ })
4614
+ }, ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4592
4615
  __proto__: null,
4593
- createOrder: X,
4594
- createRun: F,
4595
- deleteRun: V,
4616
+ createOrder: ee,
4617
+ createRun: B,
4618
+ deleteRun: J,
4596
4619
  getRunOrders: H,
4597
- getRuns: G,
4598
- updateRun: Z
4599
- }, Symbol.toStringTag, { value: "Module" })), te = {
4620
+ getRunTags: te,
4621
+ getRuns: Q,
4622
+ updateRun: V
4623
+ }, Symbol.toStringTag, { value: "Module" })), oe = {
4600
4624
  query: object({
4601
4625
  datetime: n,
4602
4626
  timezone: o.optional(),
@@ -4613,19 +4637,19 @@ const p = object({
4613
4637
  }).nullable()
4614
4638
  })
4615
4639
  })
4616
- }, ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4640
+ }, ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4617
4641
  __proto__: null,
4618
- getShortlists: te
4619
- }, Symbol.toStringTag, { value: "Module" })), ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4642
+ getShortlists: oe
4643
+ }, Symbol.toStringTag, { value: "Module" })), he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4620
4644
  __proto__: null,
4621
- v1_dashboard_auth_schemas: E,
4622
- v1_dashboard_available_datetimes_schemas: x,
4623
- v1_dashboard_candles_schemas: z,
4624
- v1_dashboard_daily_persistent_companies_schemas: C,
4645
+ v1_dashboard_auth_schemas: I,
4646
+ v1_dashboard_available_datetimes_schemas: w,
4647
+ v1_dashboard_candles_schemas: D,
4648
+ v1_dashboard_daily_persistent_companies_schemas: M,
4625
4649
  v1_dashboard_daily_unique_companies_schemas: A,
4626
- v1_dashboard_quote_timeline_schemas: L,
4627
- v1_dashboard_runs_schemas: ee,
4628
- v1_dashboard_shortlists_schemas: ne
4650
+ v1_dashboard_quote_timeline_schemas: N,
4651
+ v1_dashboard_runs_schemas: ne,
4652
+ v1_dashboard_shortlists_schemas: ae
4629
4653
  }, Symbol.toStringTag, { value: "Module" }));
4630
4654
  ({
4631
4655
  response: t.extend({
@@ -4699,25 +4723,25 @@ function getAugmentedNamespace(n2) {
4699
4723
  if (n2.__esModule) return n2;
4700
4724
  var f2 = n2.default;
4701
4725
  if (typeof f2 == "function") {
4702
- var a = function a2() {
4703
- if (this instanceof a2) {
4726
+ var a2 = function a3() {
4727
+ if (this instanceof a3) {
4704
4728
  return Reflect.construct(f2, arguments, this.constructor);
4705
4729
  }
4706
4730
  return f2.apply(this, arguments);
4707
4731
  };
4708
- a.prototype = f2.prototype;
4709
- } else a = {};
4710
- Object.defineProperty(a, "__esModule", { value: true });
4732
+ a2.prototype = f2.prototype;
4733
+ } else a2 = {};
4734
+ Object.defineProperty(a2, "__esModule", { value: true });
4711
4735
  Object.keys(n2).forEach(function(k2) {
4712
4736
  var d2 = Object.getOwnPropertyDescriptor(n2, k2);
4713
- Object.defineProperty(a, k2, d2.get ? d2 : {
4737
+ Object.defineProperty(a2, k2, d2.get ? d2 : {
4714
4738
  enumerable: true,
4715
4739
  get: function() {
4716
4740
  return n2[k2];
4717
4741
  }
4718
4742
  });
4719
4743
  });
4720
- return a;
4744
+ return a2;
4721
4745
  }
4722
4746
  var utc$1 = { exports: {} };
4723
4747
  (function(module, exports$1) {
@@ -4736,9 +4760,9 @@ var utc$1 = { exports: {} };
4736
4760
  }, u.local = function() {
4737
4761
  return n2(this.toDate(), { locale: this.$L, utc: false });
4738
4762
  };
4739
- var r2 = u.parse;
4763
+ var r = u.parse;
4740
4764
  u.parse = function(t3) {
4741
- t3.utc && (this.$u = true), this.$utils().u(t3.$offset) || (this.$offset = t3.$offset), r2.call(this, t3);
4765
+ t3.utc && (this.$u = true), this.$utils().u(t3.$offset) || (this.$offset = t3.$offset), r.call(this, t3);
4742
4766
  };
4743
4767
  var o2 = u.init;
4744
4768
  u.init = function() {
@@ -4747,10 +4771,10 @@ var utc$1 = { exports: {} };
4747
4771
  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();
4748
4772
  } else o2.call(this);
4749
4773
  };
4750
- var a = u.utcOffset;
4774
+ var a2 = u.utcOffset;
4751
4775
  u.utcOffset = function(s2, f3) {
4752
4776
  var n3 = this.$utils().u;
4753
- if (n3(s2)) return this.$u ? 0 : n3(this.$offset) ? a.call(this) : this.$offset;
4777
+ if (n3(s2)) return this.$u ? 0 : n3(this.$offset) ? a2.call(this) : this.$offset;
4754
4778
  if ("string" == typeof s2 && (s2 = function(t3) {
4755
4779
  void 0 === t3 && (t3 = "");
4756
4780
  var s3 = t3.match(i2);
@@ -4760,10 +4784,10 @@ var utc$1 = { exports: {} };
4760
4784
  }(s2), null === s2)) return this;
4761
4785
  var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2;
4762
4786
  if (0 === u2) return this.utc(f3);
4763
- var r3 = this.clone();
4764
- if (f3) return r3.$offset = u2, r3.$u = false, r3;
4787
+ var r2 = this.clone();
4788
+ if (f3) return r2.$offset = u2, r2.$u = false, r2;
4765
4789
  var o3 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
4766
- return (r3 = this.local().add(u2 + o3, t2)).$offset = u2, r3.$x.$localOffset = o3, r3;
4790
+ return (r2 = this.local().add(u2 + o3, t2)).$offset = u2, r2.$x.$localOffset = o3, r2;
4767
4791
  };
4768
4792
  var h = u.format;
4769
4793
  u.format = function(t3) {
@@ -4801,25 +4825,25 @@ var timezone$1 = { exports: {} };
4801
4825
  }(commonjsGlobal, function() {
4802
4826
  var t2 = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {};
4803
4827
  return function(n2, i2, o2) {
4804
- var r2, a = function(t3, n3, i3) {
4828
+ var r, a2 = function(t3, n3, i3) {
4805
4829
  void 0 === i3 && (i3 = {});
4806
- var o3 = new Date(t3), r3 = function(t4, n4) {
4830
+ var o3 = new Date(t3), r2 = function(t4, n4) {
4807
4831
  void 0 === n4 && (n4 = {});
4808
- var i4 = n4.timeZoneName || "short", o4 = t4 + "|" + i4, r4 = e[o4];
4809
- 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: i4 }), e[o4] = r4), r4;
4832
+ var i4 = n4.timeZoneName || "short", o4 = t4 + "|" + i4, r3 = e[o4];
4833
+ return r3 || (r3 = 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: i4 }), e[o4] = r3), r3;
4810
4834
  }(n3, i3);
4811
- return r3.formatToParts(o3);
4835
+ return r2.formatToParts(o3);
4812
4836
  }, u = function(e2, n3) {
4813
- for (var i3 = a(e2, n3), r3 = [], u2 = 0; u2 < i3.length; u2 += 1) {
4837
+ for (var i3 = a2(e2, n3), r2 = [], u2 = 0; u2 < i3.length; u2 += 1) {
4814
4838
  var f3 = i3[u2], s2 = f3.type, m2 = f3.value, c2 = t2[s2];
4815
- c2 >= 0 && (r3[c2] = parseInt(m2, 10));
4839
+ c2 >= 0 && (r2[c2] = parseInt(m2, 10));
4816
4840
  }
4817
- var d2 = r3[3], l2 = 24 === d2 ? 0 : d2, h = r3[0] + "-" + r3[1] + "-" + r3[2] + " " + l2 + ":" + r3[4] + ":" + r3[5] + ":000", v2 = +e2;
4841
+ var d2 = r2[3], l2 = 24 === d2 ? 0 : d2, h = r2[0] + "-" + r2[1] + "-" + r2[2] + " " + l2 + ":" + r2[4] + ":" + r2[5] + ":000", v2 = +e2;
4818
4842
  return (o2.utc(h).valueOf() - (v2 -= v2 % 1e3)) / 6e4;
4819
4843
  }, f2 = i2.prototype;
4820
4844
  f2.tz = function(t3, e2) {
4821
- void 0 === t3 && (t3 = r2);
4822
- var n3, i3 = this.utcOffset(), a2 = this.toDate(), u2 = a2.toLocaleString("en-US", { timeZone: t3 }), f3 = Math.round((a2 - new Date(u2)) / 1e3 / 60), s2 = 15 * -Math.round(a2.getTimezoneOffset() / 15) - f3;
4845
+ void 0 === t3 && (t3 = r);
4846
+ var n3, i3 = this.utcOffset(), a3 = this.toDate(), u2 = a3.toLocaleString("en-US", { timeZone: t3 }), f3 = Math.round((a3 - new Date(u2)) / 1e3 / 60), s2 = 15 * -Math.round(a3.getTimezoneOffset() / 15) - f3;
4823
4847
  if (!Number(s2)) n3 = this.utcOffset(0, e2);
4824
4848
  else if (n3 = o2(u2, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s2, true), e2) {
4825
4849
  var m2 = n3.utcOffset();
@@ -4827,7 +4851,7 @@ var timezone$1 = { exports: {} };
4827
4851
  }
4828
4852
  return n3.$x.$timezone = t3, n3;
4829
4853
  }, f2.offsetName = function(t3) {
4830
- var e2 = this.$x.$timezone || o2.tz.guess(), n3 = a(this.valueOf(), e2, { timeZoneName: t3 }).find(function(t4) {
4854
+ var e2 = this.$x.$timezone || o2.tz.guess(), n3 = a2(this.valueOf(), e2, { timeZoneName: t3 }).find(function(t4) {
4831
4855
  return "timezonename" === t4.type.toLowerCase();
4832
4856
  });
4833
4857
  return n3 && n3.value;
@@ -4838,19 +4862,19 @@ var timezone$1 = { exports: {} };
4838
4862
  var n3 = o2(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
4839
4863
  return s.call(n3, t3, e2).tz(this.$x.$timezone, true);
4840
4864
  }, o2.tz = function(t3, e2, n3) {
4841
- var i3 = n3 && e2, a2 = n3 || e2 || r2, f3 = u(+o2(), a2);
4842
- if ("string" != typeof t3) return o2(t3).tz(a2);
4865
+ var i3 = n3 && e2, a3 = n3 || e2 || r, f3 = u(+o2(), a3);
4866
+ if ("string" != typeof t3) return o2(t3).tz(a3);
4843
4867
  var s2 = function(t4, e3, n4) {
4844
4868
  var i4 = t4 - 60 * e3 * 1e3, o3 = u(i4, n4);
4845
4869
  if (e3 === o3) return [i4, e3];
4846
- var r3 = u(i4 -= 60 * (o3 - e3) * 1e3, n4);
4847
- return o3 === r3 ? [i4, o3] : [t4 - 60 * Math.min(o3, r3) * 1e3, Math.max(o3, r3)];
4848
- }(o2.utc(t3, i3).valueOf(), f3, a2), m2 = s2[0], c2 = s2[1], d2 = o2(m2).utcOffset(c2);
4849
- return d2.$x.$timezone = a2, d2;
4870
+ var r2 = u(i4 -= 60 * (o3 - e3) * 1e3, n4);
4871
+ return o3 === r2 ? [i4, o3] : [t4 - 60 * Math.min(o3, r2) * 1e3, Math.max(o3, r2)];
4872
+ }(o2.utc(t3, i3).valueOf(), f3, a3), m2 = s2[0], c2 = s2[1], d2 = o2(m2).utcOffset(c2);
4873
+ return d2.$x.$timezone = a3, d2;
4850
4874
  }, o2.tz.guess = function() {
4851
4875
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
4852
4876
  }, o2.tz.setDefault = function(t3) {
4853
- r2 = t3;
4877
+ r = t3;
4854
4878
  };
4855
4879
  };
4856
4880
  });
@@ -4991,15 +5015,15 @@ function merge() {
4991
5015
  }
4992
5016
  return result;
4993
5017
  }
4994
- const extend = (a, b2, thisArg, { allOwnKeys } = {}) => {
5018
+ const extend = (a2, b2, thisArg, { allOwnKeys } = {}) => {
4995
5019
  forEach(b2, (val, key) => {
4996
5020
  if (thisArg && isFunction$1(val)) {
4997
- a[key] = bind(val, thisArg);
5021
+ a2[key] = bind(val, thisArg);
4998
5022
  } else {
4999
- a[key] = val;
5023
+ a2[key] = val;
5000
5024
  }
5001
5025
  }, { allOwnKeys });
5002
- return a;
5026
+ return a2;
5003
5027
  };
5004
5028
  const stripBOM = (content) => {
5005
5029
  if (content.charCodeAt(0) === 65279) {
@@ -6243,30 +6267,30 @@ function mergeConfig$1(config1, config2) {
6243
6267
  }
6244
6268
  return source;
6245
6269
  }
6246
- function mergeDeepProperties(a, b2, prop, caseless) {
6270
+ function mergeDeepProperties(a2, b2, prop, caseless) {
6247
6271
  if (!utils$1.isUndefined(b2)) {
6248
- return getMergedValue(a, b2, prop, caseless);
6249
- } else if (!utils$1.isUndefined(a)) {
6250
- return getMergedValue(void 0, a, prop, caseless);
6272
+ return getMergedValue(a2, b2, prop, caseless);
6273
+ } else if (!utils$1.isUndefined(a2)) {
6274
+ return getMergedValue(void 0, a2, prop, caseless);
6251
6275
  }
6252
6276
  }
6253
- function valueFromConfig2(a, b2) {
6277
+ function valueFromConfig2(a2, b2) {
6254
6278
  if (!utils$1.isUndefined(b2)) {
6255
6279
  return getMergedValue(void 0, b2);
6256
6280
  }
6257
6281
  }
6258
- function defaultToConfig2(a, b2) {
6282
+ function defaultToConfig2(a2, b2) {
6259
6283
  if (!utils$1.isUndefined(b2)) {
6260
6284
  return getMergedValue(void 0, b2);
6261
- } else if (!utils$1.isUndefined(a)) {
6262
- return getMergedValue(void 0, a);
6285
+ } else if (!utils$1.isUndefined(a2)) {
6286
+ return getMergedValue(void 0, a2);
6263
6287
  }
6264
6288
  }
6265
- function mergeDirectKeys(a, b2, prop) {
6289
+ function mergeDirectKeys(a2, b2, prop) {
6266
6290
  if (prop in config2) {
6267
- return getMergedValue(a, b2);
6291
+ return getMergedValue(a2, b2);
6268
6292
  } else if (prop in config1) {
6269
- return getMergedValue(void 0, a);
6293
+ return getMergedValue(void 0, a2);
6270
6294
  }
6271
6295
  }
6272
6296
  const mergeMap = {
@@ -6298,7 +6322,7 @@ function mergeConfig$1(config1, config2) {
6298
6322
  socketPath: defaultToConfig2,
6299
6323
  responseEncoding: defaultToConfig2,
6300
6324
  validateStatus: mergeDirectKeys,
6301
- headers: (a, b2, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b2), prop, true)
6325
+ headers: (a2, b2, prop) => mergeDeepProperties(headersToObject(a2), headersToObject(b2), prop, true)
6302
6326
  };
6303
6327
  utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
6304
6328
  const merge2 = mergeMap[prop] || mergeDeepProperties;
@@ -7376,7 +7400,7 @@ function format$1(f2, args, opts) {
7376
7400
  var argLen = args.length;
7377
7401
  if (argLen === 0) return f2;
7378
7402
  var str = "";
7379
- var a = 1 - offset;
7403
+ var a2 = 1 - offset;
7380
7404
  var lastPos = -1;
7381
7405
  var flen = f2 && f2.length || 0;
7382
7406
  for (var i2 = 0; i2 < flen; ) {
@@ -7385,56 +7409,56 @@ function format$1(f2, args, opts) {
7385
7409
  switch (f2.charCodeAt(i2 + 1)) {
7386
7410
  case 100:
7387
7411
  case 102:
7388
- if (a >= argLen)
7412
+ if (a2 >= argLen)
7389
7413
  break;
7390
- if (args[a] == null) break;
7414
+ if (args[a2] == null) break;
7391
7415
  if (lastPos < i2)
7392
7416
  str += f2.slice(lastPos, i2);
7393
- str += Number(args[a]);
7417
+ str += Number(args[a2]);
7394
7418
  lastPos = i2 + 2;
7395
7419
  i2++;
7396
7420
  break;
7397
7421
  case 105:
7398
- if (a >= argLen)
7422
+ if (a2 >= argLen)
7399
7423
  break;
7400
- if (args[a] == null) break;
7424
+ if (args[a2] == null) break;
7401
7425
  if (lastPos < i2)
7402
7426
  str += f2.slice(lastPos, i2);
7403
- str += Math.floor(Number(args[a]));
7427
+ str += Math.floor(Number(args[a2]));
7404
7428
  lastPos = i2 + 2;
7405
7429
  i2++;
7406
7430
  break;
7407
7431
  case 79:
7408
7432
  case 111:
7409
7433
  case 106:
7410
- if (a >= argLen)
7434
+ if (a2 >= argLen)
7411
7435
  break;
7412
- if (args[a] === void 0) break;
7436
+ if (args[a2] === void 0) break;
7413
7437
  if (lastPos < i2)
7414
7438
  str += f2.slice(lastPos, i2);
7415
- var type = typeof args[a];
7439
+ var type = typeof args[a2];
7416
7440
  if (type === "string") {
7417
- str += "'" + args[a] + "'";
7441
+ str += "'" + args[a2] + "'";
7418
7442
  lastPos = i2 + 2;
7419
7443
  i2++;
7420
7444
  break;
7421
7445
  }
7422
7446
  if (type === "function") {
7423
- str += args[a].name || "<anonymous>";
7447
+ str += args[a2].name || "<anonymous>";
7424
7448
  lastPos = i2 + 2;
7425
7449
  i2++;
7426
7450
  break;
7427
7451
  }
7428
- str += ss(args[a]);
7452
+ str += ss(args[a2]);
7429
7453
  lastPos = i2 + 2;
7430
7454
  i2++;
7431
7455
  break;
7432
7456
  case 115:
7433
- if (a >= argLen)
7457
+ if (a2 >= argLen)
7434
7458
  break;
7435
7459
  if (lastPos < i2)
7436
7460
  str += f2.slice(lastPos, i2);
7437
- str += String(args[a]);
7461
+ str += String(args[a2]);
7438
7462
  lastPos = i2 + 2;
7439
7463
  i2++;
7440
7464
  break;
@@ -7444,10 +7468,10 @@ function format$1(f2, args, opts) {
7444
7468
  str += "%";
7445
7469
  lastPos = i2 + 2;
7446
7470
  i2++;
7447
- a--;
7471
+ a2--;
7448
7472
  break;
7449
7473
  }
7450
- ++a;
7474
+ ++a2;
7451
7475
  }
7452
7476
  ++i2;
7453
7477
  }
@@ -7854,8 +7878,8 @@ function getTimeFunction(opts) {
7854
7878
  function mock() {
7855
7879
  return {};
7856
7880
  }
7857
- function passthrough(a) {
7858
- return a;
7881
+ function passthrough(a2) {
7882
+ return a2;
7859
7883
  }
7860
7884
  function noop() {
7861
7885
  }
@@ -7914,7 +7938,7 @@ const fetchCandles = ({
7914
7938
  );
7915
7939
  }
7916
7940
  try {
7917
- const validatedParams = _e.getGrowwHistoricalCandles.query.parse(params);
7941
+ const validatedParams = ye.getGrowwHistoricalCandles.query.parse(params);
7918
7942
  const headers = {
7919
7943
  Authorization: `Bearer ${developerToken}`
7920
7944
  };
@@ -7958,7 +7982,7 @@ const fetchQuote = ({
7958
7982
  );
7959
7983
  }
7960
7984
  try {
7961
- const validatedParams = _e.getGrowwQuote.query.parse(params);
7985
+ const validatedParams = ye.getGrowwQuote.query.parse(params);
7962
7986
  const headers = {
7963
7987
  Authorization: `Bearer ${developerToken}`
7964
7988
  };
@@ -7998,7 +8022,7 @@ const fetchQuoteTimeline = ({
7998
8022
  throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
7999
8023
  }
8000
8024
  try {
8001
- const validatedParams = _e.getGrowwQuoteTimeline.query.parse({
8025
+ const validatedParams = ye.getGrowwQuoteTimeline.query.parse({
8002
8026
  symbol,
8003
8027
  date: date2
8004
8028
  });
@@ -8045,7 +8069,7 @@ const fetchShortlist = ({
8045
8069
  );
8046
8070
  }
8047
8071
  try {
8048
- const validatedParams = ge.getLists.query.parse(queryParams);
8072
+ const validatedParams = je.getLists.query.parse(queryParams);
8049
8073
  const headers = {
8050
8074
  Authorization: `Bearer ${developerToken}`
8051
8075
  };
@@ -8074,6 +8098,48 @@ const fetchShortlist = ({
8074
8098
  throw error;
8075
8099
  }
8076
8100
  };
8101
+ dayjs.extend(utc);
8102
+ dayjs.extend(timezone);
8103
+ const fetchNiftyQuote = ({
8104
+ developerToken,
8105
+ apiDomain,
8106
+ runId,
8107
+ currentTimestamp,
8108
+ currentTimezone = "Asia/Kolkata"
8109
+ }) => async (params) => {
8110
+ if (!developerToken) {
8111
+ throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
8112
+ }
8113
+ try {
8114
+ const validatedParams = ye.getGrowwNiftyQuote.query.parse(params);
8115
+ const headers = {
8116
+ Authorization: `Bearer ${developerToken}`
8117
+ };
8118
+ if (runId) {
8119
+ headers["X-Run-Id"] = runId;
8120
+ }
8121
+ if (currentTimestamp) {
8122
+ headers["X-Current-Timestamp"] = currentTimestamp;
8123
+ }
8124
+ if (currentTimezone) {
8125
+ headers["X-Current-Timezone"] = currentTimezone;
8126
+ }
8127
+ const response = await axios.get(`${apiDomain}/v1/developer/groww/nifty`, {
8128
+ params: validatedParams,
8129
+ headers
8130
+ });
8131
+ return response.data.data;
8132
+ } catch (error) {
8133
+ if (axios.isAxiosError(error)) {
8134
+ logger.error(`Error fetching NIFTY quote: ${error.message}`);
8135
+ throw new Error(
8136
+ `Failed to fetch NIFTY quote: ${error.response?.data?.message || error.message}`
8137
+ );
8138
+ }
8139
+ logger.error(`Unexpected error fetching NIFTY quote: ${error}`);
8140
+ throw error;
8141
+ }
8142
+ };
8077
8143
  function isRetryableError(error) {
8078
8144
  if (axios.isAxiosError(error)) {
8079
8145
  const axiosError = error;
@@ -8152,7 +8218,7 @@ const placeOrder = ({ runId, apiClient }) => async (data) => {
8152
8218
  try {
8153
8219
  await retryWithBackoff(
8154
8220
  async () => {
8155
- const validatedData = ye.v1_dashboard_runs_schemas.createOrder.body.parse(data);
8221
+ const validatedData = he.v1_dashboard_runs_schemas.createOrder.body.parse(data);
8156
8222
  await apiClient.post(`/v1/dashboard/runs/${runId}/orders`, validatedData);
8157
8223
  logger.debug(`Order persisted for ${data.nseSymbol} in runId: ${runId}`);
8158
8224
  },
@@ -8268,11 +8334,11 @@ var calendar$1 = { exports: {} };
8268
8334
  !function(e, t2) {
8269
8335
  module.exports = t2();
8270
8336
  }(commonjsGlobal, function() {
8271
- return function(e, t2, a) {
8337
+ return function(e, t2, a2) {
8272
8338
  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" };
8273
8339
  t2.prototype.calendar = function(e2, t3) {
8274
- var n3 = t3 || this.$locale().calendar || d2, o2 = a(e2 || void 0).startOf("d"), s = this.diff(o2, "d", true), i2 = "sameElse", f2 = s < -6 ? i2 : s < -1 ? "lastWeek" : s < 0 ? "lastDay" : s < 1 ? "sameDay" : s < 2 ? "nextDay" : s < 7 ? "nextWeek" : i2, l2 = n3[f2] || d2[f2];
8275
- return "function" == typeof l2 ? l2.call(this, a()) : this.format(l2);
8340
+ var n3 = t3 || this.$locale().calendar || d2, o2 = a2(e2 || void 0).startOf("d"), s = this.diff(o2, "d", true), i2 = "sameElse", f2 = s < -6 ? i2 : s < -1 ? "lastWeek" : s < 0 ? "lastDay" : s < 1 ? "sameDay" : s < 2 ? "nextDay" : s < 7 ? "nextWeek" : i2, l2 = n3[f2] || d2[f2];
8341
+ return "function" == typeof l2 ? l2.call(this, a2()) : this.format(l2);
8276
8342
  };
8277
8343
  };
8278
8344
  });
@@ -8281,42 +8347,42 @@ var calendarExports = calendar$1.exports;
8281
8347
  const calendar = /* @__PURE__ */ getDefaultExportFromCjs(calendarExports);
8282
8348
  var relativeTime$1 = { exports: {} };
8283
8349
  (function(module, exports$1) {
8284
- !function(r2, e) {
8350
+ !function(r, e) {
8285
8351
  module.exports = e();
8286
8352
  }(commonjsGlobal, function() {
8287
- return function(r2, e, t2) {
8288
- r2 = r2 || {};
8353
+ return function(r, e, t2) {
8354
+ r = r || {};
8289
8355
  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" };
8290
- function i2(r3, e2, t3, o3) {
8291
- return n2.fromToBase(r3, e2, t3, o3);
8356
+ function i2(r2, e2, t3, o3) {
8357
+ return n2.fromToBase(r2, e2, t3, o3);
8292
8358
  }
8293
8359
  t2.en.relativeTime = o2, n2.fromToBase = function(e2, n3, i3, d3, u) {
8294
- for (var f2, a, s, l2 = i3.$locale().relativeTime || o2, h = 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" }], m2 = h.length, c2 = 0; c2 < m2; c2 += 1) {
8360
+ for (var f2, a2, s, l2 = i3.$locale().relativeTime || o2, h = r.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" }], m2 = h.length, c2 = 0; c2 < m2; c2 += 1) {
8295
8361
  var y2 = h[c2];
8296
8362
  y2.d && (f2 = d3 ? t2(e2).diff(i3, y2.d, true) : i3.diff(e2, y2.d, true));
8297
- var p2 = (r2.rounding || Math.round)(Math.abs(f2));
8363
+ var p2 = (r.rounding || Math.round)(Math.abs(f2));
8298
8364
  if (s = f2 > 0, p2 <= y2.r || !y2.r) {
8299
8365
  p2 <= 1 && c2 > 0 && (y2 = h[c2 - 1]);
8300
8366
  var v2 = l2[y2.l];
8301
- u && (p2 = u("" + p2)), a = "string" == typeof v2 ? v2.replace("%d", p2) : v2(p2, n3, y2.l, s);
8367
+ u && (p2 = u("" + p2)), a2 = "string" == typeof v2 ? v2.replace("%d", p2) : v2(p2, n3, y2.l, s);
8302
8368
  break;
8303
8369
  }
8304
8370
  }
8305
- if (n3) return a;
8371
+ if (n3) return a2;
8306
8372
  var M2 = s ? l2.future : l2.past;
8307
- return "function" == typeof M2 ? M2(a) : M2.replace("%s", a);
8308
- }, n2.to = function(r3, e2) {
8309
- return i2(r3, e2, this, true);
8310
- }, n2.from = function(r3, e2) {
8311
- return i2(r3, e2, this);
8373
+ return "function" == typeof M2 ? M2(a2) : M2.replace("%s", a2);
8374
+ }, n2.to = function(r2, e2) {
8375
+ return i2(r2, e2, this, true);
8376
+ }, n2.from = function(r2, e2) {
8377
+ return i2(r2, e2, this);
8312
8378
  };
8313
- var d2 = function(r3) {
8314
- return r3.$u ? t2.utc() : t2();
8379
+ var d2 = function(r2) {
8380
+ return r2.$u ? t2.utc() : t2();
8315
8381
  };
8316
- n2.toNow = function(r3) {
8317
- return this.to(d2(this), r3);
8318
- }, n2.fromNow = function(r3) {
8319
- return this.from(d2(this), r3);
8382
+ n2.toNow = function(r2) {
8383
+ return this.to(d2(this), r2);
8384
+ }, n2.fromNow = function(r2) {
8385
+ return this.from(d2(this), r2);
8320
8386
  };
8321
8387
  };
8322
8388
  });
@@ -8411,7 +8477,9 @@ async function ganaka({
8411
8477
  startTime,
8412
8478
  endTime,
8413
8479
  intervalMinutes = 1,
8414
- deleteRunAfterCompletion = false
8480
+ deleteRunAfterCompletion = false,
8481
+ name,
8482
+ tags
8415
8483
  }) {
8416
8484
  const developerToken = process.env.DEVELOPER_KEY;
8417
8485
  const apiDomain = process.env.API_DOMAIN || "https://api.ganaka.live";
@@ -8430,7 +8498,9 @@ async function ganaka({
8430
8498
  const createRunBody = {
8431
8499
  start_datetime: startTime,
8432
8500
  end_datetime: endTime,
8433
- timezone: "Asia/Kolkata"
8501
+ timezone: "Asia/Kolkata",
8502
+ ...name !== void 0 && { name },
8503
+ ...tags !== void 0 && { tags }
8434
8504
  };
8435
8505
  try {
8436
8506
  const createRunResponse = await apiClient.post("/v1/dashboard/runs", createRunBody);
@@ -8473,6 +8543,13 @@ async function ganaka({
8473
8543
  currentTimestamp,
8474
8544
  currentTimezone: "Asia/Kolkata"
8475
8545
  }),
8546
+ fetchNiftyQuote: fetchNiftyQuote({
8547
+ developerToken,
8548
+ apiDomain,
8549
+ runId,
8550
+ currentTimestamp,
8551
+ currentTimezone: "Asia/Kolkata"
8552
+ }),
8476
8553
  fetchQuoteTimeline: fetchQuoteTimeline({
8477
8554
  developerToken,
8478
8555
  apiDomain,
@@ -8515,7 +8592,7 @@ async function ganaka({
8515
8592
  }
8516
8593
  export {
8517
8594
  ganaka,
8518
- g as growwQuotePayloadSchema,
8519
- r as growwQuoteSchema
8595
+ _ as growwQuotePayloadSchema,
8596
+ a as growwQuoteSchema
8520
8597
  };
8521
8598
  //# sourceMappingURL=index.mjs.map