@ganaka/sdk 1.1.0 → 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
@@ -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(),
@@ -4156,7 +4156,7 @@ const g = object({
4156
4156
  week_52_low: number$1().nullable()
4157
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(),
@@ -4320,7 +4320,7 @@ const p = object({
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
@@ -4342,7 +4342,7 @@ const p = object({
4342
4342
  )
4343
4343
  })
4344
4344
  })
4345
- }, q = {
4345
+ }, P = {
4346
4346
  query: object({
4347
4347
  datetime: n.optional(),
4348
4348
  timezone: o.optional()
@@ -4350,31 +4350,31 @@ const p = object({
4350
4350
  response: t.extend({
4351
4351
  data: a.nullable()
4352
4352
  })
4353
- }, ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4353
+ }, ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4354
4354
  __proto__: null,
4355
4355
  getGrowwHistoricalCandles: f,
4356
- getGrowwNiftyQuote: q,
4356
+ getGrowwNiftyQuote: P,
4357
4357
  getGrowwQuote: v,
4358
- getGrowwQuoteTimeline: P,
4358
+ getGrowwQuoteTimeline: x,
4359
4359
  getGrowwToken: T,
4360
4360
  growwHistoricalCandlesSchema: p
4361
- }, Symbol.toStringTag, { value: "Module" })), _ = object({
4361
+ }, Symbol.toStringTag, { value: "Module" })), g = object({
4362
4362
  name: string(),
4363
4363
  price: number$1(),
4364
4364
  nseSymbol: string()
4365
- }), x = {
4365
+ }), q = {
4366
4366
  query: object({
4367
4367
  type: _enum(["top-gainers", "volume-shockers"]),
4368
4368
  datetime: n.optional(),
4369
4369
  timezone: o.optional()
4370
4370
  }),
4371
4371
  response: t.extend({
4372
- data: array(_).nullable()
4372
+ data: array(g).nullable()
4373
4373
  })
4374
- }, ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4374
+ }, je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4375
4375
  __proto__: null,
4376
- getLists: x,
4377
- listSchema: _
4376
+ getLists: q,
4377
+ listSchema: g
4378
4378
  }, Symbol.toStringTag, { value: "Module" })), O = {
4379
4379
  query: object({}),
4380
4380
  response: t.extend({
@@ -4440,7 +4440,7 @@ const p = object({
4440
4440
  }, M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4441
4441
  __proto__: null,
4442
4442
  getDailyPersistentCompanies: C
4443
- }, Symbol.toStringTag, { value: "Module" })), A = {
4443
+ }, Symbol.toStringTag, { value: "Module" })), R = {
4444
4444
  query: object({
4445
4445
  date: i,
4446
4446
  type: _enum(t$1)
@@ -4452,9 +4452,9 @@ const p = object({
4452
4452
  uniqueCount: number$1()
4453
4453
  })
4454
4454
  })
4455
- }, R = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4455
+ }, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4456
4456
  __proto__: null,
4457
- getDailyUniqueCompanies: A
4457
+ getDailyUniqueCompanies: R
4458
4458
  }, Symbol.toStringTag, { value: "Module" })), k = object({
4459
4459
  id: uuid(),
4460
4460
  username: string()
@@ -4498,7 +4498,9 @@ const p = object({
4498
4498
  start_datetime: string(),
4499
4499
  end_datetime: string(),
4500
4500
  completed: boolean(),
4501
- orderCount: number$1()
4501
+ orderCount: number$1(),
4502
+ name: string().nullable().optional(),
4503
+ tags: array(string()).optional()
4502
4504
  }), U = record(
4503
4505
  string(),
4504
4506
  // date string (YYYY-MM-DD)
@@ -4539,24 +4541,32 @@ const p = object({
4539
4541
  }, $ = object({
4540
4542
  start_datetime: n,
4541
4543
  end_datetime: n,
4542
- timezone: o.optional()
4544
+ timezone: o.optional(),
4545
+ name: string().optional(),
4546
+ tags: array(string().min(1).max(50)).optional()
4543
4547
  }), F = object({
4544
4548
  id: uuid(),
4545
4549
  start_datetime: n,
4546
4550
  end_datetime: n,
4547
- completed: boolean()
4551
+ completed: boolean(),
4552
+ name: string().nullable().optional(),
4553
+ tags: array(string()).optional()
4548
4554
  }), B = {
4549
4555
  body: $,
4550
4556
  response: t.extend({
4551
4557
  data: F
4552
4558
  })
4553
4559
  }, K = object({
4554
- completed: boolean().optional()
4560
+ completed: boolean().optional(),
4561
+ name: string().nullable().optional(),
4562
+ tags: array(string().min(1).max(50)).optional()
4555
4563
  }), Z = object({
4556
4564
  id: uuid(),
4557
4565
  start_datetime: string(),
4558
4566
  end_datetime: string(),
4559
- completed: boolean()
4567
+ completed: boolean(),
4568
+ name: string().nullable().optional(),
4569
+ tags: array(string()).optional()
4560
4570
  }), V = {
4561
4571
  params: object({
4562
4572
  runId: uuid()
@@ -4597,15 +4607,20 @@ const p = object({
4597
4607
  response: t.extend({
4598
4608
  data: X
4599
4609
  })
4600
- }, te = /* @__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({
4601
4615
  __proto__: null,
4602
4616
  createOrder: ee,
4603
4617
  createRun: B,
4604
4618
  deleteRun: J,
4605
4619
  getRunOrders: H,
4620
+ getRunTags: te,
4606
4621
  getRuns: Q,
4607
4622
  updateRun: V
4608
- }, Symbol.toStringTag, { value: "Module" })), ne = {
4623
+ }, Symbol.toStringTag, { value: "Module" })), oe = {
4609
4624
  query: object({
4610
4625
  datetime: n,
4611
4626
  timezone: o.optional(),
@@ -4622,19 +4637,19 @@ const p = object({
4622
4637
  }).nullable()
4623
4638
  })
4624
4639
  })
4625
- }, oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4640
+ }, ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4626
4641
  __proto__: null,
4627
- getShortlists: ne
4628
- }, Symbol.toStringTag, { value: "Module" })), je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4642
+ getShortlists: oe
4643
+ }, Symbol.toStringTag, { value: "Module" })), he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4629
4644
  __proto__: null,
4630
4645
  v1_dashboard_auth_schemas: I,
4631
4646
  v1_dashboard_available_datetimes_schemas: w,
4632
4647
  v1_dashboard_candles_schemas: D,
4633
4648
  v1_dashboard_daily_persistent_companies_schemas: M,
4634
- v1_dashboard_daily_unique_companies_schemas: R,
4649
+ v1_dashboard_daily_unique_companies_schemas: A,
4635
4650
  v1_dashboard_quote_timeline_schemas: N,
4636
- v1_dashboard_runs_schemas: te,
4637
- v1_dashboard_shortlists_schemas: oe
4651
+ v1_dashboard_runs_schemas: ne,
4652
+ v1_dashboard_shortlists_schemas: ae
4638
4653
  }, Symbol.toStringTag, { value: "Module" }));
4639
4654
  ({
4640
4655
  response: t.extend({
@@ -7923,7 +7938,7 @@ const fetchCandles = ({
7923
7938
  );
7924
7939
  }
7925
7940
  try {
7926
- const validatedParams = ge.getGrowwHistoricalCandles.query.parse(params);
7941
+ const validatedParams = ye.getGrowwHistoricalCandles.query.parse(params);
7927
7942
  const headers = {
7928
7943
  Authorization: `Bearer ${developerToken}`
7929
7944
  };
@@ -7967,7 +7982,7 @@ const fetchQuote = ({
7967
7982
  );
7968
7983
  }
7969
7984
  try {
7970
- const validatedParams = ge.getGrowwQuote.query.parse(params);
7985
+ const validatedParams = ye.getGrowwQuote.query.parse(params);
7971
7986
  const headers = {
7972
7987
  Authorization: `Bearer ${developerToken}`
7973
7988
  };
@@ -8007,7 +8022,7 @@ const fetchQuoteTimeline = ({
8007
8022
  throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
8008
8023
  }
8009
8024
  try {
8010
- const validatedParams = ge.getGrowwQuoteTimeline.query.parse({
8025
+ const validatedParams = ye.getGrowwQuoteTimeline.query.parse({
8011
8026
  symbol,
8012
8027
  date: date2
8013
8028
  });
@@ -8054,7 +8069,7 @@ const fetchShortlist = ({
8054
8069
  );
8055
8070
  }
8056
8071
  try {
8057
- const validatedParams = ye.getLists.query.parse(queryParams);
8072
+ const validatedParams = je.getLists.query.parse(queryParams);
8058
8073
  const headers = {
8059
8074
  Authorization: `Bearer ${developerToken}`
8060
8075
  };
@@ -8096,7 +8111,7 @@ const fetchNiftyQuote = ({
8096
8111
  throw new Error("Developer token not found. Please set DEVELOPER_KEY environment variable.");
8097
8112
  }
8098
8113
  try {
8099
- const validatedParams = ge.getGrowwNiftyQuote.query.parse(params);
8114
+ const validatedParams = ye.getGrowwNiftyQuote.query.parse(params);
8100
8115
  const headers = {
8101
8116
  Authorization: `Bearer ${developerToken}`
8102
8117
  };
@@ -8203,7 +8218,7 @@ const placeOrder = ({ runId, apiClient }) => async (data) => {
8203
8218
  try {
8204
8219
  await retryWithBackoff(
8205
8220
  async () => {
8206
- const validatedData = je.v1_dashboard_runs_schemas.createOrder.body.parse(data);
8221
+ const validatedData = he.v1_dashboard_runs_schemas.createOrder.body.parse(data);
8207
8222
  await apiClient.post(`/v1/dashboard/runs/${runId}/orders`, validatedData);
8208
8223
  logger.debug(`Order persisted for ${data.nseSymbol} in runId: ${runId}`);
8209
8224
  },
@@ -8462,7 +8477,9 @@ async function ganaka({
8462
8477
  startTime,
8463
8478
  endTime,
8464
8479
  intervalMinutes = 1,
8465
- deleteRunAfterCompletion = false
8480
+ deleteRunAfterCompletion = false,
8481
+ name,
8482
+ tags
8466
8483
  }) {
8467
8484
  const developerToken = process.env.DEVELOPER_KEY;
8468
8485
  const apiDomain = process.env.API_DOMAIN || "https://api.ganaka.live";
@@ -8481,7 +8498,9 @@ async function ganaka({
8481
8498
  const createRunBody = {
8482
8499
  start_datetime: startTime,
8483
8500
  end_datetime: endTime,
8484
- timezone: "Asia/Kolkata"
8501
+ timezone: "Asia/Kolkata",
8502
+ ...name !== void 0 && { name },
8503
+ ...tags !== void 0 && { tags }
8485
8504
  };
8486
8505
  try {
8487
8506
  const createRunResponse = await apiClient.post("/v1/dashboard/runs", createRunBody);
@@ -8573,7 +8592,7 @@ async function ganaka({
8573
8592
  }
8574
8593
  export {
8575
8594
  ganaka,
8576
- g as growwQuotePayloadSchema,
8595
+ _ as growwQuotePayloadSchema,
8577
8596
  a as growwQuoteSchema
8578
8597
  };
8579
8598
  //# sourceMappingURL=index.mjs.map