@zdn3517/act-api 0.1.5 → 0.1.6

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.
Files changed (36) hide show
  1. package/build/index.d.ts +15 -2
  2. package/build/types/actPreviewResponse.d.ts +1 -0
  3. package/build/types/actStatus.d.ts +9 -0
  4. package/build/types/components-schemas-act/act.d.ts +3 -3
  5. package/build/types/components-schemas-act/actItem.d.ts +1 -2
  6. package/build/types/components-schemas-act/actListItem.d.ts +3 -3
  7. package/build/types/components-schemas-act/actPreviewResponse.d.ts +10 -0
  8. package/build/types/components-schemas-act/actStatus.d.ts +12 -0
  9. package/build/types/components-schemas-act/createActItem.d.ts +1 -2
  10. package/build/types/components-schemas-act/createActItemRequest.d.ts +16 -0
  11. package/build/types/components-schemas-act/createActRequest.d.ts +1 -3
  12. package/build/types/components-schemas-act/index.d.ts +5 -0
  13. package/build/types/components-schemas-act/updateActItemRequest.d.ts +16 -0
  14. package/build/types/components-schemas-act/updateActMetadataRequest.d.ts +11 -0
  15. package/build/types/components-schemas-act/updateActRequest.d.ts +0 -2
  16. package/build/types/components-schemas-estimates/estimate.d.ts +0 -2
  17. package/build/types/components-schemas-suggestions/index.d.ts +9 -0
  18. package/build/types/components-schemas-suggestions/workTypeSuggestion.d.ts +12 -0
  19. package/build/types/components-schemas-suggestions/workTypeSuggestionsResponse.d.ts +11 -0
  20. package/build/types/createActItemRequest.d.ts +1 -0
  21. package/build/types/getWorkTypeSuggestionsParams.d.ts +16 -0
  22. package/build/types/index.d.ts +8 -0
  23. package/build/types/paths-act_item/index.d.ts +8 -0
  24. package/build/types/paths-act_item/schema.d.ts +9 -0
  25. package/build/types/paths-act_items/index.d.ts +8 -0
  26. package/build/types/paths-act_items/schema.d.ts +9 -0
  27. package/build/types/paths-act_preview/index.d.ts +8 -0
  28. package/build/types/paths-act_preview/schema.d.ts +9 -0
  29. package/build/types/paths-work_type_suggestions/index.d.ts +8 -0
  30. package/build/types/paths-work_type_suggestions/schema.d.ts +9 -0
  31. package/build/types/updateActItemRequest.d.ts +1 -0
  32. package/build/types/updateActMetadataRequest.d.ts +1 -0
  33. package/build/types/workTypeSuggestion.d.ts +1 -0
  34. package/build/types/workTypeSuggestionsResponse.d.ts +1 -0
  35. package/build/zod/types.gen.d.ts +33 -15
  36. package/package.json +1 -1
package/build/index.d.ts CHANGED
@@ -10,11 +10,12 @@ import type { AxiosRequestConfig, AxiosResponse } from 'axios';
10
10
  import type { HealthResponse, PingResponse } from './types/components-schemas-health';
11
11
  import type { AuthRequest, AuthResponse } from './types/components-schemas-auth';
12
12
  import type { GetUnitsResponse } from './types/components-schemas-unit';
13
- import type { Act, CreateActRequest, GetActsResponse, UpdateActRequest } from './types/components-schemas-act';
14
- import type { GetActsParams, GetEstimatesParams } from './types';
13
+ import type { Act, ActItem, ActPreviewResponse, CreateActItemRequest, CreateActRequest, GetActsResponse, UpdateActItemRequest, UpdateActMetadataRequest, UpdateActRequest } from './types/components-schemas-act';
14
+ import type { GetActsParams, GetEstimatesParams, GetWorkTypeSuggestionsParams } from './types';
15
15
  import type { GetObjectsResponse } from './types/components-schemas-objects';
16
16
  import type { GetContractsResponse } from './types/components-schemas-contracts';
17
17
  import type { Estimate, GetEstimatesResponse } from './types/components-schemas-estimates';
18
+ import type { WorkTypeSuggestionsResponse } from './types/components-schemas-suggestions';
18
19
  export declare const getActAPI: () => {
19
20
  getHealth: <TData = axios.AxiosResponse<HealthResponse, any, {}>>(options?: AxiosRequestConfig) => Promise<TData>;
20
21
  getPing: <TData = axios.AxiosResponse<PingResponse, any, {}>>(options?: AxiosRequestConfig) => Promise<TData>;
@@ -24,11 +25,17 @@ export declare const getActAPI: () => {
24
25
  createAct: <TData = axios.AxiosResponse<Act, any, {}>>(createActRequest: CreateActRequest, options?: AxiosRequestConfig) => Promise<TData>;
25
26
  getActById: <TData = axios.AxiosResponse<Act, any, {}>>(actId: string, options?: AxiosRequestConfig) => Promise<TData>;
26
27
  updateAct: <TData = axios.AxiosResponse<Act, any, {}>>(actId: string, updateActRequest: UpdateActRequest, options?: AxiosRequestConfig) => Promise<TData>;
28
+ updateActMetadata: <TData = axios.AxiosResponse<Act, any, {}>>(actId: string, updateActMetadataRequest: UpdateActMetadataRequest, options?: AxiosRequestConfig) => Promise<TData>;
27
29
  deleteAct: <TData = axios.AxiosResponse<void, any, {}>>(actId: string, options?: AxiosRequestConfig) => Promise<TData>;
30
+ createActItem: <TData = axios.AxiosResponse<ActItem, any, {}>>(actId: string, createActItemRequest: CreateActItemRequest, options?: AxiosRequestConfig) => Promise<TData>;
31
+ updateActItem: <TData = axios.AxiosResponse<ActItem, any, {}>>(actId: string, itemId: string, updateActItemRequest: UpdateActItemRequest, options?: AxiosRequestConfig) => Promise<TData>;
32
+ deleteActItem: <TData = axios.AxiosResponse<void, any, {}>>(actId: string, itemId: string, options?: AxiosRequestConfig) => Promise<TData>;
33
+ previewAct: <TData = axios.AxiosResponse<ActPreviewResponse, any, {}>>(actId: string, options?: AxiosRequestConfig) => Promise<TData>;
28
34
  getObjects: <TData = axios.AxiosResponse<GetObjectsResponse, any, {}>>(options?: AxiosRequestConfig) => Promise<TData>;
29
35
  getContracts: <TData = axios.AxiosResponse<GetContractsResponse, any, {}>>(objectId: string, options?: AxiosRequestConfig) => Promise<TData>;
30
36
  getEstimates: <TData = axios.AxiosResponse<GetEstimatesResponse, any, {}>>(params: GetEstimatesParams, options?: AxiosRequestConfig) => Promise<TData>;
31
37
  getEstimateById: <TData = axios.AxiosResponse<Estimate, any, {}>>(estimateId: string, options?: AxiosRequestConfig) => Promise<TData>;
38
+ getWorkTypeSuggestions: <TData = axios.AxiosResponse<WorkTypeSuggestionsResponse, any, {}>>(params: GetWorkTypeSuggestionsParams, options?: AxiosRequestConfig) => Promise<TData>;
32
39
  };
33
40
  export type GetHealthResult = AxiosResponse<HealthResponse>;
34
41
  export type GetPingResult = AxiosResponse<PingResponse>;
@@ -38,8 +45,14 @@ export type GetActsResult = AxiosResponse<GetActsResponse>;
38
45
  export type CreateActResult = AxiosResponse<Act>;
39
46
  export type GetActByIdResult = AxiosResponse<Act>;
40
47
  export type UpdateActResult = AxiosResponse<Act>;
48
+ export type UpdateActMetadataResult = AxiosResponse<Act>;
41
49
  export type DeleteActResult = AxiosResponse<void>;
50
+ export type CreateActItemResult = AxiosResponse<ActItem>;
51
+ export type UpdateActItemResult = AxiosResponse<ActItem>;
52
+ export type DeleteActItemResult = AxiosResponse<void>;
53
+ export type PreviewActResult = AxiosResponse<ActPreviewResponse>;
42
54
  export type GetObjectsResult = AxiosResponse<GetObjectsResponse>;
43
55
  export type GetContractsResult = AxiosResponse<GetContractsResponse>;
44
56
  export type GetEstimatesResult = AxiosResponse<GetEstimatesResponse>;
45
57
  export type GetEstimateByIdResult = AxiosResponse<Estimate>;
58
+ export type GetWorkTypeSuggestionsResult = AxiosResponse<WorkTypeSuggestionsResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { ActStatus as ComponentsSchemasActActStatus } from './components-schemas-act/actStatus';
9
+ export type ActStatus = ComponentsSchemasActActStatus;
@@ -5,15 +5,15 @@
5
5
  * API specification for the Act service.
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
+ import type { ActStatus } from './actStatus';
8
9
  import type { ActItem } from './actItem';
9
10
  export interface Act {
10
11
  uuid: string;
11
12
  contract_id: string;
12
- object_id?: string;
13
13
  estimate_id: string;
14
- title: string;
15
- description?: string;
16
14
  period_start: string;
17
15
  period_end: string;
16
+ status: ActStatus;
17
+ submitted_at?: string;
18
18
  items: ActItem[];
19
19
  }
@@ -8,8 +8,7 @@
8
8
  export interface ActItem {
9
9
  uuid: string;
10
10
  act_id: string;
11
- /** @minLength 3 */
12
- room_title?: string;
11
+ section_title?: string;
13
12
  work_type: string;
14
13
  quantity: number;
15
14
  unit: string;
@@ -5,13 +5,13 @@
5
5
  * API specification for the Act service.
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
+ import type { ActStatus } from './actStatus';
8
9
  export interface ActListItem {
9
10
  uuid: string;
10
11
  contract_id: string;
11
- object_id?: string;
12
12
  estimate_id: string;
13
- title: string;
14
- description?: string;
15
13
  period_start: string;
16
14
  period_end: string;
15
+ status: ActStatus;
16
+ submitted_at?: string;
17
17
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface ActPreviewResponse {
9
+ url: string;
10
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export type ActStatus = typeof ActStatus[keyof typeof ActStatus];
9
+ export declare const ActStatus: {
10
+ readonly draft: "draft";
11
+ readonly submitted: "submitted";
12
+ };
@@ -10,8 +10,7 @@ export interface CreateActItem {
10
10
  kind: string;
11
11
  /** Section title (for kind=section) */
12
12
  title?: string;
13
- /** @minLength 3 */
14
- room_title?: string;
13
+ section_title?: string;
15
14
  work_type?: string;
16
15
  quantity?: number;
17
16
  unit?: string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface CreateActItemRequest {
9
+ section_title?: string;
10
+ work_type: string;
11
+ quantity: number;
12
+ unit: string;
13
+ unit_price: number;
14
+ total: number;
15
+ note?: string;
16
+ }
@@ -9,9 +9,7 @@ import type { CreateActItem } from './createActItem';
9
9
  export interface CreateActRequest {
10
10
  contract_id: string;
11
11
  estimate_id: string;
12
- title: string;
13
- description?: string;
14
12
  period_start: string;
15
13
  period_end: string;
16
- items: CreateActItem[];
14
+ items?: CreateActItem[];
17
15
  }
@@ -8,7 +8,12 @@
8
8
  export * from './act';
9
9
  export * from './actItem';
10
10
  export * from './actListItem';
11
+ export * from './actPreviewResponse';
12
+ export * from './actStatus';
11
13
  export * from './createActItem';
14
+ export * from './createActItemRequest';
12
15
  export * from './createActRequest';
13
16
  export * from './getActsResponse';
17
+ export * from './updateActItemRequest';
18
+ export * from './updateActMetadataRequest';
14
19
  export * from './updateActRequest';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface UpdateActItemRequest {
9
+ section_title?: string;
10
+ work_type?: string;
11
+ quantity?: number;
12
+ unit?: string;
13
+ unit_price?: number;
14
+ total?: number;
15
+ note?: string;
16
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface UpdateActMetadataRequest {
9
+ period_start?: string;
10
+ period_end?: string;
11
+ }
@@ -9,8 +9,6 @@ import type { CreateActItem } from './createActItem';
9
9
  export interface UpdateActRequest {
10
10
  contract_id: string;
11
11
  estimate_id: string;
12
- title: string;
13
- description?: string;
14
12
  period_start: string;
15
13
  period_end: string;
16
14
  items: CreateActItem[];
@@ -9,7 +9,5 @@ export interface Estimate {
9
9
  uuid: string;
10
10
  contract_id: string;
11
11
  object_id?: string;
12
- title: string;
13
- description?: string;
14
12
  is_confirmed: boolean;
15
13
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export * from './workTypeSuggestion';
9
+ export * from './workTypeSuggestionsResponse';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface WorkTypeSuggestion {
9
+ work_type: string;
10
+ unit: string;
11
+ unit_price: number;
12
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { WorkTypeSuggestion } from './workTypeSuggestion';
9
+ export interface WorkTypeSuggestionsResponse {
10
+ items: WorkTypeSuggestion[];
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export type GetWorkTypeSuggestionsParams = {
9
+ estimate_id: string;
10
+ q: string;
11
+ /**
12
+ * @minimum 1
13
+ * @maximum 50
14
+ */
15
+ limit?: number;
16
+ };
@@ -8,10 +8,13 @@
8
8
  export * from './act';
9
9
  export * from './actItem';
10
10
  export * from './actListItem';
11
+ export * from './actPreviewResponse';
12
+ export * from './actStatus';
11
13
  export * from './authRequest';
12
14
  export * from './authResponse';
13
15
  export * from './contract';
14
16
  export * from './createActItem';
17
+ export * from './createActItemRequest';
15
18
  export * from './createActRequest';
16
19
  export * from './errorResponse';
17
20
  export * from './estimate';
@@ -22,8 +25,13 @@ export * from './getEstimatesParams';
22
25
  export * from './getEstimatesResponse';
23
26
  export * from './getObjectsResponse';
24
27
  export * from './getUnitsResponse';
28
+ export * from './getWorkTypeSuggestionsParams';
25
29
  export * from './healthResponse';
26
30
  export * from './object';
27
31
  export * from './pingResponse';
28
32
  export * from './unit';
33
+ export * from './updateActItemRequest';
34
+ export * from './updateActMetadataRequest';
29
35
  export * from './updateActRequest';
36
+ export * from './workTypeSuggestion';
37
+ export * from './workTypeSuggestionsResponse';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export * from './schema';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { ErrorResponse } from '../components-schemas-common/errorResponse';
9
+ export type Schema = ErrorResponse;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export * from './schema';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { ErrorResponse } from '../components-schemas-common/errorResponse';
9
+ export type Schema = ErrorResponse;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export * from './schema';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { ErrorResponse } from '../components-schemas-common/errorResponse';
9
+ export type Schema = ErrorResponse;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export * from './schema';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { ErrorResponse } from '../components-schemas-common/errorResponse';
9
+ export type Schema = ErrorResponse;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,18 +1,17 @@
1
1
  export type Act = {
2
2
  uuid: string;
3
3
  contract_id: string;
4
- object_id?: string;
5
4
  estimate_id: string;
6
- title: string;
7
- description?: string;
8
5
  period_start: string;
9
6
  period_end: string;
7
+ status: ActStatus;
8
+ submitted_at?: string;
10
9
  items: Array<ActItem>;
11
10
  };
12
11
  export type ActItem = {
13
12
  uuid: string;
14
13
  act_id: string;
15
- room_title?: string;
14
+ section_title?: string;
16
15
  work_type: string;
17
16
  quantity: number;
18
17
  unit: string;
@@ -23,13 +22,16 @@ export type ActItem = {
23
22
  export type ActListItem = {
24
23
  uuid: string;
25
24
  contract_id: string;
26
- object_id?: string;
27
25
  estimate_id: string;
28
- title: string;
29
- description?: string;
30
26
  period_start: string;
31
27
  period_end: string;
28
+ status: ActStatus;
29
+ submitted_at?: string;
32
30
  };
31
+ export type ActPreviewResponse = {
32
+ url: string;
33
+ };
34
+ export type ActStatus = 'draft' | 'submitted';
33
35
  export type AuthRequest = {
34
36
  /**
35
37
  * Raw Telegram WebApp initData string.
@@ -56,7 +58,7 @@ export type CreateActItem = {
56
58
  * Section title (for kind=section)
57
59
  */
58
60
  title?: string;
59
- room_title?: string;
61
+ section_title?: string;
60
62
  work_type?: string;
61
63
  quantity?: number;
62
64
  unit?: string;
@@ -64,14 +66,21 @@ export type CreateActItem = {
64
66
  note?: string;
65
67
  total?: number;
66
68
  };
69
+ export type CreateActItemRequest = {
70
+ section_title?: string;
71
+ work_type: string;
72
+ quantity: number;
73
+ unit: string;
74
+ unit_price: number;
75
+ total: number;
76
+ note?: string;
77
+ };
67
78
  export type CreateActRequest = {
68
79
  contract_id: string;
69
80
  estimate_id: string;
70
- title: string;
71
- description?: string;
72
81
  period_start: string;
73
82
  period_end: string;
74
- items: Array<CreateActItem>;
83
+ items?: Array<CreateActItem>;
75
84
  };
76
85
  export type ErrorResponse = {
77
86
  error: string;
@@ -80,8 +89,6 @@ export type Estimate = {
80
89
  uuid: string;
81
90
  contract_id: string;
82
91
  object_id?: string;
83
- title: string;
84
- description?: string;
85
92
  is_confirmed: boolean;
86
93
  };
87
94
  export type GetActsResponse = {
@@ -112,11 +119,22 @@ export type PingResponse = {
112
119
  export type Unit = {
113
120
  unit: string;
114
121
  };
122
+ export type UpdateActItemRequest = {
123
+ section_title?: string;
124
+ work_type?: string;
125
+ quantity?: number;
126
+ unit?: string;
127
+ unit_price?: number;
128
+ total?: number;
129
+ note?: string;
130
+ };
131
+ export type UpdateActMetadataRequest = {
132
+ period_start?: string;
133
+ period_end?: string;
134
+ };
115
135
  export type UpdateActRequest = {
116
136
  contract_id: string;
117
137
  estimate_id: string;
118
- title: string;
119
- description?: string;
120
138
  period_start: string;
121
139
  period_end: string;
122
140
  items: Array<CreateActItem>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zdn3517/act-api",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "scripts": {