ts-sidekiq 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -32,7 +32,7 @@ export {
32
32
  SidekiqDashboard,
33
33
  SidekiqRetry,
34
34
  SidekiqQueue,
35
- } from "ts-sidekiq/build/index.js";
35
+ } from "ts-sidekiq/build/client.js";
36
36
  ```
37
37
 
38
38
  #### Server Library
package/build/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./types";
1
+ export * from "../types/sidekiq";
2
2
  export { default as SidekiqDashboard } from "./sidekiq-dashboard";
3
3
  export { default as SidekiqRetry } from "./sidekiq-retry";
4
4
  export { default as SidekiqQueue } from "./sidekiq-queue";
package/build/client.js CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./types";
1
+ export * from "../types/sidekiq";
2
2
  export { default as SidekiqDashboard } from "./sidekiq-dashboard";
3
3
  export { default as SidekiqRetry } from "./sidekiq-retry";
4
4
  export { default as SidekiqQueue } from "./sidekiq-queue";
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { SidekiqCronJob } from "../types";
2
+ import { SidekiqCronJob } from "../../types/sidekiq";
3
3
  interface Props {
4
4
  cronJobs: SidekiqCronJob[];
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { SidekiqProcess } from "../types";
2
+ import type { SidekiqProcess } from "../../types/sidekiq";
3
3
  interface Props {
4
4
  processes: SidekiqProcess[];
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"processes-table.js","sourceRoot":"","sources":["../../src/components/processes-table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAanE,MAAM,cAAc,GAAoB,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;IACxD,uBAAuB;IACvB,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;QAC7D,MAAM,MAAM,GAA6B,IAAI,CAAC,KAAK,CACjD,OAAO,CAAC,WAAW,CAAC,IAAI,CACzB,CAAC;QACF,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAC5B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;oBAChB,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;gBACnD,CAAC;gBACD,GAAG,CAAC,KAAK,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC;gBAC7B,GAAG,CAAC,KAAK,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAC;YAC/C,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,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oBAChB,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;gBACnD,CAAC;gBACD,GAAG,CAAC,KAAK,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC;gBAC7B,GAAG,CAAC,KAAK,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAC;YAC/C,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,+BAAO,KAAK,EAAE,UAAU;QACtB;YACE;gBACE,4BAAI,KAAK,EAAE,eAAe,YAAY;gBACtC,4BAAI,KAAK,EAAE,eAAe,oBAAoB;gBAC9C,4BAAI,KAAK,EAAE,eAAe,mBAAmB,CAC1C,CACC;QACR,mCACG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,CAC5B,CAAC,CAAC,KAAK,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CACjD,4BAAI,GAAG,EAAE,KAAK;YACZ,4BAAI,KAAK,EAAE,SAAS,IAAG,KAAK,CAAM;YAClC,4BAAI,KAAK,EAAE,SAAS,IAAG,YAAY,CAAM;YACzC,4BAAI,KAAK,EAAE,SAAS,IAAG,WAAW,CAAM,CACrC,CACN,CACF,CACK,CACF,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { SidekiqJob } from "../types";
2
+ import { SidekiqJob } from "../../types/sidekiq";
3
3
  interface Props {
4
4
  jobs: SidekiqJob[];
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { SidekiqQueue } from "../types";
2
+ import type { SidekiqQueue } from "../../types/sidekiq";
3
3
  interface Props {
4
4
  queues: SidekiqQueue[];
5
5
  onKeyClick?: (key: string) => void;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { SidekiqRetryJob } from "../types";
2
+ import { SidekiqRetryJob } from "../../types/sidekiq";
3
3
  interface Props {
4
4
  retryJobs: SidekiqRetryJob[];
5
5
  onSelectedJobs: (selectedJIDs: string[]) => void;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { SidekiqStat } from "../types";
2
+ import { SidekiqStat } from "../../types/sidekiq";
3
3
  interface Props {
4
4
  stats: SidekiqStat[];
5
5
  onKeyClick?: (key: string) => void;
@@ -1,4 +1,4 @@
1
- import { SidekiqJob, SidekiqRetryJob } from "./types";
1
+ import { SidekiqJob, SidekiqRetryJob } from "../types/sidekiq";
2
2
  declare const getSidekiqData: (redisUrl?: string) => Promise<{
3
3
  keys: string[];
4
4
  queues: {
package/build/server.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export * from "../types/sidekiq";
1
2
  export * from "./redis-client";
package/build/server.js CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "../types/sidekiq";
1
2
  export * from "./redis-client";
2
3
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { SidekiqDashboardData } from "./types";
2
+ import { SidekiqDashboardData } from "../types/sidekiq";
3
3
  interface Props {
4
4
  data: SidekiqDashboardData;
5
5
  onKeyClick?: (key: string) => void;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { SidekiqJob } from "./types";
2
+ import { SidekiqJob } from "../types/sidekiq";
3
3
  interface Props {
4
4
  jobs: SidekiqJob[];
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { SidekiqRetryJob } from "./types";
2
+ import { SidekiqRetryJob } from "../types/sidekiq";
3
3
  interface Props {
4
4
  retryJobs: SidekiqRetryJob[];
5
5
  onSelectedJobs: (selectedJIDs: string[]) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-sidekiq",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "manage sidekiq",
5
5
  "main": "build/server.js",
6
6
  "browser": "build/client.js",
@@ -0,0 +1,91 @@
1
+ export type SidekiqQueue = {
2
+ queue: string;
3
+ size: number;
4
+ };
5
+
6
+ export type SidekiqStat = {
7
+ stat: string;
8
+ value: string;
9
+ };
10
+
11
+ export type SidekiqProcessInfoDetail = {
12
+ hostname: string;
13
+ started_at: number;
14
+ pid: number;
15
+ tag: string;
16
+ concurrency: number;
17
+ queues: string[];
18
+ weights: { [key: string]: number }[];
19
+ labels: string[];
20
+ identity: string;
21
+ version: string;
22
+ embedded: boolean;
23
+ };
24
+
25
+ export type SidekiqProcessInfo = {
26
+ rss: string;
27
+ quiet: string;
28
+ info: string;
29
+ busy: string;
30
+ beat: string;
31
+ rtt_us: string;
32
+ };
33
+
34
+ export type SidekiqProcess = {
35
+ processKey: string;
36
+ processInfo: SidekiqProcessInfo;
37
+ };
38
+
39
+ export type SidekiqJob = {
40
+ class: string;
41
+ args: any[];
42
+ retry: boolean;
43
+ queue: string;
44
+ jid: string;
45
+ created_at: number; // Unixタイムスタンプ
46
+ enqueued_at: number; // Unixタイムスタンプ
47
+ };
48
+
49
+ export type SidekiqRetryJob = {
50
+ retry: boolean;
51
+ queue: string;
52
+ args: any[]; // Replace 'any' with a more specific type if you know the structure of your arguments
53
+ class: string;
54
+ jid: string;
55
+ created_at: number;
56
+ enqueued_at: number;
57
+ error_message: string;
58
+ error_class: string;
59
+ failed_at: number;
60
+ retry_count: number;
61
+ };
62
+
63
+ export type SidekiqCronJobDetail = {
64
+ cron: string;
65
+ active_job: string;
66
+ symbolize_args: string;
67
+ last_enqueue_time: string;
68
+ queue_name_delimiter: string;
69
+ name: string;
70
+ args: string;
71
+ description: string;
72
+ status: string;
73
+ klass: string;
74
+ source: string;
75
+ queue_name_prefix: string;
76
+ message: string;
77
+ };
78
+
79
+ export type SidekiqCronJob = {
80
+ key: string;
81
+ type: "hash" | "list" | "zset"; // Include other types if they exist
82
+ details?: SidekiqCronJobDetail; // For hash type
83
+ value?: string[]; // For list or zset type
84
+ };
85
+
86
+ export type SidekiqDashboardData = {
87
+ queues: SidekiqQueue[];
88
+ stats: SidekiqStat[];
89
+ processes: SidekiqProcess[];
90
+ cronJobs: SidekiqCronJob[];
91
+ };