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