@appconda/nextjs 1.0.105 → 1.0.107

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.
@@ -0,0 +1,5 @@
1
+ import { ServiceClient } from "../service-client";
2
+ export declare class Node extends ServiceClient {
3
+ protected getServiceName(): string;
4
+ GetAllNodes(isPublic?: boolean): Promise<any[]>;
5
+ }
@@ -0,0 +1,11 @@
1
+ import { ServiceClient } from "../service-client";
2
+ export class Node extends ServiceClient {
3
+ getServiceName() {
4
+ return 'com.appconda.service.node';
5
+ }
6
+ // @Cache()
7
+ async GetAllNodes(isPublic) {
8
+ const payload = {};
9
+ return await this.actionCall('GetAllNodes', payload);
10
+ }
11
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@appconda/nextjs",
3
3
  "homepage": "https://appconda.io/support",
4
4
  "description": "Appconda is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5
- "version": "1.0.105",
5
+ "version": "1.0.107",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -4,9 +4,22 @@
4
4
  import { actionClient } from '../../actions/actionClient';
5
5
  import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
6
6
  import { getSDKForService } from '../../getSDKForService';
7
- import { CreateSprintSchema, CreateTaskListSchema, DeleteSprintSchema, DeleteTaskListSchema, GetSprintSchema, GetTaskListSchema, UpdateSprintSchema, UpdateTaskListSchema } from './schema';
8
- import { Sprint, TaskList } from './types';
7
+ import { CreateProjectSchema, CreateSprintSchema, CreateTaskListSchema, DeleteSprintSchema, DeleteTaskListSchema, GetSprintSchema, GetTaskListSchema, UpdateSprintSchema, UpdateTaskListSchema } from './schema';
8
+ import { Project, Sprint, TaskList } from './types';
9
9
 
10
+ export const CreateProject = actionClient
11
+ .schema(CreateProjectSchema)
12
+ .action(async ({ parsedInput }): Promise<Project> => {
13
+ try {
14
+
15
+ const { task } = await getSDKForCurrentUser();
16
+ return await task.CreateProject(parsedInput);
17
+
18
+ } catch (error) {
19
+ console.error('Error in CreateProject:', error);
20
+ throw new Error('Failed to fetch CreateProject');
21
+ }
22
+ });
10
23
 
11
24
  export const CreateTaskList = actionClient
12
25
  .schema(CreateTaskListSchema)
@@ -1,5 +1,13 @@
1
1
  import { z } from "zod";
2
2
 
3
+ export const CreateProjectSchema = z.object({
4
+ id: z.string().optional(),
5
+ tenantId: z.string(),
6
+ ownerId: z.string(),
7
+ title: z.string(),
8
+ description: z.string().optional()
9
+ });
10
+
3
11
  export const CreateTaskListSchema = z.object({
4
12
  id: z.string().optional(),
5
13
  name: z.string(),
@@ -39,4 +47,3 @@ export const DeleteTaskListSchema = z.object({
39
47
  export const DeleteSprintSchema = z.object({
40
48
  id: z.string()
41
49
  });
42
-
@@ -1,8 +1,8 @@
1
1
 
2
2
  import z from "zod";
3
3
  import { ServiceClient } from "../../service-client";
4
- import { CreateSprintSchema, CreateTaskListSchema, DeleteSprintSchema, DeleteTaskListSchema, GetSprintSchema, GetTaskListSchema, UpdateSprintSchema, UpdateTaskListSchema } from "./schema";
5
- import { Sprint, TaskList } from "./types";
4
+ import { CreateProjectSchema, CreateSprintSchema, CreateTaskListSchema, DeleteSprintSchema, DeleteTaskListSchema, GetSprintSchema, GetTaskListSchema, UpdateSprintSchema, UpdateTaskListSchema } from "./schema";
5
+ import { Project, Sprint, TaskList } from "./types";
6
6
 
7
7
 
8
8
  export class TaskService extends ServiceClient {
@@ -10,6 +10,10 @@ export class TaskService extends ServiceClient {
10
10
  return 'com.appconda.service.task';
11
11
  }
12
12
 
13
+ public async CreateProject(payload: z.infer<typeof CreateProjectSchema>): Promise<Project> {
14
+ return await this.actionCall('CreateProject', payload);
15
+ }
16
+
13
17
  public async CreateTaskList(payload: z.infer<typeof CreateTaskListSchema>): Promise<TaskList> {
14
18
  return await this.actionCall('CreateTaskList', payload);
15
19
  }
@@ -11,3 +11,79 @@ export type Sprint = {
11
11
  description: string;
12
12
  }
13
13
 
14
+
15
+ export type Project = {
16
+ id: string;
17
+ tenantId: string;
18
+ picture?: string;
19
+ ownerId: string;
20
+ title: string;
21
+ web?: string;
22
+ createdDate: Date;
23
+ updatedDate: Date;
24
+ description?: string;
25
+ starred: number;
26
+ archived: boolean;
27
+ defaultView: boolean;
28
+ itemName: string;
29
+ itemsName: string;
30
+ projectType: number;
31
+ commentAll: number;
32
+ commitsVisibility: number;
33
+ inviteAll: boolean;
34
+ projectColor?: string;
35
+ viewTitle?: string;
36
+ position?: number;
37
+ tasks: Task[];
38
+ }
39
+ export interface Task {
40
+ id: string;
41
+ projectId: string;
42
+ project: Project;
43
+ milestoneId?: string;
44
+ milestone?: Milestone;
45
+ sprintId?: string;
46
+ sprint?: Sprint;
47
+ taskType: string;
48
+ creator: string;
49
+ secondId: number;
50
+ title: string;
51
+ description?: string;
52
+ lastPicture?: string;
53
+ lastPictureExternalUrl?: string;
54
+ createdAt: Date;
55
+ updatedAt: Date;
56
+ deadline?: Date;
57
+ archived: boolean;
58
+ color?: string;
59
+ estimated?: string;
60
+ timeTracked?: string;
61
+ isPublic: boolean;
62
+ state: number;
63
+ coverWidth?: number;
64
+ coverHeight?: number;
65
+ checklist?: string;
66
+ comments: number;
67
+ publicComments: number;
68
+ likes: number;
69
+ attachments: number;
70
+ commits: number;
71
+ supportTickets: number;
72
+ value?: number;
73
+ points?: number;
74
+ pointsDone?: number;
75
+ position?: number;
76
+ }
77
+
78
+ export type Milestone = {
79
+ id: string;
80
+ title: string;
81
+ createdAt: Date;
82
+ updatedAt: Date;
83
+ archived: boolean;
84
+ complete: boolean;
85
+ deadline: Date;
86
+ color?: string;
87
+ position: number;
88
+ Task: Task[];
89
+ }