@appconda/nextjs 1.0.161 → 1.1.3

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 (277) hide show
  1. package/dist/actions/actionClient.d.ts +8 -2
  2. package/dist/actions/actionClient.js +21 -15
  3. package/dist/actions/auth.d.ts +1 -0
  4. package/dist/actions/auth.js +7 -0
  5. package/dist/actions/authOptions.d.ts +5 -0
  6. package/dist/actions/authOptions.js +235 -0
  7. package/dist/actions/index.d.ts +3 -0
  8. package/dist/actions/index.js +4 -0
  9. package/dist/actions/nextAuthHandler.d.ts +1 -0
  10. package/dist/actions/nextAuthHandler.js +6 -0
  11. package/dist/client.d.ts +1 -1
  12. package/dist/client.js +1 -0
  13. package/dist/decorators/Cache.js +1 -0
  14. package/dist/decorators/CacheKey.js +1 -0
  15. package/dist/decorators/Invalidate.js +1 -0
  16. package/dist/enums/api-service.js +1 -0
  17. package/dist/enums/api.js +1 -0
  18. package/dist/enums/auth-method.js +1 -0
  19. package/dist/enums/browser.js +1 -0
  20. package/dist/enums/compression.js +1 -0
  21. package/dist/enums/credit-card.js +1 -0
  22. package/dist/enums/database-usage-range.js +1 -0
  23. package/dist/enums/email-template-locale.js +1 -0
  24. package/dist/enums/email-template-type.js +1 -0
  25. package/dist/enums/entities/EntityLimitType.js +1 -0
  26. package/dist/enums/entities/PropertyAttributeName.js +1 -0
  27. package/dist/enums/entities/PropertyCondition.js +1 -0
  28. package/dist/enums/entities/PropertyType.js +1 -0
  29. package/dist/enums/entities/PropertyValueType.js +1 -0
  30. package/dist/enums/entities/RowAccess.js +1 -0
  31. package/dist/enums/entities/ViewFilterCondition.js +1 -0
  32. package/dist/enums/execution-method.js +1 -0
  33. package/dist/enums/flag.js +1 -0
  34. package/dist/enums/function-usage-range.js +1 -0
  35. package/dist/enums/image-format.js +1 -0
  36. package/dist/enums/image-gravity.js +1 -0
  37. package/dist/enums/index-type.js +1 -0
  38. package/dist/enums/messaging-provider-type.js +1 -0
  39. package/dist/enums/name.js +1 -0
  40. package/dist/enums/o-auth-provider copy.js +1 -0
  41. package/dist/enums/password-hash.js +1 -0
  42. package/dist/enums/platform-type.js +1 -0
  43. package/dist/enums/project-usage-range.js +1 -0
  44. package/dist/enums/region.js +1 -0
  45. package/dist/enums/relation-mutate.js +1 -0
  46. package/dist/enums/relationship-type.js +1 -0
  47. package/dist/enums/resource-type.js +1 -0
  48. package/dist/enums/runtime.js +1 -0
  49. package/dist/enums/s-m-t-p-secure.js +1 -0
  50. package/dist/enums/shared/ApplicationLayout.js +1 -0
  51. package/dist/enums/shared/Colors.js +1 -0
  52. package/dist/enums/shared/InputType.js +1 -0
  53. package/dist/enums/shared/Periodicity.js +1 -0
  54. package/dist/enums/shared/SvgIcon.js +1 -0
  55. package/dist/enums/shared/Theme.js +1 -0
  56. package/dist/enums/sms-template-locale.js +1 -0
  57. package/dist/enums/sms-template-type.js +1 -0
  58. package/dist/enums/smtp-encryption.js +1 -0
  59. package/dist/enums/storage-usage-range.js +1 -0
  60. package/dist/enums/subscriptions/PricingModel.js +1 -0
  61. package/dist/enums/subscriptions/SubscriptionBillingPeriod.js +1 -0
  62. package/dist/enums/subscriptions/SubscriptionFeatureLimitType.js +1 -0
  63. package/dist/enums/subscriptions/SubscriptionPriceType.js +1 -0
  64. package/dist/enums/tenants/LinkedAccountStatus.js +1 -0
  65. package/dist/enums/tenants/TenantUserJoined.js +1 -0
  66. package/dist/enums/tenants/TenantUserStatus.js +1 -0
  67. package/dist/enums/tenants/TenantUserType.js +1 -0
  68. package/dist/enums/user-usage-range.js +1 -0
  69. package/dist/getAppcondaClient.js +5 -3
  70. package/dist/getSDKForCurrentUser.d.ts +8 -2
  71. package/dist/getSDKForCurrentUser.js +13 -5
  72. package/dist/getSDKForService.js +3 -1
  73. package/dist/getSDKForTenant.d.ts +20 -0
  74. package/dist/getSDKForTenant.js +44 -0
  75. package/dist/id.js +1 -0
  76. package/dist/index.d.ts +4 -1
  77. package/dist/index.js +5 -1
  78. package/dist/inputFile.js +1 -0
  79. package/dist/lib/Cache/Adapter.js +1 -0
  80. package/dist/lib/Cache/Adapters/Filesystem.js +1 -0
  81. package/dist/lib/Cache/Adapters/Memory.js +1 -0
  82. package/dist/lib/Cache/Adapters/None.js +1 -0
  83. package/dist/lib/Cache/Adapters/Sharding.js +1 -0
  84. package/dist/lib/Cache/Cache.js +1 -0
  85. package/dist/lib/Cache/index.js +1 -0
  86. package/dist/lib/Cache/test.js +1 -0
  87. package/dist/lib/Registry/Registry.js +1 -0
  88. package/dist/lib/Registry/index.js +1 -0
  89. package/dist/lib/Services.js +1 -0
  90. package/dist/lib/crypto.d.ts +23 -0
  91. package/dist/lib/crypto.js +78 -0
  92. package/dist/lib/env.d.ts +1 -0
  93. package/dist/lib/env.js +137 -0
  94. package/dist/lib/errors.d.ts +70 -0
  95. package/dist/lib/errors.js +76 -0
  96. package/dist/lib/index.d.ts +2 -0
  97. package/dist/lib/index.js +3 -0
  98. package/dist/lib/jwt.d.ts +12 -0
  99. package/dist/lib/jwt.js +103 -0
  100. package/dist/models.js +1 -0
  101. package/dist/modules/account/actions.d.ts +20 -14
  102. package/dist/modules/account/actions.js +1 -0
  103. package/dist/modules/account/enums/authentication-factor.js +1 -0
  104. package/dist/modules/account/enums/authenticator-type.js +1 -0
  105. package/dist/modules/account/enums/o-auth-provider.js +1 -0
  106. package/dist/modules/account/index.js +1 -0
  107. package/dist/modules/account/schema.d.ts +8 -8
  108. package/dist/modules/account/schema.js +1 -0
  109. package/dist/modules/account/service.js +1 -0
  110. package/dist/modules/account/types.js +1 -0
  111. package/dist/modules/acl/service.d.ts +26 -0
  112. package/dist/modules/acl/service.js +27 -0
  113. package/dist/modules/agent/action.d.ts +27 -23
  114. package/dist/modules/agent/action.js +1 -0
  115. package/dist/modules/agent/index.js +1 -0
  116. package/dist/modules/agent/schema.d.ts +18 -18
  117. package/dist/modules/agent/schema.js +1 -0
  118. package/dist/modules/agent/service.js +1 -0
  119. package/dist/modules/agent/types.js +1 -0
  120. package/dist/modules/ai/index.js +1 -0
  121. package/dist/modules/ai/node/actions.d.ts +1 -1
  122. package/dist/modules/ai/node/actions.js +1 -0
  123. package/dist/modules/ai/node/index.js +1 -0
  124. package/dist/modules/ai/node/service.js +1 -0
  125. package/dist/modules/hooks/index.d.ts +2 -0
  126. package/dist/modules/hooks/index.js +3 -0
  127. package/dist/modules/hooks/lib/Hooks.d.ts +32 -0
  128. package/dist/modules/hooks/lib/Hooks.js +64 -0
  129. package/dist/modules/hooks/lib/handler.d.ts +12 -0
  130. package/dist/modules/hooks/lib/handler.js +23 -0
  131. package/dist/modules/hooks/lib/jobs/index.d.ts +2 -0
  132. package/dist/modules/hooks/lib/jobs/index.js +3 -0
  133. package/dist/modules/hooks/lib/jobs/job1.d.ts +1 -0
  134. package/dist/modules/hooks/lib/jobs/job1.js +31 -0
  135. package/dist/modules/hooks/lib/jobs/log-job.d.ts +1 -0
  136. package/dist/modules/hooks/lib/jobs/log-job.js +9 -0
  137. package/dist/modules/hooks/lib/wait.d.ts +8 -0
  138. package/dist/modules/hooks/lib/wait.js +13 -0
  139. package/dist/modules/index.d.ts +4 -0
  140. package/dist/modules/index.js +5 -0
  141. package/dist/modules/scheduled-job/action.d.ts +97 -0
  142. package/dist/modules/scheduled-job/action.js +77 -0
  143. package/dist/modules/scheduled-job/index.d.ts +7 -0
  144. package/dist/modules/scheduled-job/index.js +8 -0
  145. package/dist/modules/scheduled-job/lib/Schedules.d.ts +32 -0
  146. package/dist/modules/scheduled-job/lib/Schedules.js +64 -0
  147. package/dist/modules/scheduled-job/lib/handler.d.ts +12 -0
  148. package/dist/modules/scheduled-job/lib/handler.js +23 -0
  149. package/dist/modules/scheduled-job/lib/jobs/index.d.ts +2 -0
  150. package/dist/modules/scheduled-job/lib/jobs/index.js +3 -0
  151. package/dist/modules/scheduled-job/lib/jobs/job1.d.ts +1 -0
  152. package/dist/modules/scheduled-job/lib/jobs/job1.js +30 -0
  153. package/dist/modules/scheduled-job/lib/jobs/log-job.d.ts +1 -0
  154. package/dist/modules/scheduled-job/lib/jobs/log-job.js +9 -0
  155. package/dist/modules/scheduled-job/lib/wait.d.ts +8 -0
  156. package/dist/modules/scheduled-job/lib/wait.js +13 -0
  157. package/dist/modules/scheduled-job/schema.d.ts +52 -0
  158. package/dist/modules/scheduled-job/schema.js +23 -0
  159. package/dist/modules/scheduled-job/service.d.ts +13 -0
  160. package/dist/modules/scheduled-job/service.js +25 -0
  161. package/dist/modules/scheduled-job/types.d.ts +29 -0
  162. package/dist/modules/scheduled-job/types.js +2 -0
  163. package/dist/modules/task/action.d.ts +201 -0
  164. package/dist/modules/task/action.js +147 -0
  165. package/dist/modules/task/index.d.ts +4 -0
  166. package/dist/modules/task/index.js +5 -0
  167. package/dist/modules/task/schema.d.ts +107 -0
  168. package/dist/modules/task/schema.js +44 -0
  169. package/dist/modules/task/service.d.ts +19 -0
  170. package/dist/modules/task/service.js +43 -0
  171. package/dist/modules/task/types.d.ts +84 -0
  172. package/dist/modules/task/types.js +2 -0
  173. package/dist/modules/tenant/actions.d.ts +49 -0
  174. package/dist/modules/tenant/actions.js +38 -0
  175. package/dist/modules/tenant/index.d.ts +3 -0
  176. package/dist/modules/tenant/index.js +4 -0
  177. package/dist/{services → modules/tenant}/tenant.d.ts +3 -3
  178. package/dist/modules/tenant/tenant.js +125 -0
  179. package/dist/modules/tenant/types.d.ts +11 -0
  180. package/dist/modules/tenant/types.js +2 -0
  181. package/dist/modules/waitlist/action.d.ts +31 -29
  182. package/dist/modules/waitlist/action.js +1 -0
  183. package/dist/modules/waitlist/index.js +1 -0
  184. package/dist/modules/waitlist/schema.d.ts +12 -12
  185. package/dist/modules/waitlist/schema.js +1 -0
  186. package/dist/modules/waitlist/service.js +1 -0
  187. package/dist/modules/waitlist/types.js +1 -0
  188. package/dist/permission.js +1 -0
  189. package/dist/query.js +1 -0
  190. package/dist/role.js +1 -0
  191. package/dist/schemas/nodes.js +1 -0
  192. package/dist/service-client.js +1 -0
  193. package/dist/service.js +1 -0
  194. package/dist/services/applets.js +1 -0
  195. package/dist/services/avatars.js +1 -0
  196. package/dist/services/chat-flow.js +1 -0
  197. package/dist/services/community.js +1 -0
  198. package/dist/services/configuration.js +1 -0
  199. package/dist/services/databases.js +1 -0
  200. package/dist/services/functions.js +1 -0
  201. package/dist/services/graphql.js +1 -0
  202. package/dist/services/health.js +1 -0
  203. package/dist/services/locale.js +1 -0
  204. package/dist/services/messaging.js +1 -0
  205. package/dist/services/permissions.js +1 -0
  206. package/dist/services/pricing.js +1 -0
  207. package/dist/services/projects.js +1 -0
  208. package/dist/services/roles.js +1 -0
  209. package/dist/services/schema.js +1 -0
  210. package/dist/services/storage.js +1 -0
  211. package/dist/services/subscription.js +1 -0
  212. package/dist/services/teams.js +1 -0
  213. package/dist/services/tenant-subscription.js +1 -0
  214. package/dist/services/users.js +1 -0
  215. package/package.json +4 -1
  216. package/src/actions/actionClient.ts +13 -6
  217. package/src/actions/auth.ts +7 -0
  218. package/src/actions/authOptions.ts +255 -0
  219. package/src/actions/index.ts +3 -0
  220. package/src/actions/nextAuthHandler.ts +9 -0
  221. package/src/client.ts +1 -1
  222. package/src/getAppcondaClient.ts +4 -3
  223. package/src/getSDKForCurrentUser.ts +12 -5
  224. package/src/getSDKForService.ts +2 -1
  225. package/src/getSDKForTenant.ts +52 -0
  226. package/src/index.ts +4 -2
  227. package/src/lib/crypto.ts +105 -0
  228. package/src/lib/env.ts +145 -0
  229. package/src/lib/errors.ts +138 -0
  230. package/src/lib/index.ts +2 -0
  231. package/src/lib/jwt.ts +113 -0
  232. package/src/modules/account/actions.ts +1 -1
  233. package/src/modules/acl/service.ts +55 -0
  234. package/src/modules/agent/action.ts +2 -0
  235. package/src/modules/ai/node/actions.ts +0 -1
  236. package/src/modules/hooks/index.ts +4 -0
  237. package/src/modules/hooks/lib/Hooks.ts +103 -0
  238. package/src/modules/hooks/lib/handler.ts +27 -0
  239. package/src/modules/hooks/lib/jobs/index.ts +2 -0
  240. package/src/modules/hooks/lib/jobs/job1.ts +35 -0
  241. package/src/modules/hooks/lib/jobs/log-job.ts +9 -0
  242. package/src/modules/hooks/lib/wait.ts +17 -0
  243. package/src/modules/index.ts +5 -1
  244. package/src/modules/scheduled-job/action.ts +94 -0
  245. package/src/modules/scheduled-job/index.ts +8 -0
  246. package/src/modules/scheduled-job/lib/Schedules.ts +103 -0
  247. package/src/modules/scheduled-job/lib/handler.ts +27 -0
  248. package/src/modules/scheduled-job/lib/jobs/index.ts +2 -0
  249. package/src/modules/scheduled-job/lib/jobs/job1.ts +34 -0
  250. package/src/modules/scheduled-job/lib/jobs/log-job.ts +9 -0
  251. package/src/modules/scheduled-job/lib/wait.ts +17 -0
  252. package/src/modules/scheduled-job/schema.ts +31 -0
  253. package/src/modules/scheduled-job/service.ts +37 -0
  254. package/src/modules/scheduled-job/types.ts +35 -0
  255. package/src/modules/task/action.ts +175 -0
  256. package/src/modules/task/index.ts +4 -0
  257. package/src/modules/task/schema.ts +53 -0
  258. package/src/modules/task/service.ts +62 -0
  259. package/src/modules/task/types.ts +89 -0
  260. package/src/modules/tenant/actions.ts +46 -0
  261. package/src/modules/tenant/index.ts +3 -0
  262. package/src/{services → modules/tenant}/tenant.ts +3 -4
  263. package/src/modules/tenant/types.ts +12 -0
  264. package/tsconfig.json +4 -1
  265. package/dist/actions/nodes.d.ts +0 -4
  266. package/dist/actions/nodes.js +0 -15
  267. package/dist/enums/authentication-factor.d.ts +0 -6
  268. package/dist/enums/authentication-factor.js +0 -7
  269. package/dist/enums/authenticator-type.d.ts +0 -3
  270. package/dist/enums/authenticator-type.js +0 -4
  271. package/dist/enums/o-auth-provider.d.ts +0 -41
  272. package/dist/enums/o-auth-provider.js +0 -42
  273. package/dist/services/account.d.ts +0 -530
  274. package/dist/services/account.js +0 -1259
  275. package/dist/services/node.d.ts +0 -5
  276. package/dist/services/node.js +0 -11
  277. package/dist/services/tenant.js +0 -124
@@ -0,0 +1,35 @@
1
+
2
+
3
+ export type ScheduledJob = {
4
+ id: string;
5
+ name: string;
6
+ cron: string;
7
+ enabled: boolean;
8
+ lastRun?: Date;
9
+ nextRun?: Date;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ }
13
+
14
+ export type JobRun = {
15
+ id: string;
16
+ jobId: string;
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ }
20
+
21
+ export type Execution = {
22
+ id: string;
23
+ scheduledJobId: string;
24
+ createdAt: Date;
25
+ updatedAt: Date;
26
+ status: string;
27
+ }
28
+
29
+ export type AvgExecution = {
30
+ scheduledJobId: string;
31
+ totalExecutions: number;
32
+ activeDays: number;
33
+ avgExecutionsPerDay: number;
34
+ }
35
+
@@ -0,0 +1,175 @@
1
+ 'use server';
2
+
3
+
4
+ import { actionClient } from '../../actions/actionClient';
5
+ import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
6
+ import { getSDKForService } from '../../getSDKForService';
7
+ import { CreateProjectSchema, CreateSprintSchema, CreateTaskListSchema, DeleteSprintSchema, DeleteTaskListSchema, GetSprintSchema, GetTaskListSchema, ListProjectsSchema, UpdateSprintSchema, UpdateTaskListSchema } from './schema';
8
+ import { Project, Sprint, TaskList } from './types';
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
+ });
23
+
24
+ export const ListProjects = actionClient
25
+ .schema(ListProjectsSchema)
26
+ .action(async ({ parsedInput }): Promise<Project[]> => {
27
+ try {
28
+
29
+ const { task } = await getSDKForCurrentUser();
30
+ return await task.ListProjects(parsedInput);
31
+
32
+ } catch (error) {
33
+ console.error('Error in ListProjects:', error);
34
+ throw new Error('Failed to fetch ListProjects');
35
+ }
36
+ });
37
+
38
+ export const CreateTaskList = actionClient
39
+ .schema(CreateTaskListSchema)
40
+ .action(async ({ parsedInput }): Promise<TaskList> => {
41
+ try {
42
+
43
+ const { task } = await getSDKForCurrentUser();
44
+ return await task.CreateTaskList(parsedInput);
45
+
46
+ } catch (error) {
47
+ console.error('Error in CreateTaskList:', error);
48
+ throw new Error('Failed to fetch CreateTaskList');
49
+ }
50
+ });
51
+
52
+ export const GetTaskList = actionClient
53
+ .schema(GetTaskListSchema)
54
+ .action(async ({ parsedInput }): Promise<TaskList> => {
55
+ try {
56
+
57
+ const { task } = await getSDKForCurrentUser();
58
+ return await task.GetTaskList(parsedInput);
59
+
60
+ } catch (error) {
61
+ console.error('Error in GetTaskList:', error);
62
+ throw new Error('Failed to fetch GetTaskList');
63
+ }
64
+ });
65
+
66
+ export const ListTaskLists = actionClient
67
+ .action(async ({ parsedInput }): Promise<TaskList[]> => {
68
+ try {
69
+
70
+ const { task } = await getSDKForCurrentUser();
71
+ return await task.ListTaskLists();
72
+
73
+ } catch (error) {
74
+ console.error('Error in ListTaskLists:', error);
75
+ throw new Error('Failed to fetch ListTaskLists');
76
+ }
77
+ });
78
+
79
+ export const UpdateTaskList = actionClient
80
+ .schema(UpdateTaskListSchema)
81
+ .action(async ({ parsedInput }): Promise<TaskList> => {
82
+ try {
83
+
84
+ const { task } = await getSDKForCurrentUser();
85
+ return await task.UpdateTaskList(parsedInput);
86
+
87
+ } catch (error) {
88
+ console.error('Error in UpdateTaskList:', error);
89
+ throw new Error('Failed to fetch UpdateTaskList');
90
+ }
91
+ });
92
+
93
+ export const DeleteTaskList = actionClient
94
+ .schema(DeleteTaskListSchema)
95
+ .action(async ({ parsedInput }): Promise<void> => {
96
+ try {
97
+
98
+ const { task } = await getSDKForCurrentUser();
99
+ return await task.DeleteTaskList(parsedInput);
100
+
101
+ } catch (error) {
102
+ console.error('Error in DeleteTaskList:', error);
103
+ throw new Error('Failed to fetch DeleteTaskList');
104
+ }
105
+ });
106
+
107
+
108
+ export const CreateSprint = actionClient
109
+ .schema(CreateSprintSchema)
110
+ .action(async ({ parsedInput }): Promise<Sprint> => {
111
+ try {
112
+
113
+ const { task } = await getSDKForCurrentUser();
114
+ return await task.CreateSprint(parsedInput);
115
+
116
+ } catch (error) {
117
+ console.error('Error in CreateSprint:', error);
118
+ throw new Error('Failed to fetch CreateSprint');
119
+ }
120
+ });
121
+
122
+ export const GetSprint = actionClient
123
+ .schema(GetSprintSchema)
124
+ .action(async ({ parsedInput }): Promise<Sprint> => {
125
+ try {
126
+
127
+ const { task } = await getSDKForCurrentUser();
128
+ return await task.GetSprint(parsedInput);
129
+
130
+ } catch (error) {
131
+ console.error('Error in GetSprint:', error);
132
+ throw new Error('Failed to fetch GetSprint');
133
+ }
134
+ });
135
+
136
+ export const ListSprints = actionClient
137
+ .action(async ({ parsedInput }): Promise<Sprint[]> => {
138
+ try {
139
+
140
+ const { task } = await getSDKForCurrentUser();
141
+ return await task.ListSprints();
142
+
143
+ } catch (error) {
144
+ console.error('Error in ListSprints:', error);
145
+ throw new Error('Failed to fetch ListSprints');
146
+ }
147
+ });
148
+
149
+ export const UpdateSprint = actionClient
150
+ .schema(UpdateSprintSchema)
151
+ .action(async ({ parsedInput }): Promise<Sprint> => {
152
+ try {
153
+
154
+ const { task } = await getSDKForCurrentUser();
155
+ return await task.UpdateSprint(parsedInput);
156
+
157
+ } catch (error) {
158
+ console.error('Error in UpdateSprint:', error);
159
+ throw new Error('Failed to fetch UpdateSprint');
160
+ }
161
+ });
162
+
163
+ export const DeleteSprint = actionClient
164
+ .schema(DeleteSprintSchema)
165
+ .action(async ({ parsedInput }): Promise<void> => {
166
+ try {
167
+
168
+ const { task } = await getSDKForCurrentUser();
169
+ return await task.DeleteSprint(parsedInput);
170
+
171
+ } catch (error) {
172
+ console.error('Error in DeleteSprint:', error);
173
+ throw new Error('Failed to fetch DeleteSprint');
174
+ }
175
+ });
@@ -0,0 +1,4 @@
1
+ export * from './action';
2
+ export * from './schema';
3
+ export * from './service';
4
+ export * from './types';
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
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
+
11
+ export const ListProjectsSchema = z.object({
12
+ tenantId: z.string()
13
+ });
14
+
15
+ export const CreateTaskListSchema = z.object({
16
+ id: z.string().optional(),
17
+ name: z.string(),
18
+ description: z.string().optional()
19
+ });
20
+
21
+ export const CreateSprintSchema = z.object({
22
+ id: z.string().optional(),
23
+ name: z.string(),
24
+ description: z.string().optional()
25
+ });
26
+
27
+ export const GetTaskListSchema = z.object({
28
+ id: z.string()
29
+ });
30
+
31
+ export const GetSprintSchema = z.object({
32
+ id: z.string()
33
+ });
34
+
35
+ export const UpdateTaskListSchema = z.object({
36
+ id: z.string(),
37
+ name: z.string(),
38
+ description: z.string().optional()
39
+ });
40
+
41
+ export const UpdateSprintSchema = z.object({
42
+ id: z.string(),
43
+ name: z.string(),
44
+ description: z.string().optional()
45
+ });
46
+
47
+ export const DeleteTaskListSchema = z.object({
48
+ id: z.string()
49
+ });
50
+
51
+ export const DeleteSprintSchema = z.object({
52
+ id: z.string()
53
+ });
@@ -0,0 +1,62 @@
1
+
2
+ import z from "zod";
3
+ import { ServiceClient } from "../../service-client";
4
+ import { CreateProjectSchema, CreateSprintSchema, CreateTaskListSchema, DeleteSprintSchema, DeleteTaskListSchema, GetSprintSchema, GetTaskListSchema, ListProjectsSchema, UpdateSprintSchema, UpdateTaskListSchema } from "./schema";
5
+ import { Project, Sprint, TaskList } from "./types";
6
+
7
+
8
+ export class TaskService extends ServiceClient {
9
+ protected getServiceName(): string {
10
+ return 'com.appconda.service.task';
11
+ }
12
+
13
+ public async CreateProject(payload: z.infer<typeof CreateProjectSchema>): Promise<Project> {
14
+ return await this.actionCall('CreateProject', payload);
15
+ }
16
+
17
+ public async ListProjects(payload: z.infer<typeof ListProjectsSchema>): Promise<Project[]> {
18
+ return await this.actionCall('ListProjects', payload);
19
+ }
20
+
21
+ public async CreateTaskList(payload: z.infer<typeof CreateTaskListSchema>): Promise<TaskList> {
22
+ return await this.actionCall('CreateTaskList', payload);
23
+ }
24
+
25
+ public async CreateSprint(payload: z.infer<typeof CreateSprintSchema>): Promise<Sprint> {
26
+ return await this.actionCall('CreateSprint', payload);
27
+ }
28
+
29
+ public async ListTaskLists(): Promise<TaskList[]> {
30
+ return await this.actionCall('ListTaskLists', {});
31
+ }
32
+
33
+ public async ListSprints(): Promise<Sprint[]> {
34
+ return await this.actionCall('ListSprints', {});
35
+ }
36
+
37
+ public async GetTaskList(payload: z.infer<typeof GetTaskListSchema>): Promise<TaskList> {
38
+ return await this.actionCall('GetTaskList', payload);
39
+ }
40
+
41
+ public async GetSprint(payload: z.infer<typeof GetSprintSchema>): Promise<Sprint> {
42
+ return await this.actionCall('GetSprint', payload);
43
+ }
44
+
45
+ public async UpdateTaskList(payload: z.infer<typeof UpdateTaskListSchema>): Promise<TaskList> {
46
+ return await this.actionCall('UpdateTaskList', payload);
47
+ }
48
+
49
+ public async UpdateSprint(payload: z.infer<typeof UpdateSprintSchema>): Promise<Sprint> {
50
+ return await this.actionCall('UpdateSprint', payload);
51
+ }
52
+
53
+ public async DeleteTaskList(payload: z.infer<typeof DeleteTaskListSchema>): Promise<void> {
54
+ return await this.actionCall('DeleteTaskList', payload);
55
+ }
56
+
57
+ public async DeleteSprint(payload: z.infer<typeof DeleteSprintSchema>): Promise<void> {
58
+ return await this.actionCall('DeleteSprint', payload);
59
+ }
60
+
61
+
62
+ }
@@ -0,0 +1,89 @@
1
+
2
+ export type TaskList = {
3
+ id: string;
4
+ name: string;
5
+ description: string;
6
+ }
7
+
8
+ export type Sprint = {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ }
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
+ }
@@ -0,0 +1,46 @@
1
+ 'use server';
2
+ import { z } from "zod";
3
+ import { actionClient } from "../../actions/actionClient";
4
+ import { getSDKForCurrentUser } from "../../getSDKForCurrentUser";
5
+
6
+ const getTenantActionSchema = z.object({
7
+ tenantId: z.string()
8
+ });
9
+
10
+ export const getTenantAction = actionClient
11
+ .schema(getTenantActionSchema)
12
+ .action(async ({ parsedInput }) => {
13
+ const { tenantId } = parsedInput;
14
+ const { tenants } = await getSDKForCurrentUser();
15
+ return await tenants.get(tenantId);
16
+ });
17
+
18
+
19
+
20
+ const listUserTenantsScheema = z.object({
21
+ userId: z.string()
22
+ });
23
+
24
+ export const listUserTenantsAction = actionClient
25
+ .schema(listUserTenantsScheema)
26
+ .action(async ({ parsedInput }) => {
27
+ const { userId } = parsedInput;
28
+ const { tenants } = await getSDKForCurrentUser();
29
+ return await tenants.listUserTenants(userId);
30
+ });
31
+
32
+
33
+ const createTenantScheema = z.object({
34
+ id: z.string(),
35
+ name: z.string(),
36
+ slug: z.string()
37
+ });
38
+
39
+ export const createTenantAction = actionClient
40
+ .schema(createTenantScheema)
41
+ .action(async ({ parsedInput }) => {
42
+ const { id, name, slug } = parsedInput;
43
+ const { tenants } = await getSDKForCurrentUser();
44
+ //@ts-ignore
45
+ return await tenants.create({ $id: id, name: name, slug: slug });
46
+ });
@@ -0,0 +1,3 @@
1
+ export * from "./tenant";
2
+ export * from "./types";
3
+ export * from "./actions";
@@ -1,5 +1,5 @@
1
- import { AppcondaException, Client, Models, Payload } from "../client";
2
- import { ServiceClient } from "../service-client";
1
+ import { AppcondaException, Client, Models, Payload } from "../../client";
2
+ import { ServiceClient } from "../../service-client";
3
3
 
4
4
  export type TenantSimple = {
5
5
  id: string;
@@ -11,9 +11,8 @@ export type TenantSimple = {
11
11
  active: boolean;
12
12
  };
13
13
 
14
- export class Tenant extends ServiceClient{
14
+ export class TenantService extends ServiceClient{
15
15
 
16
-
17
16
  public getServiceName(): string {
18
17
  return 'com.appconda.service.tenant';
19
18
  }
@@ -0,0 +1,12 @@
1
+
2
+ export type Tenant = {
3
+ id: string
4
+ createdAt: Date
5
+ updatedAt: Date
6
+ slug: string
7
+ name: string
8
+ icon: string | null
9
+ subscriptionId: string | null
10
+ active: boolean
11
+ deactivatedReason: string | null
12
+ }
package/tsconfig.json CHANGED
@@ -6,7 +6,8 @@
6
6
  "allowSyntheticDefaultImports": true,
7
7
  "declaration": true,
8
8
  "esModuleInterop": true,
9
- "inlineSourceMap": false,
9
+ "inlineSourceMap": true,
10
+ "inlineSources": true,
10
11
  "lib": ["ESNext", "DOM"],
11
12
  "listEmittedFiles": false,
12
13
  "listFiles": false,
@@ -18,6 +19,8 @@
18
19
  "traceResolution": false,
19
20
  "experimentalDecorators": true,
20
21
  "emitDecoratorMetadata": true,
22
+ "strictNullChecks": true,
23
+ "exactOptionalPropertyTypes": true,
21
24
  "outDir": "./dist",
22
25
  "paths": {
23
26
  "next-safe-action": ["./node_modules/next-safe-action/index.d.ts"]
@@ -1,4 +0,0 @@
1
- export declare const getAllNodesAction: import("next-safe-action").SafeActionFn<string, undefined, readonly [], {
2
- formErrors: string[];
3
- fieldErrors: {};
4
- }, readonly [], any[]>;
@@ -1,15 +0,0 @@
1
- 'use server';
2
- import { actionClient } from "./actionClient";
3
- import { getSDKForCurrentUser } from '../getSDKForCurrentUser';
4
- export const getAllNodesAction = actionClient
5
- // .schema(listModelsSchema)
6
- .action(async ({ parsedInput }) => {
7
- try {
8
- const { node } = await getSDKForCurrentUser();
9
- return await node.GetAllNodes();
10
- }
11
- catch (error) {
12
- console.error('Error in getAllNodesAction:', error);
13
- throw new Error('Failed to fetch nodes');
14
- }
15
- });
@@ -1,6 +0,0 @@
1
- export declare enum AuthenticationFactor {
2
- Email = "email",
3
- Phone = "phone",
4
- Totp = "totp",
5
- Recoverycode = "recoverycode"
6
- }
@@ -1,7 +0,0 @@
1
- export var AuthenticationFactor;
2
- (function (AuthenticationFactor) {
3
- AuthenticationFactor["Email"] = "email";
4
- AuthenticationFactor["Phone"] = "phone";
5
- AuthenticationFactor["Totp"] = "totp";
6
- AuthenticationFactor["Recoverycode"] = "recoverycode";
7
- })(AuthenticationFactor || (AuthenticationFactor = {}));
@@ -1,3 +0,0 @@
1
- export declare enum AuthenticatorType {
2
- Totp = "totp"
3
- }
@@ -1,4 +0,0 @@
1
- export var AuthenticatorType;
2
- (function (AuthenticatorType) {
3
- AuthenticatorType["Totp"] = "totp";
4
- })(AuthenticatorType || (AuthenticatorType = {}));
@@ -1,41 +0,0 @@
1
- export declare enum OAuthProvider {
2
- Amazon = "amazon",
3
- Apple = "apple",
4
- Auth0 = "auth0",
5
- Authentik = "authentik",
6
- Autodesk = "autodesk",
7
- Bitbucket = "bitbucket",
8
- Bitly = "bitly",
9
- Box = "box",
10
- Dailymotion = "dailymotion",
11
- Discord = "discord",
12
- Disqus = "disqus",
13
- Dropbox = "dropbox",
14
- Etsy = "etsy",
15
- Facebook = "facebook",
16
- Github = "github",
17
- Gitlab = "gitlab",
18
- Google = "google",
19
- Linkedin = "linkedin",
20
- Microsoft = "microsoft",
21
- Notion = "notion",
22
- Oidc = "oidc",
23
- Okta = "okta",
24
- Paypal = "paypal",
25
- PaypalSandbox = "paypalSandbox",
26
- Podio = "podio",
27
- Salesforce = "salesforce",
28
- Slack = "slack",
29
- Spotify = "spotify",
30
- Stripe = "stripe",
31
- Tradeshift = "tradeshift",
32
- TradeshiftBox = "tradeshiftBox",
33
- Twitch = "twitch",
34
- Wordpress = "wordpress",
35
- Yahoo = "yahoo",
36
- Yammer = "yammer",
37
- Yandex = "yandex",
38
- Zoho = "zoho",
39
- Zoom = "zoom",
40
- Mock = "mock"
41
- }
@@ -1,42 +0,0 @@
1
- export var OAuthProvider;
2
- (function (OAuthProvider) {
3
- OAuthProvider["Amazon"] = "amazon";
4
- OAuthProvider["Apple"] = "apple";
5
- OAuthProvider["Auth0"] = "auth0";
6
- OAuthProvider["Authentik"] = "authentik";
7
- OAuthProvider["Autodesk"] = "autodesk";
8
- OAuthProvider["Bitbucket"] = "bitbucket";
9
- OAuthProvider["Bitly"] = "bitly";
10
- OAuthProvider["Box"] = "box";
11
- OAuthProvider["Dailymotion"] = "dailymotion";
12
- OAuthProvider["Discord"] = "discord";
13
- OAuthProvider["Disqus"] = "disqus";
14
- OAuthProvider["Dropbox"] = "dropbox";
15
- OAuthProvider["Etsy"] = "etsy";
16
- OAuthProvider["Facebook"] = "facebook";
17
- OAuthProvider["Github"] = "github";
18
- OAuthProvider["Gitlab"] = "gitlab";
19
- OAuthProvider["Google"] = "google";
20
- OAuthProvider["Linkedin"] = "linkedin";
21
- OAuthProvider["Microsoft"] = "microsoft";
22
- OAuthProvider["Notion"] = "notion";
23
- OAuthProvider["Oidc"] = "oidc";
24
- OAuthProvider["Okta"] = "okta";
25
- OAuthProvider["Paypal"] = "paypal";
26
- OAuthProvider["PaypalSandbox"] = "paypalSandbox";
27
- OAuthProvider["Podio"] = "podio";
28
- OAuthProvider["Salesforce"] = "salesforce";
29
- OAuthProvider["Slack"] = "slack";
30
- OAuthProvider["Spotify"] = "spotify";
31
- OAuthProvider["Stripe"] = "stripe";
32
- OAuthProvider["Tradeshift"] = "tradeshift";
33
- OAuthProvider["TradeshiftBox"] = "tradeshiftBox";
34
- OAuthProvider["Twitch"] = "twitch";
35
- OAuthProvider["Wordpress"] = "wordpress";
36
- OAuthProvider["Yahoo"] = "yahoo";
37
- OAuthProvider["Yammer"] = "yammer";
38
- OAuthProvider["Yandex"] = "yandex";
39
- OAuthProvider["Zoho"] = "zoho";
40
- OAuthProvider["Zoom"] = "zoom";
41
- OAuthProvider["Mock"] = "mock";
42
- })(OAuthProvider || (OAuthProvider = {}));