@revisium/endpoint 0.9.0

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 (190) hide show
  1. package/LICENSE +204 -0
  2. package/README.md +9 -0
  3. package/dist/endpoint-microservice/commands/handlers/base-endpoint.handler.d.ts +6 -0
  4. package/dist/endpoint-microservice/commands/handlers/base-endpoint.handler.js +17 -0
  5. package/dist/endpoint-microservice/commands/handlers/base-endpoint.handler.js.map +1 -0
  6. package/dist/endpoint-microservice/commands/handlers/create-endpoint.handler.d.ts +10 -0
  7. package/dist/endpoint-microservice/commands/handlers/create-endpoint.handler.js +41 -0
  8. package/dist/endpoint-microservice/commands/handlers/create-endpoint.handler.js.map +1 -0
  9. package/dist/endpoint-microservice/commands/handlers/delete-endpoint.handler.d.ts +10 -0
  10. package/dist/endpoint-microservice/commands/handlers/delete-endpoint.handler.js +40 -0
  11. package/dist/endpoint-microservice/commands/handlers/delete-endpoint.handler.js.map +1 -0
  12. package/dist/endpoint-microservice/commands/handlers/index.d.ts +5 -0
  13. package/dist/endpoint-microservice/commands/handlers/index.js +14 -0
  14. package/dist/endpoint-microservice/commands/handlers/index.js.map +1 -0
  15. package/dist/endpoint-microservice/commands/handlers/run-all-endpoints.handler.d.ts +16 -0
  16. package/dist/endpoint-microservice/commands/handlers/run-all-endpoints.handler.js +44 -0
  17. package/dist/endpoint-microservice/commands/handlers/run-all-endpoints.handler.js.map +1 -0
  18. package/dist/endpoint-microservice/commands/handlers/update-endpoint.handler.d.ts +10 -0
  19. package/dist/endpoint-microservice/commands/handlers/update-endpoint.handler.js +41 -0
  20. package/dist/endpoint-microservice/commands/handlers/update-endpoint.handler.js.map +1 -0
  21. package/dist/endpoint-microservice/commands/impl/create-endpoint.command.d.ts +4 -0
  22. package/dist/endpoint-microservice/commands/impl/create-endpoint.command.js +10 -0
  23. package/dist/endpoint-microservice/commands/impl/create-endpoint.command.js.map +1 -0
  24. package/dist/endpoint-microservice/commands/impl/delete-endpoint.command.d.ts +6 -0
  25. package/dist/endpoint-microservice/commands/impl/delete-endpoint.command.js +11 -0
  26. package/dist/endpoint-microservice/commands/impl/delete-endpoint.command.js.map +1 -0
  27. package/dist/endpoint-microservice/commands/impl/index.d.ts +3 -0
  28. package/dist/endpoint-microservice/commands/impl/index.js +20 -0
  29. package/dist/endpoint-microservice/commands/impl/index.js.map +1 -0
  30. package/dist/endpoint-microservice/commands/impl/run-all-endpoints.command.d.ts +3 -0
  31. package/dist/endpoint-microservice/commands/impl/run-all-endpoints.command.js +8 -0
  32. package/dist/endpoint-microservice/commands/impl/run-all-endpoints.command.js.map +1 -0
  33. package/dist/endpoint-microservice/commands/impl/update-endpoint.command.d.ts +4 -0
  34. package/dist/endpoint-microservice/commands/impl/update-endpoint.command.js +10 -0
  35. package/dist/endpoint-microservice/commands/impl/update-endpoint.command.js.map +1 -0
  36. package/dist/endpoint-microservice/core-api/core-api.module.d.ts +2 -0
  37. package/dist/endpoint-microservice/core-api/core-api.module.js +25 -0
  38. package/dist/endpoint-microservice/core-api/core-api.module.js.map +1 -0
  39. package/dist/endpoint-microservice/core-api/generated/api.d.ts +390 -0
  40. package/dist/endpoint-microservice/core-api/generated/api.js +550 -0
  41. package/dist/endpoint-microservice/core-api/generated/api.js.map +1 -0
  42. package/dist/endpoint-microservice/core-api/internal-core-api.service.d.ts +13 -0
  43. package/dist/endpoint-microservice/core-api/internal-core-api.service.js +87 -0
  44. package/dist/endpoint-microservice/core-api/internal-core-api.service.js.map +1 -0
  45. package/dist/endpoint-microservice/core-api/proxy-core-api.service.d.ts +5 -0
  46. package/dist/endpoint-microservice/core-api/proxy-core-api.service.js +32 -0
  47. package/dist/endpoint-microservice/core-api/proxy-core-api.service.js.map +1 -0
  48. package/dist/endpoint-microservice/core-api/utils/transformFromPrismaToRowModel.d.ts +4 -0
  49. package/dist/endpoint-microservice/core-api/utils/transformFromPrismaToRowModel.js +24 -0
  50. package/dist/endpoint-microservice/core-api/utils/transformFromPrismaToRowModel.js.map +1 -0
  51. package/dist/endpoint-microservice/database/database.module.d.ts +2 -0
  52. package/dist/endpoint-microservice/database/database.module.js +21 -0
  53. package/dist/endpoint-microservice/database/database.module.js.map +1 -0
  54. package/dist/endpoint-microservice/database/prisma.service.d.ts +5 -0
  55. package/dist/endpoint-microservice/database/prisma.service.js +21 -0
  56. package/dist/endpoint-microservice/database/prisma.service.js.map +1 -0
  57. package/dist/endpoint-microservice/endpoint-listener.controller.d.ts +12 -0
  58. package/dist/endpoint-microservice/endpoint-listener.controller.js +54 -0
  59. package/dist/endpoint-microservice/endpoint-listener.controller.js.map +1 -0
  60. package/dist/endpoint-microservice/endpoint-microservice.module.d.ts +9 -0
  61. package/dist/endpoint-microservice/endpoint-microservice.module.js +58 -0
  62. package/dist/endpoint-microservice/endpoint-microservice.module.js.map +1 -0
  63. package/dist/endpoint-microservice/graphql/commands/handlers/create-graphql-endpoint.handler.d.ts +8 -0
  64. package/dist/endpoint-microservice/graphql/commands/handlers/create-graphql-endpoint.handler.js +32 -0
  65. package/dist/endpoint-microservice/graphql/commands/handlers/create-graphql-endpoint.handler.js.map +1 -0
  66. package/dist/endpoint-microservice/graphql/commands/handlers/delete-graphql-endpoint.handler.d.ts +8 -0
  67. package/dist/endpoint-microservice/graphql/commands/handlers/delete-graphql-endpoint.handler.js +32 -0
  68. package/dist/endpoint-microservice/graphql/commands/handlers/delete-graphql-endpoint.handler.js.map +1 -0
  69. package/dist/endpoint-microservice/graphql/commands/handlers/index.d.ts +4 -0
  70. package/dist/endpoint-microservice/graphql/commands/handlers/index.js +12 -0
  71. package/dist/endpoint-microservice/graphql/commands/handlers/index.js.map +1 -0
  72. package/dist/endpoint-microservice/graphql/commands/handlers/update-graphql-endpoint.handler.d.ts +8 -0
  73. package/dist/endpoint-microservice/graphql/commands/handlers/update-graphql-endpoint.handler.js +33 -0
  74. package/dist/endpoint-microservice/graphql/commands/handlers/update-graphql-endpoint.handler.js.map +1 -0
  75. package/dist/endpoint-microservice/graphql/commands/impl/create-graphql-endpoint.command.d.ts +4 -0
  76. package/dist/endpoint-microservice/graphql/commands/impl/create-graphql-endpoint.command.js +10 -0
  77. package/dist/endpoint-microservice/graphql/commands/impl/create-graphql-endpoint.command.js.map +1 -0
  78. package/dist/endpoint-microservice/graphql/commands/impl/delete-graphql-endpoint.command.d.ts +4 -0
  79. package/dist/endpoint-microservice/graphql/commands/impl/delete-graphql-endpoint.command.js +10 -0
  80. package/dist/endpoint-microservice/graphql/commands/impl/delete-graphql-endpoint.command.js.map +1 -0
  81. package/dist/endpoint-microservice/graphql/commands/impl/index.d.ts +4 -0
  82. package/dist/endpoint-microservice/graphql/commands/impl/index.js +21 -0
  83. package/dist/endpoint-microservice/graphql/commands/impl/index.js.map +1 -0
  84. package/dist/endpoint-microservice/graphql/commands/impl/update-graphql-endpoint.command.d.ts +4 -0
  85. package/dist/endpoint-microservice/graphql/commands/impl/update-graphql-endpoint.command.js +10 -0
  86. package/dist/endpoint-microservice/graphql/commands/impl/update-graphql-endpoint.command.js.map +1 -0
  87. package/dist/endpoint-microservice/graphql/graphql-endpoint.controller.d.ts +9 -0
  88. package/dist/endpoint-microservice/graphql/graphql-endpoint.controller.js +85 -0
  89. package/dist/endpoint-microservice/graphql/graphql-endpoint.controller.js.map +1 -0
  90. package/dist/endpoint-microservice/graphql/graphql-endpoint.service.d.ts +20 -0
  91. package/dist/endpoint-microservice/graphql/graphql-endpoint.service.js +138 -0
  92. package/dist/endpoint-microservice/graphql/graphql-endpoint.service.js.map +1 -0
  93. package/dist/endpoint-microservice/graphql/graphql.module.d.ts +2 -0
  94. package/dist/endpoint-microservice/graphql/graphql.module.js +28 -0
  95. package/dist/endpoint-microservice/graphql/graphql.module.js.map +1 -0
  96. package/dist/endpoint-microservice/graphql/index.d.ts +1 -0
  97. package/dist/endpoint-microservice/graphql/index.js +18 -0
  98. package/dist/endpoint-microservice/graphql/index.js.map +1 -0
  99. package/dist/endpoint-microservice/graphql/queries/handlers/get-graphql-schema.handler.d.ts +26 -0
  100. package/dist/endpoint-microservice/graphql/queries/handlers/get-graphql-schema.handler.js +234 -0
  101. package/dist/endpoint-microservice/graphql/queries/handlers/get-graphql-schema.handler.js.map +1 -0
  102. package/dist/endpoint-microservice/graphql/queries/handlers/index.d.ts +2 -0
  103. package/dist/endpoint-microservice/graphql/queries/handlers/index.js +6 -0
  104. package/dist/endpoint-microservice/graphql/queries/handlers/index.js.map +1 -0
  105. package/dist/endpoint-microservice/graphql/queries/impl/get-graphql-schema.query.d.ts +8 -0
  106. package/dist/endpoint-microservice/graphql/queries/impl/get-graphql-schema.query.js +10 -0
  107. package/dist/endpoint-microservice/graphql/queries/impl/get-graphql-schema.query.js.map +1 -0
  108. package/dist/endpoint-microservice/graphql/queries/impl/index.d.ts +1 -0
  109. package/dist/endpoint-microservice/graphql/queries/impl/index.js +18 -0
  110. package/dist/endpoint-microservice/graphql/queries/impl/index.js.map +1 -0
  111. package/dist/endpoint-microservice/graphql/queries/types/index.d.ts +0 -0
  112. package/dist/endpoint-microservice/graphql/queries/types/index.js +1 -0
  113. package/dist/endpoint-microservice/graphql/queries/types/index.js.map +1 -0
  114. package/dist/endpoint-microservice/restapi/commands/handlers/create-restapi-endpoint.handler.d.ts +8 -0
  115. package/dist/endpoint-microservice/restapi/commands/handlers/create-restapi-endpoint.handler.js +32 -0
  116. package/dist/endpoint-microservice/restapi/commands/handlers/create-restapi-endpoint.handler.js.map +1 -0
  117. package/dist/endpoint-microservice/restapi/commands/handlers/delete-restapi-endpoint.handler.d.ts +8 -0
  118. package/dist/endpoint-microservice/restapi/commands/handlers/delete-restapi-endpoint.handler.js +32 -0
  119. package/dist/endpoint-microservice/restapi/commands/handlers/delete-restapi-endpoint.handler.js.map +1 -0
  120. package/dist/endpoint-microservice/restapi/commands/handlers/index.d.ts +4 -0
  121. package/dist/endpoint-microservice/restapi/commands/handlers/index.js +12 -0
  122. package/dist/endpoint-microservice/restapi/commands/handlers/index.js.map +1 -0
  123. package/dist/endpoint-microservice/restapi/commands/handlers/update-restapi-endpoint.handler.d.ts +8 -0
  124. package/dist/endpoint-microservice/restapi/commands/handlers/update-restapi-endpoint.handler.js +33 -0
  125. package/dist/endpoint-microservice/restapi/commands/handlers/update-restapi-endpoint.handler.js.map +1 -0
  126. package/dist/endpoint-microservice/restapi/commands/impl/create-restapi-endpoint.command.d.ts +4 -0
  127. package/dist/endpoint-microservice/restapi/commands/impl/create-restapi-endpoint.command.js +10 -0
  128. package/dist/endpoint-microservice/restapi/commands/impl/create-restapi-endpoint.command.js.map +1 -0
  129. package/dist/endpoint-microservice/restapi/commands/impl/delete-restapi-endpoint.command.d.ts +4 -0
  130. package/dist/endpoint-microservice/restapi/commands/impl/delete-restapi-endpoint.command.js +10 -0
  131. package/dist/endpoint-microservice/restapi/commands/impl/delete-restapi-endpoint.command.js.map +1 -0
  132. package/dist/endpoint-microservice/restapi/commands/impl/index.d.ts +3 -0
  133. package/dist/endpoint-microservice/restapi/commands/impl/index.js +20 -0
  134. package/dist/endpoint-microservice/restapi/commands/impl/index.js.map +1 -0
  135. package/dist/endpoint-microservice/restapi/commands/impl/update-restapi-endpoint.command.d.ts +4 -0
  136. package/dist/endpoint-microservice/restapi/commands/impl/update-restapi-endpoint.command.js +10 -0
  137. package/dist/endpoint-microservice/restapi/commands/impl/update-restapi-endpoint.command.js.map +1 -0
  138. package/dist/endpoint-microservice/restapi/index.d.ts +1 -0
  139. package/dist/endpoint-microservice/restapi/index.js +18 -0
  140. package/dist/endpoint-microservice/restapi/index.js.map +1 -0
  141. package/dist/endpoint-microservice/restapi/queries/handlers/get-open-api-schema.handler.d.ts +12 -0
  142. package/dist/endpoint-microservice/restapi/queries/handlers/get-open-api-schema.handler.js +396 -0
  143. package/dist/endpoint-microservice/restapi/queries/handlers/get-open-api-schema.handler.js.map +1 -0
  144. package/dist/endpoint-microservice/restapi/queries/handlers/index.d.ts +2 -0
  145. package/dist/endpoint-microservice/restapi/queries/handlers/index.js +6 -0
  146. package/dist/endpoint-microservice/restapi/queries/handlers/index.js.map +1 -0
  147. package/dist/endpoint-microservice/restapi/queries/impl/get-open-api-schema.query.d.ts +8 -0
  148. package/dist/endpoint-microservice/restapi/queries/impl/get-open-api-schema.query.js +10 -0
  149. package/dist/endpoint-microservice/restapi/queries/impl/get-open-api-schema.query.js.map +1 -0
  150. package/dist/endpoint-microservice/restapi/queries/impl/index.d.ts +1 -0
  151. package/dist/endpoint-microservice/restapi/queries/impl/index.js +18 -0
  152. package/dist/endpoint-microservice/restapi/queries/impl/index.js.map +1 -0
  153. package/dist/endpoint-microservice/restapi/restapi-endpoint.controller.d.ts +12 -0
  154. package/dist/endpoint-microservice/restapi/restapi-endpoint.controller.js +170 -0
  155. package/dist/endpoint-microservice/restapi/restapi-endpoint.controller.js.map +1 -0
  156. package/dist/endpoint-microservice/restapi/restapi-endpoint.service.d.ts +36 -0
  157. package/dist/endpoint-microservice/restapi/restapi-endpoint.service.js +173 -0
  158. package/dist/endpoint-microservice/restapi/restapi-endpoint.service.js.map +1 -0
  159. package/dist/endpoint-microservice/restapi/restapi.module.d.ts +2 -0
  160. package/dist/endpoint-microservice/restapi/restapi.module.js +33 -0
  161. package/dist/endpoint-microservice/restapi/restapi.module.js.map +1 -0
  162. package/dist/endpoint-microservice/restapi/swagger-endpoint.controller.d.ts +8 -0
  163. package/dist/endpoint-microservice/restapi/swagger-endpoint.controller.js +98 -0
  164. package/dist/endpoint-microservice/restapi/swagger-endpoint.controller.js.map +1 -0
  165. package/dist/endpoint-microservice/shared/default-port.d.ts +1 -0
  166. package/dist/endpoint-microservice/shared/default-port.js +5 -0
  167. package/dist/endpoint-microservice/shared/default-port.js.map +1 -0
  168. package/dist/endpoint-microservice/shared/types/json-schema-type.d.ts +24 -0
  169. package/dist/endpoint-microservice/shared/types/json-schema-type.js +3 -0
  170. package/dist/endpoint-microservice/shared/types/json-schema-type.js.map +1 -0
  171. package/dist/endpoint-microservice/shared/types/open-api-schema.d.ts +2 -0
  172. package/dist/endpoint-microservice/shared/types/open-api-schema.js +3 -0
  173. package/dist/endpoint-microservice/shared/types/open-api-schema.js.map +1 -0
  174. package/dist/endpoint-microservice/shared/types/pagination.interface.d.ts +15 -0
  175. package/dist/endpoint-microservice/shared/types/pagination.interface.js +3 -0
  176. package/dist/endpoint-microservice/shared/types/pagination.interface.js.map +1 -0
  177. package/dist/endpoint-microservice/shared/utils/getOffsetPagination.d.ts +18 -0
  178. package/dist/endpoint-microservice/shared/utils/getOffsetPagination.js +45 -0
  179. package/dist/endpoint-microservice/shared/utils/getOffsetPagination.js.map +1 -0
  180. package/dist/endpoint-microservice/shared/utils/parseHeaders.d.ts +3 -0
  181. package/dist/endpoint-microservice/shared/utils/parseHeaders.js +12 -0
  182. package/dist/endpoint-microservice/shared/utils/parseHeaders.js.map +1 -0
  183. package/dist/index.d.ts +1 -0
  184. package/dist/index.js +6 -0
  185. package/dist/index.js.map +1 -0
  186. package/dist/main.d.ts +1 -0
  187. package/dist/main.js +33 -0
  188. package/dist/main.js.map +1 -0
  189. package/dist/tsconfig.build.tsbuildinfo +1 -0
  190. package/package.json +100 -0
@@ -0,0 +1,2 @@
1
+ export declare class CoreApiModule {
2
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.CoreApiModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const config_1 = require("@nestjs/config");
12
+ const internal_core_api_service_1 = require("./internal-core-api.service");
13
+ const proxy_core_api_service_1 = require("./proxy-core-api.service");
14
+ const database_module_1 = require("../database/database.module");
15
+ let CoreApiModule = class CoreApiModule {
16
+ };
17
+ exports.CoreApiModule = CoreApiModule;
18
+ exports.CoreApiModule = CoreApiModule = __decorate([
19
+ (0, common_1.Module)({
20
+ imports: [config_1.ConfigModule, database_module_1.DatabaseModule],
21
+ providers: [internal_core_api_service_1.InternalCoreApiService, proxy_core_api_service_1.ProxyCoreApiService],
22
+ exports: [internal_core_api_service_1.InternalCoreApiService, proxy_core_api_service_1.ProxyCoreApiService],
23
+ })
24
+ ], CoreApiModule);
25
+ //# sourceMappingURL=core-api.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-api.module.js","sourceRoot":"","sources":["../../../src/endpoint-microservice/core-api/core-api.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA8C;AAC9C,2EAAsG;AACtG,qEAAgG;AAChG,iEAAoF;AAO7E,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IALzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,qBAAY,EAAE,gCAAc,CAAC;QACvC,SAAS,EAAE,CAAC,kDAAsB,EAAE,4CAAmB,CAAC;QACxD,OAAO,EAAE,CAAC,kDAAsB,EAAE,4CAAmB,CAAC;KACvD,CAAC;GACW,aAAa,CAAG"}
@@ -0,0 +1,390 @@
1
+ export interface LoginDto {
2
+ emailOrUsername: string;
3
+ password: string;
4
+ }
5
+ export interface LoginResponse {
6
+ accessToken: string;
7
+ }
8
+ export interface CreateUserDto {
9
+ email?: string;
10
+ username?: string;
11
+ roleId: 'systemAdmin' | 'systemFullApiRead' | 'systemUser';
12
+ password: string;
13
+ }
14
+ export interface ProjectModel {
15
+ id: string;
16
+ organizationId: string;
17
+ createdAt: string;
18
+ name: string;
19
+ }
20
+ export interface ProjectModelEdgeType {
21
+ cursor: string;
22
+ node: ProjectModel;
23
+ }
24
+ export interface PageInfo {
25
+ endCursor?: string;
26
+ hasNextPage: boolean;
27
+ hasPreviousPage: boolean;
28
+ startCursor?: string;
29
+ }
30
+ export interface ProjectsConnection {
31
+ edges: ProjectModelEdgeType[];
32
+ totalCount: number;
33
+ pageInfo: PageInfo;
34
+ }
35
+ export interface CreateProjectDto {
36
+ projectName: string;
37
+ branchName?: string;
38
+ }
39
+ export interface UserModel {
40
+ id: string;
41
+ username?: string;
42
+ }
43
+ export interface RoleModel {
44
+ id: string;
45
+ name: string;
46
+ }
47
+ export interface UsersOrganizationModel {
48
+ id: string;
49
+ user: UserModel;
50
+ role: RoleModel;
51
+ }
52
+ export interface UsersOrganizationModelEdgeType {
53
+ cursor: string;
54
+ node: UsersOrganizationModel;
55
+ }
56
+ export interface UsersOrganizationConnection {
57
+ edges: UsersOrganizationModelEdgeType[];
58
+ totalCount: number;
59
+ pageInfo: PageInfo;
60
+ }
61
+ export interface AddUserToOrganizationDto {
62
+ userId: string;
63
+ roleId: 'organizationOwner' | 'organizationAdmin' | 'developer' | 'editor' | 'reader';
64
+ }
65
+ export interface RemoveUserFromOrganizationDto {
66
+ userId: string;
67
+ }
68
+ export interface BranchModel {
69
+ id: string;
70
+ projectId: string;
71
+ createdAt: string;
72
+ isRoot: boolean;
73
+ name: string;
74
+ }
75
+ export interface BranchModelEdgeType {
76
+ cursor: string;
77
+ node: BranchModel;
78
+ }
79
+ export interface BranchesConnection {
80
+ edges: BranchModelEdgeType[];
81
+ totalCount: number;
82
+ pageInfo: PageInfo;
83
+ }
84
+ export interface UsersProjectModel {
85
+ id: string;
86
+ user: UserModel;
87
+ role: RoleModel;
88
+ }
89
+ export interface UsersProjectModelEdgeType {
90
+ cursor: string;
91
+ node: UsersProjectModel;
92
+ }
93
+ export interface UsersProjectConnection {
94
+ edges: UsersProjectModelEdgeType[];
95
+ totalCount: number;
96
+ pageInfo: PageInfo;
97
+ }
98
+ export interface AddUserToProjectDto {
99
+ userId: string;
100
+ roleId: 'developer' | 'editor' | 'reader';
101
+ }
102
+ export interface Id {
103
+ id: string;
104
+ }
105
+ export interface ParentBranchResponse {
106
+ branch: Id;
107
+ revision: Id;
108
+ }
109
+ export interface RevisionModel {
110
+ id: string;
111
+ createdAt: string;
112
+ isDraft: boolean;
113
+ isHead: boolean;
114
+ }
115
+ export interface RevisionModelEdgeType {
116
+ cursor: string;
117
+ node: RevisionModel;
118
+ }
119
+ export interface RevisionsConnection {
120
+ edges: RevisionModelEdgeType[];
121
+ totalCount: number;
122
+ pageInfo: PageInfo;
123
+ }
124
+ export interface CreateRevisionDto {
125
+ comment?: string;
126
+ }
127
+ export interface ChildBranchResponse {
128
+ branch: Id;
129
+ revision: Id;
130
+ }
131
+ export interface TableModel {
132
+ versionId: string;
133
+ id: string;
134
+ createdAt: string;
135
+ readonly: boolean;
136
+ }
137
+ export interface TableModelEdgeType {
138
+ cursor: string;
139
+ node: TableModel;
140
+ }
141
+ export interface TablesConnection {
142
+ edges: TableModelEdgeType[];
143
+ totalCount: number;
144
+ pageInfo: PageInfo;
145
+ }
146
+ export interface EndpointModel {
147
+ id: string;
148
+ createdAt: string;
149
+ type: 'GRAPHQL' | 'REST_API';
150
+ }
151
+ export interface CreateBranchByRevisionDto {
152
+ branchName: string;
153
+ }
154
+ export interface CreateEndpointDto {
155
+ type: 'GRAPHQL' | 'REST_API';
156
+ }
157
+ export interface CreateTableDto {
158
+ tableId: string;
159
+ schema: object;
160
+ }
161
+ export interface CreateTableResponse {
162
+ branch: BranchModel;
163
+ table: TableModel;
164
+ }
165
+ export interface RowModel {
166
+ versionId: string;
167
+ id: string;
168
+ createdAt: string;
169
+ readonly: boolean;
170
+ data: object;
171
+ }
172
+ export interface RowModelEdgeType {
173
+ cursor: string;
174
+ node: RowModel;
175
+ }
176
+ export interface RowsConnection {
177
+ edges: RowModelEdgeType[];
178
+ totalCount: number;
179
+ pageInfo: PageInfo;
180
+ }
181
+ export interface CreateRowDto {
182
+ rowId: string;
183
+ data: object;
184
+ }
185
+ export interface CreateRowResponse {
186
+ table: TableModel;
187
+ previousVersionTableId: string;
188
+ row: RowModel;
189
+ }
190
+ export interface UpdateTableDto {
191
+ patches: object[];
192
+ }
193
+ export interface UpdateTableResponse {
194
+ table?: TableModel;
195
+ previousVersionTableId: string;
196
+ }
197
+ export interface RemoveRowResponse {
198
+ branch: BranchModel;
199
+ table?: TableModel;
200
+ previousVersionTableId?: string;
201
+ }
202
+ export interface UpdateRowDto {
203
+ data: object;
204
+ }
205
+ export interface UpdateRowResponse {
206
+ table?: TableModel;
207
+ previousVersionTableId?: string;
208
+ row?: RowModel;
209
+ previousVersionRowId?: string;
210
+ }
211
+ export interface ProjectsParams {
212
+ first: number;
213
+ after?: string;
214
+ organizationId: string;
215
+ }
216
+ export interface CreateProjectParams {
217
+ fromRevisionId: string;
218
+ organizationId: string;
219
+ }
220
+ export interface UsersOrganizationParams {
221
+ first: number;
222
+ after?: string;
223
+ organizationId: string;
224
+ }
225
+ export interface BranchesParams {
226
+ first: number;
227
+ after?: string;
228
+ organizationId: string;
229
+ projectName: string;
230
+ }
231
+ export interface UsersProjectParams {
232
+ first: number;
233
+ after?: string;
234
+ organizationId: string;
235
+ projectName: string;
236
+ }
237
+ export interface RevisionsParams {
238
+ first: number;
239
+ after?: string;
240
+ before?: string;
241
+ organizationId: string;
242
+ projectName: string;
243
+ branchName: string;
244
+ }
245
+ export interface TablesParams {
246
+ first: number;
247
+ after?: string;
248
+ revisionId: string;
249
+ }
250
+ export interface RowsParams {
251
+ first: number;
252
+ after?: string;
253
+ revisionId: string;
254
+ tableId: string;
255
+ }
256
+ export interface TableReferencesByParams {
257
+ first: number;
258
+ after?: string;
259
+ revisionId: string;
260
+ tableId: string;
261
+ }
262
+ export interface TableReferencesToParams {
263
+ first: number;
264
+ after?: string;
265
+ revisionId: string;
266
+ tableId: string;
267
+ }
268
+ export interface RowReferencesByParams {
269
+ referenceByTableId: string;
270
+ first: number;
271
+ after?: string;
272
+ revisionId: string;
273
+ tableId: string;
274
+ rowId: string;
275
+ }
276
+ export interface RowReferencesToParams {
277
+ referenceToTableId: string;
278
+ first: number;
279
+ after?: string;
280
+ revisionId: string;
281
+ tableId: string;
282
+ rowId: string;
283
+ }
284
+ export type QueryParamsType = Record<string | number, any>;
285
+ export type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;
286
+ export interface FullRequestParams extends Omit<RequestInit, 'body'> {
287
+ secure?: boolean;
288
+ path: string;
289
+ type?: ContentType;
290
+ query?: QueryParamsType;
291
+ format?: ResponseFormat;
292
+ body?: unknown;
293
+ baseUrl?: string;
294
+ cancelToken?: CancelToken;
295
+ }
296
+ export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
297
+ export interface ApiConfig<SecurityDataType = unknown> {
298
+ baseUrl?: string;
299
+ baseApiParams?: Omit<RequestParams, 'baseUrl' | 'cancelToken' | 'signal'>;
300
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
301
+ customFetch?: typeof fetch;
302
+ }
303
+ export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
304
+ data: D;
305
+ error: E;
306
+ }
307
+ type CancelToken = Symbol | string | number;
308
+ export declare enum ContentType {
309
+ Json = "application/json",
310
+ FormData = "multipart/form-data",
311
+ UrlEncoded = "application/x-www-form-urlencoded",
312
+ Text = "text/plain"
313
+ }
314
+ export declare class HttpClient<SecurityDataType = unknown> {
315
+ baseUrl: string;
316
+ private securityData;
317
+ private securityWorker?;
318
+ private abortControllers;
319
+ private customFetch;
320
+ private baseApiParams;
321
+ constructor(apiConfig?: ApiConfig<SecurityDataType>);
322
+ setSecurityData: (data: SecurityDataType | null) => void;
323
+ protected encodeQueryParam(key: string, value: any): string;
324
+ protected addQueryParam(query: QueryParamsType, key: string): string;
325
+ protected addArrayQueryParam(query: QueryParamsType, key: string): any;
326
+ protected toQueryString(rawQuery?: QueryParamsType): string;
327
+ protected addQueryParams(rawQuery?: QueryParamsType): string;
328
+ private contentFormatters;
329
+ protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams;
330
+ protected createAbortSignal: (cancelToken: CancelToken) => AbortSignal | undefined;
331
+ abortRequest: (cancelToken: CancelToken) => void;
332
+ request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<T>;
333
+ }
334
+ export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
335
+ login: (data: LoginDto, params?: RequestParams) => Promise<LoginResponse>;
336
+ createUser: (data: CreateUserDto, params?: RequestParams) => Promise<boolean>;
337
+ projects: ({ organizationId, ...query }: ProjectsParams, params?: RequestParams) => Promise<ProjectsConnection>;
338
+ createProject: ({ organizationId, ...query }: CreateProjectParams, data: CreateProjectDto, params?: RequestParams) => Promise<ProjectModel>;
339
+ usersOrganization: ({ organizationId, ...query }: UsersOrganizationParams, params?: RequestParams) => Promise<UsersOrganizationConnection>;
340
+ addUserToOrganization: (organizationId: string, data: AddUserToOrganizationDto, params?: RequestParams) => Promise<boolean>;
341
+ removeUserFromOrganization: (organizationId: string, data: RemoveUserFromOrganizationDto, params?: RequestParams) => Promise<boolean>;
342
+ project: (organizationId: string, projectName: string, params?: RequestParams) => Promise<ProjectModel>;
343
+ deleteProject: (organizationId: string, projectName: string, params?: RequestParams) => Promise<boolean>;
344
+ rootBranch: (organizationId: string, projectName: string, params?: RequestParams) => Promise<BranchModel>;
345
+ branches: ({ organizationId, projectName, ...query }: BranchesParams, params?: RequestParams) => Promise<BranchesConnection>;
346
+ usersProject: ({ organizationId, projectName, ...query }: UsersProjectParams, params?: RequestParams) => Promise<UsersProjectConnection>;
347
+ addUserToProject: (organizationId: string, projectName: string, data: AddUserToProjectDto, params?: RequestParams) => Promise<boolean>;
348
+ removeUserFromProject: (organizationId: string, projectName: string, userId: string, params?: RequestParams) => Promise<boolean>;
349
+ branch: (organizationId: string, projectName: string, branchName: string, params?: RequestParams) => Promise<BranchModel>;
350
+ branchTouched: (organizationId: string, projectName: string, branchName: string, params?: RequestParams) => Promise<boolean>;
351
+ parentBranch: (organizationId: string, projectName: string, branchName: string, params?: RequestParams) => Promise<ParentBranchResponse>;
352
+ startRevision: (organizationId: string, projectName: string, branchName: string, params?: RequestParams) => Promise<RevisionModel>;
353
+ headRevision: (organizationId: string, projectName: string, branchName: string, params?: RequestParams) => Promise<RevisionModel>;
354
+ draftRevision: (organizationId: string, projectName: string, branchName: string, params?: RequestParams) => Promise<RevisionModel>;
355
+ revisions: ({ organizationId, projectName, branchName, ...query }: RevisionsParams, params?: RequestParams) => Promise<RevisionsConnection>;
356
+ createRevision: (organizationId: string, projectName: string, branchName: string, data: CreateRevisionDto, params?: RequestParams) => Promise<RevisionModel>;
357
+ revertChanges: (organizationId: string, projectName: string, branchName: string, params?: RequestParams) => Promise<BranchModel>;
358
+ revision: (revisionId: string, params?: RequestParams) => Promise<RevisionModel>;
359
+ parentRevision: (revisionId: string, params?: RequestParams) => Promise<RevisionModel>;
360
+ childRevision: (revisionId: string, params?: RequestParams) => Promise<RevisionModel>;
361
+ childBranches: (revisionId: string, params?: RequestParams) => Promise<ChildBranchResponse[]>;
362
+ createBranch: (revisionId: string, data: CreateBranchByRevisionDto, params?: RequestParams) => Promise<BranchModel>;
363
+ tables: ({ revisionId, ...query }: TablesParams, params?: RequestParams) => Promise<TablesConnection>;
364
+ createTable: (revisionId: string, data: CreateTableDto, params?: RequestParams) => Promise<CreateTableResponse>;
365
+ endpoints: (revisionId: string, params?: RequestParams) => Promise<EndpointModel[]>;
366
+ createEndpoint: (revisionId: string, data: CreateEndpointDto, params?: RequestParams) => Promise<EndpointModel>;
367
+ table: (revisionId: string, tableId: string, params?: RequestParams) => Promise<TableModel>;
368
+ deleteTable: (revisionId: string, tableId: string, params?: RequestParams) => Promise<BranchModel>;
369
+ updateTable: (revisionId: string, tableId: string, data: UpdateTableDto, params?: RequestParams) => Promise<UpdateTableResponse>;
370
+ tableCountRows: (revisionId: string, tableId: string, params?: RequestParams) => Promise<number>;
371
+ rows: ({ revisionId, tableId, ...query }: RowsParams, params?: RequestParams) => Promise<RowsConnection>;
372
+ createRow: (revisionId: string, tableId: string, data: CreateRowDto, params?: RequestParams) => Promise<CreateRowResponse>;
373
+ tableSchema: (revisionId: string, tableId: string, params?: RequestParams) => Promise<object>;
374
+ tableCountReferencesBy: (revisionId: string, tableId: string, params?: RequestParams) => Promise<number>;
375
+ tableReferencesBy: ({ revisionId, tableId, ...query }: TableReferencesByParams, params?: RequestParams) => Promise<TablesConnection>;
376
+ tableCountReferencesTo: (revisionId: string, tableId: string, params?: RequestParams) => Promise<number>;
377
+ tableReferencesTo: ({ revisionId, tableId, ...query }: TableReferencesToParams, params?: RequestParams) => Promise<TablesConnection>;
378
+ row: (revisionId: string, tableId: string, rowId: string, params?: RequestParams) => Promise<RowModel>;
379
+ deleteRow: (revisionId: string, tableId: string, rowId: string, params?: RequestParams) => Promise<RemoveRowResponse>;
380
+ updateRow: (revisionId: string, tableId: string, rowId: string, data: UpdateRowDto, params?: RequestParams) => Promise<UpdateRowResponse>;
381
+ rowCountReferencesBy: (revisionId: string, tableId: string, rowId: string, params?: RequestParams) => Promise<number>;
382
+ rowReferencesBy: ({ revisionId, tableId, rowId, ...query }: RowReferencesByParams, params?: RequestParams) => Promise<RowsConnection>;
383
+ rowCountReferencesTo: (revisionId: string, tableId: string, rowId: string, params?: RequestParams) => Promise<number>;
384
+ rowReferencesTo: ({ revisionId, tableId, rowId, ...query }: RowReferencesToParams, params?: RequestParams) => Promise<RowsConnection>;
385
+ deleteEndpoint: (endpointId: string, params?: RequestParams) => Promise<boolean>;
386
+ health: {
387
+ healthControllerGet: (params?: RequestParams) => Promise<void>;
388
+ };
389
+ }
390
+ export {};