@ezpaarse-project/ezreeport-sdk-js 1.1.0-beta.1 → 1.1.0-rc.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.
@@ -40,7 +40,7 @@ export interface PaginatedApiResponse<T, K extends keyof T> extends ApiResponse<
40
40
  *
41
41
  * @returns Response
42
42
  */
43
- export declare const axiosWithErrorFormatter: <T, Method extends "delete" | "get" | "post" | "put" | "patch">(method: Method, ...params: Parameters<Axios[Method]>) => Promise<AxiosResponse<T, any>>;
43
+ export declare const axiosWithErrorFormatter: <T, Method extends "delete" | "get" | "post" | "put" | "patch">(method: Method, ...params: Parameters<Axios[Method]>) => Promise<AxiosResponse<T>>;
44
44
  declare const _default: import("axios").AxiosInstance & {
45
45
  $get: <T>(url: string, config?: import("axios").AxiosRequestConfig<unknown> | undefined) => Promise<ApiResponse<T>>;
46
46
  $post: <T_1>(url: string, data?: unknown, config?: import("axios").AxiosRequestConfig<unknown> | undefined) => Promise<ApiResponse<T_1>>;
@@ -17,5 +17,5 @@ export type EventfulPromise<T, E extends Record<string, any[]>> = Promise<T> & E
17
17
  *
18
18
  * @returns The EventfulPromise
19
19
  */
20
- declare const createEventfulPromise: <T, E extends Record<string, any[]> = Record<string, any[]>>(executor: (emitter: EventfulEmitter<E>) => Promise<T>, emitter?: EventEmitter) => EventfulPromise<T, E>;
20
+ declare const createEventfulPromise: <T, E extends Record<string, any[]> = Record<string, any[]>>(executor: (emitter: EventfulEmitter<E>) => Promise<T>, emitter?: EventEmitter<[never]>) => EventfulPromise<T, E>;
21
21
  export default createEventfulPromise;
@@ -92,7 +92,7 @@ export declare const resumeQueue: (queueOrName: Queue | Queue['name']) => Promis
92
92
  *
93
93
  * @returns queue info
94
94
  */
95
- export declare const getQueueJobs: <Data, Result>(queueOrName: Queue | Queue['name'], paginationOpts?: PaginationOpts) => Promise<PaginatedApiResponse<FullJob<Data, Result>, "id">>;
95
+ export declare const getQueueJobs: <Data, Result>(queueOrName: Queue | Queue['name'], paginationOpts?: PaginationOpts) => Promise<PaginatedApiResponse<FullJob<Data, Result>, 'id'>>;
96
96
  /**
97
97
  * Get job info
98
98
  *
@@ -104,7 +104,7 @@ export declare const getQueueJobs: <Data, Result>(queueOrName: Queue | Queue['na
104
104
  *
105
105
  * @returns Job full info
106
106
  */
107
- export declare const getJob: <Data, Result>(queueOrName: Queue | Queue['name'], jobOrId: string | number | Job<Data>, namespaces?: string[]) => Promise<ApiResponse<FullJob<Data, Result>>>;
107
+ export declare const getJob: <Data, Result>(queueOrName: Queue | Queue['name'], jobOrId: Job<Data> | Job<Data>['id'], namespaces?: string[]) => Promise<ApiResponse<FullJob<Data, Result>>>;
108
108
  /**
109
109
  * Retry job that failed
110
110
  *
@@ -116,5 +116,5 @@ export declare const getJob: <Data, Result>(queueOrName: Queue | Queue['name'],
116
116
  *
117
117
  * @returns queue info
118
118
  */
119
- export declare const retryJob: <Data, Result>(queueOrName: Queue | Queue['name'], jobOrId: string | number | Job<Data>, namespaces?: string[]) => Promise<ApiResponse<FullJob<Data, Result>>>;
119
+ export declare const retryJob: <Data, Result>(queueOrName: Queue | Queue['name'], jobOrId: Job<Data> | Job<Data>['id'], namespaces?: string[]) => Promise<ApiResponse<FullJob<Data, Result>>>;
120
120
  export {};
@@ -132,7 +132,7 @@ interface ResponseTypeMap {
132
132
  *
133
133
  * @returns The report's content
134
134
  */
135
- export declare const getReportFileByName: <Result extends keyof ResponseTypeMap = "text">(name: string, namespaces?: string[], responseType?: Result | undefined, ext?: string) => Promise<ResponseTypeMap[Result]>;
135
+ export declare const getReportFileByName: <Result extends keyof ResponseTypeMap = "text">(name: string, namespaces?: string[], responseType?: Result, ext?: string) => Promise<ResponseTypeMap[Result]>;
136
136
  /**
137
137
  * Get report main file (the result) by giving job's info
138
138
  *
@@ -146,7 +146,7 @@ export declare const getReportFileByName: <Result extends keyof ResponseTypeMap
146
146
  *
147
147
  * @returns The report's content
148
148
  */
149
- export declare const getReportFileByJob: <Result extends keyof ResponseTypeMap = "text">(queueName: Queue | Queue['name'], jobId: Job<RawReportData> | Job<RawReportData>['id'], namespaces?: string[], responseType?: Result | undefined) => Promise<ResponseTypeMap[Result]>;
149
+ export declare const getReportFileByJob: <Result extends keyof ResponseTypeMap = "text">(queueName: Queue | Queue['name'], jobId: Job<RawReportData> | Job<RawReportData>['id'], namespaces?: string[], responseType?: Result) => Promise<ResponseTypeMap[Result]>;
150
150
  /**
151
151
  * Get report detail by giving the report's name
152
152
  *
@@ -186,7 +186,7 @@ export declare const getReportDetailByJob: (queueName: Queue | Queue['name'], jo
186
186
  *
187
187
  * @returns The debug's content
188
188
  */
189
- export declare const getReportDebugByName: <Result extends keyof ResponseTypeMap = "json">(name: string, namespaces?: string[], responseType?: Result | undefined) => Promise<ResponseTypeMap[Result]>;
189
+ export declare const getReportDebugByName: <Result extends keyof ResponseTypeMap = "json">(name: string, namespaces?: string[], responseType?: Result) => Promise<ResponseTypeMap[Result]>;
190
190
  /**
191
191
  * Get report debug file by giving job's info
192
192
  *
@@ -200,5 +200,5 @@ export declare const getReportDebugByName: <Result extends keyof ResponseTypeMap
200
200
  *
201
201
  * @returns The debug's content
202
202
  */
203
- export declare const getReportDebugByJob: <Result extends keyof ResponseTypeMap = "json">(queueName: Queue | Queue['name'], jobId: Job<RawReportData> | Job<RawReportData>['id'], namespaces?: string[], responseType?: Result | undefined) => Promise<ResponseTypeMap[Result]>;
203
+ export declare const getReportDebugByJob: <Result extends keyof ResponseTypeMap = "json">(queueName: Queue | Queue['name'], jobId: Job<RawReportData> | Job<RawReportData>['id'], namespaces?: string[], responseType?: Result) => Promise<ResponseTypeMap[Result]>;
204
204
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezpaarse-project/ezreeport-sdk-js",
3
- "version": "1.1.0-beta.1",
3
+ "version": "1.1.0-rc.1",
4
4
  "description": "JS SDK to communicate with ezReeport API",
5
5
  "homepage": "https://github.com/ezpaarse-project/ezreeport#readme",
6
6
  "bugs": {
@@ -26,18 +26,6 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "scripts": {
30
- "prebuild": "rimraf --glob 'dist/*'",
31
- "build": "run-s build:web build:node build:types build:docs",
32
- "build:web": "tsc --project tsconfig.json && BUILD_TARGET=browser vite build",
33
- "build:node": "tsc --project tsconfig.node.json && BUILD_TARGET=node vite build",
34
- "build:types": "tsc --project tsconfig.types.json",
35
- "build:docs": "typedoc src/index.ts",
36
- "docs": "vite docs --open",
37
- "dev": "run-p \"build:docs -- --watch\" docs",
38
- "lint": "eslint --fix .",
39
- "test": "npm run build && npm -w ezreeport-tests run test:sdk"
40
- },
41
29
  "lint-staged": {
42
30
  "*.ts": [
43
31
  "eslint --fix"
@@ -57,5 +45,17 @@
57
45
  },
58
46
  "engines": {
59
47
  "node": "^16 || ^18"
48
+ },
49
+ "scripts": {
50
+ "prebuild": "rimraf --glob 'dist/*'",
51
+ "build": "run-s build:web build:node build:types build:docs",
52
+ "build:web": "tsc --project tsconfig.json && BUILD_TARGET=browser vite build",
53
+ "build:node": "tsc --project tsconfig.node.json && BUILD_TARGET=node vite build",
54
+ "build:types": "tsc --project tsconfig.types.json",
55
+ "build:docs": "typedoc src/index.ts",
56
+ "docs": "vite docs --open",
57
+ "dev": "run-p \"build:docs -- --watch\" docs",
58
+ "lint": "eslint --fix .",
59
+ "test": "npm run build && npm -w ezreeport-tests run test:sdk"
60
60
  }
61
- }
61
+ }