wrangler 3.60.1 → 3.60.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "3.60.1",
3
+ "version": "3.60.2",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -149,10 +149,10 @@
149
149
  "xdg-app-paths": "^8.3.0",
150
150
  "yargs": "^17.7.2",
151
151
  "yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
152
- "@cloudflare/cli": "1.1.1",
152
+ "@cloudflare/pages-shared": "^0.11.42",
153
153
  "@cloudflare/eslint-config-worker": "1.1.0",
154
154
  "@cloudflare/workers-tsconfig": "0.0.0",
155
- "@cloudflare/pages-shared": "^0.11.42"
155
+ "@cloudflare/cli": "1.1.1"
156
156
  },
157
157
  "optionalDependencies": {
158
158
  "fsevents": "~2.3.2"
@@ -152685,7 +152685,7 @@ init_import_meta_url();
152685
152685
  init_import_meta_url();
152686
152686
 
152687
152687
  // package.json
152688
- var version = "3.60.1";
152688
+ var version = "3.60.2";
152689
152689
  var package_default = {
152690
152690
  name: "wrangler",
152691
152691
  version,
@@ -176807,7 +176807,6 @@ function Options7(d1ListYargs) {
176807
176807
  type: "string",
176808
176808
  demandOption: true
176809
176809
  }).option("timePeriod", {
176810
- choices: ["1d", "7d", "31d"],
176811
176810
  describe: "Fetch data from now to the provided time period",
176812
176811
  default: "1d"
176813
176812
  }).option("sort-type", {
@@ -176839,6 +176838,42 @@ var cliOptionToGraphQLOption = {
176839
176838
  writes: "rowsWritten",
176840
176839
  count: "count"
176841
176840
  };
176841
+ function getDurationDates(durationString) {
176842
+ const endDate = /* @__PURE__ */ new Date();
176843
+ const durationValue = parseInt(durationString.slice(0, -1));
176844
+ const durationUnit = durationString.slice(-1);
176845
+ let startDate;
176846
+ switch (durationUnit) {
176847
+ case "d":
176848
+ if (durationValue > 31) {
176849
+ throw new Error("Duration cannot be greater than 31 days");
176850
+ }
176851
+ startDate = new Date(
176852
+ endDate.getTime() - durationValue * 24 * 60 * 60 * 1e3
176853
+ );
176854
+ break;
176855
+ case "m":
176856
+ if (durationValue > 31 * 24 * 60) {
176857
+ throw new Error(
176858
+ `Duration cannot be greater than ${31 * 24 * 60} minutes (31 days)`
176859
+ );
176860
+ }
176861
+ startDate = new Date(endDate.getTime() - durationValue * 60 * 1e3);
176862
+ break;
176863
+ case "h":
176864
+ if (durationValue > 31 * 24) {
176865
+ throw new Error(
176866
+ `Duration cannot be greater than ${31 * 24} hours (31 days)`
176867
+ );
176868
+ }
176869
+ startDate = new Date(endDate.getTime() - durationValue * 60 * 60 * 1e3);
176870
+ break;
176871
+ default:
176872
+ throw new Error("Invalid duration unit");
176873
+ }
176874
+ return [startDate.toISOString(), endDate.toISOString()];
176875
+ }
176876
+ __name(getDurationDates, "getDurationDates");
176842
176877
  var Handler7 = withConfig(
176843
176878
  async ({
176844
176879
  name,
@@ -176859,11 +176894,7 @@ var Handler7 = withConfig(
176859
176894
  const result = await getDatabaseInfoFromId(accountId, db.uuid);
176860
176895
  const output = [];
176861
176896
  if (result.version !== "alpha") {
176862
- const convertedTimePeriod = Number(timePeriod.replace("d", ""));
176863
- const endDate = /* @__PURE__ */ new Date();
176864
- const startDate = new Date(
176865
- new Date(endDate).setDate(endDate.getDate() - convertedTimePeriod)
176866
- );
176897
+ const [startDate, endDate] = getDurationDates(timePeriod);
176867
176898
  const parsedSortBy = cliOptionToGraphQLOption[sortBy];
176868
176899
  const orderByClause = parsedSortBy === "count" ? `${parsedSortBy}_${sortDirection}` : `${sortType}_${parsedSortBy}_${sortDirection}`;
176869
176900
  const graphqlQueriesResult = await fetchGraphqlResult({
@@ -176897,8 +176928,8 @@ var Handler7 = withConfig(
176897
176928
  filter: {
176898
176929
  AND: [
176899
176930
  {
176900
- datetimeHour_geq: startDate.toISOString(),
176901
- datetimeHour_leq: endDate.toISOString(),
176931
+ datetimeHour_geq: startDate,
176932
+ datetimeHour_leq: endDate,
176902
176933
  databaseId: db.uuid
176903
176934
  }
176904
176935
  ]
@@ -209362,4 +209393,3 @@ yargs-parser/build/lib/index.js:
209362
209393
  * SPDX-License-Identifier: ISC
209363
209394
  *)
209364
209395
  */
209365
- //# sourceMappingURL=cli.js.map