@wenlarge/communication 1.0.8 → 1.1.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.
@@ -0,0 +1 @@
1
+ export declare const WORKFLOW_NODE_PROTO_PATH: string[];
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WORKFLOW_NODE_PROTO_PATH = void 0;
4
+ exports.WORKFLOW_NODE_PROTO_PATH = [
5
+ 'proto/workflow-node.proto',
6
+ ];
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v1.181.2
5
- // protoc v3.21.5
5
+ // protoc v6.33.1
6
6
  // source: auth.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.AUTH_SERVICE_NAME = exports.AUTH_PACKAGE_NAME = exports.protobufPackage = void 0;
@@ -0,0 +1,6 @@
1
+ export declare const protobufPackage = "common";
2
+ export interface PaginateRequest {
3
+ skip: number;
4
+ take: number;
5
+ }
6
+ export declare const COMMON_PACKAGE_NAME = "common";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v1.181.2
5
+ // protoc v6.33.1
6
+ // source: common.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.COMMON_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ exports.protobufPackage = "common";
11
+ exports.COMMON_PACKAGE_NAME = "common";
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v1.181.2
5
- // protoc v3.21.5
5
+ // protoc v6.33.1
6
6
  // source: google/protobuf/empty.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufPackage = void 0;
@@ -19,32 +19,34 @@ export interface UpdateProjectRequest {
19
19
  id: string;
20
20
  name: string;
21
21
  }
22
- export interface GetAllRequest {
23
- companyId: string;
22
+ export interface FindManyRequest {
23
+ skip: number;
24
+ take: number;
24
25
  }
25
- export interface GetAllResponse {
26
- projects: ProjectResponse[];
26
+ export interface FindManyResponse {
27
+ data: ProjectResponse[];
28
+ total: number;
27
29
  }
28
- export interface GetProjectByIdRequest {
30
+ export interface FindFirstRequest {
29
31
  id: string;
30
32
  }
31
- export interface GetProjectByIdResponse {
33
+ export interface FindFirstResponse {
32
34
  project?: ProjectResponse | undefined;
33
35
  }
34
36
  export declare const PROJECT_PACKAGE_NAME = "project";
35
37
  export interface ProjectServiceClient {
36
38
  create(request: CreateProjectRequest, metadata?: Metadata): Observable<ProjectResponse>;
37
- getAll(request: GetAllRequest, metadata?: Metadata): Observable<GetAllResponse>;
39
+ findMany(request: FindManyRequest, metadata?: Metadata): Observable<FindManyResponse>;
38
40
  delete(request: DeleteProjectRequest, metadata?: Metadata): Observable<Empty>;
39
41
  update(request: UpdateProjectRequest, metadata?: Metadata): Observable<ProjectResponse>;
40
- getById(request: GetProjectByIdRequest, metadata?: Metadata): Observable<GetProjectByIdResponse>;
42
+ findFirst(request: FindFirstRequest, metadata?: Metadata): Observable<FindFirstResponse>;
41
43
  }
42
44
  export interface ProjectServiceController {
43
45
  create(request: CreateProjectRequest, metadata?: Metadata): Promise<ProjectResponse> | Observable<ProjectResponse> | ProjectResponse;
44
- getAll(request: GetAllRequest, metadata?: Metadata): Promise<GetAllResponse> | Observable<GetAllResponse> | GetAllResponse;
46
+ findMany(request: FindManyRequest, metadata?: Metadata): Promise<FindManyResponse> | Observable<FindManyResponse> | FindManyResponse;
45
47
  delete(request: DeleteProjectRequest, metadata?: Metadata): void;
46
48
  update(request: UpdateProjectRequest, metadata?: Metadata): Promise<ProjectResponse> | Observable<ProjectResponse> | ProjectResponse;
47
- getById(request: GetProjectByIdRequest, metadata?: Metadata): Promise<GetProjectByIdResponse> | Observable<GetProjectByIdResponse> | GetProjectByIdResponse;
49
+ findFirst(request: FindFirstRequest, metadata?: Metadata): Promise<FindFirstResponse> | Observable<FindFirstResponse> | FindFirstResponse;
48
50
  }
49
51
  export declare function ProjectServiceControllerMethods(): (constructor: Function) => void;
50
52
  export declare const PROJECT_SERVICE_NAME = "ProjectService";
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v1.181.2
5
- // protoc v3.21.5
5
+ // protoc v6.33.1
6
6
  // source: project.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.PROJECT_SERVICE_NAME = exports.PROJECT_PACKAGE_NAME = exports.protobufPackage = void 0;
@@ -12,7 +12,7 @@ exports.protobufPackage = "project";
12
12
  exports.PROJECT_PACKAGE_NAME = "project";
13
13
  function ProjectServiceControllerMethods() {
14
14
  return function (constructor) {
15
- const grpcMethods = ["create", "getAll", "delete", "update", "getById"];
15
+ const grpcMethods = ["create", "findMany", "delete", "update", "findFirst"];
16
16
  for (const method of grpcMethods) {
17
17
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
18
18
  (0, microservices_1.GrpcMethod)("ProjectService", method)(constructor.prototype[method], method, descriptor);
@@ -10,6 +10,7 @@ export interface WorkflowResponse {
10
10
  id: string;
11
11
  name: string;
12
12
  companyId: string;
13
+ projectId: string;
13
14
  createdAt: string;
14
15
  updatedAt: string;
15
16
  }
@@ -20,14 +21,17 @@ export interface UpdateWorkflowRequest {
20
21
  id: string;
21
22
  name: string;
22
23
  }
23
- export interface GetAllWorkflowRequest {
24
- companyId: string;
24
+ export interface FindManyWorkflowRequest {
25
+ projectId: string;
26
+ skip: number;
27
+ take: number;
25
28
  }
26
- export interface GetAllWorkflowResponse {
27
- workflows: WorkflowResponse[];
29
+ export interface FindManyWorkflowResponse {
30
+ data: WorkflowResponse[];
31
+ total: number;
28
32
  }
29
33
  /** NODE SERVICE COMPS */
30
- export interface NodeCreateRequest {
34
+ export interface CreateWorkflowNodeRequest {
31
35
  workflowId: string;
32
36
  name: string;
33
37
  type: string;
@@ -38,7 +42,7 @@ export interface NodeCreateRequest {
38
42
  config: string;
39
43
  nextNodeIds: string[];
40
44
  }
41
- export interface NodeUpdateRequest {
45
+ export interface UpdateWorkflowNodeRequest {
42
46
  id: string;
43
47
  name: string;
44
48
  type: string;
@@ -49,22 +53,25 @@ export interface NodeUpdateRequest {
49
53
  outputSchema: string;
50
54
  config: string;
51
55
  }
52
- export interface NodeDeleteRequest {
56
+ export interface DeleteWorkflowNodeRequest {
53
57
  id: string;
54
58
  }
55
- export interface NodeGetAllRequest {
59
+ export interface FindManyWorkflowNodeRequest {
56
60
  workflowId: string;
61
+ skip: number;
62
+ take: number;
57
63
  }
58
- export interface NodeGetAllResponse {
59
- nodes: NodeResponse[];
64
+ export interface FindManyWorkflowNodeResponse {
65
+ data: WorkflowNodeResponse[];
66
+ total: number;
60
67
  }
61
- export interface NodeGetByIdRequest {
68
+ export interface FindFirstWorkflowNodeRequest {
62
69
  id: string;
63
70
  }
64
- export interface NodeGetByIdResponse {
65
- node?: NodeResponse | undefined;
71
+ export interface FindFirstWorkflowNodeResponse {
72
+ node?: WorkflowNodeResponse | undefined;
66
73
  }
67
- export interface NodeResponse {
74
+ export interface WorkflowNodeResponse {
68
75
  id: string;
69
76
  name: string;
70
77
  type: string;
@@ -80,25 +87,25 @@ export interface NodeResponse {
80
87
  export declare const WORKFLOW_PACKAGE_NAME = "workflow";
81
88
  export interface WorkflowServiceClient {
82
89
  create(request: CreateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
83
- getAll(request: GetAllWorkflowRequest, metadata?: Metadata): Observable<GetAllWorkflowResponse>;
90
+ findMany(request: FindManyWorkflowRequest, metadata?: Metadata): Observable<FindManyWorkflowResponse>;
84
91
  delete(request: DeleteWorkflowRequest, metadata?: Metadata): Observable<Empty>;
85
92
  update(request: UpdateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
86
- createNode(request: NodeCreateRequest, metadata?: Metadata): Observable<NodeResponse>;
87
- getAllNode(request: NodeGetAllRequest, metadata?: Metadata): Observable<NodeGetAllResponse>;
88
- getByIdNode(request: NodeGetByIdRequest, metadata?: Metadata): Observable<NodeGetByIdResponse>;
89
- updateNode(request: NodeUpdateRequest, metadata?: Metadata): Observable<NodeResponse>;
90
- deleteNode(request: NodeDeleteRequest, metadata?: Metadata): Observable<Empty>;
93
+ createWorkflowNode(request: CreateWorkflowNodeRequest, metadata?: Metadata): Observable<WorkflowNodeResponse>;
94
+ findManyWorkflowNode(request: FindManyWorkflowNodeRequest, metadata?: Metadata): Observable<FindManyWorkflowNodeResponse>;
95
+ findFirstWorkflowNode(request: FindFirstWorkflowNodeRequest, metadata?: Metadata): Observable<FindFirstWorkflowNodeResponse>;
96
+ updateWorkflowNode(request: UpdateWorkflowNodeRequest, metadata?: Metadata): Observable<WorkflowNodeResponse>;
97
+ deleteWorkflowNode(request: DeleteWorkflowNodeRequest, metadata?: Metadata): Observable<Empty>;
91
98
  }
92
99
  export interface WorkflowServiceController {
93
100
  create(request: CreateWorkflowRequest, metadata?: Metadata): Promise<WorkflowResponse> | Observable<WorkflowResponse> | WorkflowResponse;
94
- getAll(request: GetAllWorkflowRequest, metadata?: Metadata): Promise<GetAllWorkflowResponse> | Observable<GetAllWorkflowResponse> | GetAllWorkflowResponse;
101
+ findMany(request: FindManyWorkflowRequest, metadata?: Metadata): Promise<FindManyWorkflowResponse> | Observable<FindManyWorkflowResponse> | FindManyWorkflowResponse;
95
102
  delete(request: DeleteWorkflowRequest, metadata?: Metadata): void;
96
103
  update(request: UpdateWorkflowRequest, metadata?: Metadata): Promise<WorkflowResponse> | Observable<WorkflowResponse> | WorkflowResponse;
97
- createNode(request: NodeCreateRequest, metadata?: Metadata): Promise<NodeResponse> | Observable<NodeResponse> | NodeResponse;
98
- getAllNode(request: NodeGetAllRequest, metadata?: Metadata): Promise<NodeGetAllResponse> | Observable<NodeGetAllResponse> | NodeGetAllResponse;
99
- getByIdNode(request: NodeGetByIdRequest, metadata?: Metadata): Promise<NodeGetByIdResponse> | Observable<NodeGetByIdResponse> | NodeGetByIdResponse;
100
- updateNode(request: NodeUpdateRequest, metadata?: Metadata): Promise<NodeResponse> | Observable<NodeResponse> | NodeResponse;
101
- deleteNode(request: NodeDeleteRequest, metadata?: Metadata): void;
104
+ createWorkflowNode(request: CreateWorkflowNodeRequest, metadata?: Metadata): Promise<WorkflowNodeResponse> | Observable<WorkflowNodeResponse> | WorkflowNodeResponse;
105
+ findManyWorkflowNode(request: FindManyWorkflowNodeRequest, metadata?: Metadata): Promise<FindManyWorkflowNodeResponse> | Observable<FindManyWorkflowNodeResponse> | FindManyWorkflowNodeResponse;
106
+ findFirstWorkflowNode(request: FindFirstWorkflowNodeRequest, metadata?: Metadata): Promise<FindFirstWorkflowNodeResponse> | Observable<FindFirstWorkflowNodeResponse> | FindFirstWorkflowNodeResponse;
107
+ updateWorkflowNode(request: UpdateWorkflowNodeRequest, metadata?: Metadata): Promise<WorkflowNodeResponse> | Observable<WorkflowNodeResponse> | WorkflowNodeResponse;
108
+ deleteWorkflowNode(request: DeleteWorkflowNodeRequest, metadata?: Metadata): void;
102
109
  }
103
110
  export declare function WorkflowServiceControllerMethods(): (constructor: Function) => void;
104
111
  export declare const WORKFLOW_SERVICE_NAME = "WorkflowService";
@@ -2,7 +2,7 @@
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v1.181.2
5
- // protoc v3.21.5
5
+ // protoc v6.33.1
6
6
  // source: workflow.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.WORKFLOW_SERVICE_NAME = exports.WORKFLOW_PACKAGE_NAME = exports.protobufPackage = void 0;
@@ -14,14 +14,14 @@ function WorkflowServiceControllerMethods() {
14
14
  return function (constructor) {
15
15
  const grpcMethods = [
16
16
  "create",
17
- "getAll",
17
+ "findMany",
18
18
  "delete",
19
19
  "update",
20
- "createNode",
21
- "getAllNode",
22
- "getByIdNode",
23
- "updateNode",
24
- "deleteNode",
20
+ "createWorkflowNode",
21
+ "findManyWorkflowNode",
22
+ "findFirstWorkflowNode",
23
+ "updateWorkflowNode",
24
+ "deleteWorkflowNode",
25
25
  ];
26
26
  for (const method of grpcMethods) {
27
27
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,49 +1,49 @@
1
- {
2
- "name": "@wenlarge/communication",
3
- "version": "1.0.8",
4
- "description": "Shared gRPC proto interfaces and generated clients for Wenlarge microservices.",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "files": [
8
- "dist",
9
- "proto",
10
- "src/generated"
11
- ],
12
- "scripts": {
13
- "proto:build": "protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --proto_path=proto --ts_proto_out=src/generated proto/*.proto --ts_proto_opt=nestJs=true,esModuleInterop=true,forceLong=string,useOptionals=messages,useDate=true,addGrpcMetadata=true,stringEnums=true",
14
- "build": "npm run proto:build && tsc",
15
- "prepare": "npm run build"
16
- },
17
- "keywords": [
18
- "nestjs",
19
- "grpc",
20
- "proto",
21
- "typescript",
22
- "microservices",
23
- "communication",
24
- "shared"
25
- ],
26
- "author": "Kerem Çakır <admin@wenlarge.com>",
27
- "license": "MIT",
28
- "repository": {
29
- "type": "git",
30
- "url": "https://github.com/wenlarge/communication.git"
31
- },
32
- "publishConfig": {
33
- "access": "public"
34
- },
35
- "dependencies": {
36
- "@grpc/grpc-js": "^1.14.1",
37
- "@grpc/proto-loader": "^0.7.15",
38
- "rxjs": "^7.8.1"
39
- },
40
- "devDependencies": {
41
- "@nestjs/microservices": "^10.4.20",
42
- "@types/node": "^24.9.1",
43
- "ts-proto": "^1.152.2",
44
- "typescript": "^5.3.3"
45
- },
46
- "peerDependencies":{
47
- "@grpc/grpc-js": "^1.14.1"
48
- }
49
- }
1
+ {
2
+ "name": "@wenlarge/communication",
3
+ "version": "1.1.0",
4
+ "description": "Shared gRPC proto interfaces and generated clients for Wenlarge microservices.",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "proto",
10
+ "src/generated"
11
+ ],
12
+ "scripts": {
13
+ "proto:build": "npx protoc --plugin=protoc-gen-ts_proto=%CD%\\node_modules\\.bin\\protoc-gen-ts_proto.cmd --proto_path=proto --ts_proto_out=src/generated proto/*.proto --ts_proto_opt=nestJs=true,esModuleInterop=true,forceLong=string,useOptionals=messages,useDate=true,addGrpcMetadata=true,stringEnums=true",
14
+ "build": "npm run proto:build && tsc",
15
+ "prepare": "npm run build"
16
+ },
17
+ "keywords": [
18
+ "nestjs",
19
+ "grpc",
20
+ "proto",
21
+ "typescript",
22
+ "microservices",
23
+ "communication",
24
+ "shared"
25
+ ],
26
+ "author": "Kerem Çakır <admin@wenlarge.com>",
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/wenlarge/communication.git"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "dependencies": {
36
+ "@grpc/grpc-js": "^1.14.1",
37
+ "@grpc/proto-loader": "^0.7.15",
38
+ "rxjs": "^7.8.1"
39
+ },
40
+ "devDependencies": {
41
+ "@nestjs/microservices": "^10.4.20",
42
+ "@types/node": "^24.9.1",
43
+ "ts-proto": "^1.152.2",
44
+ "typescript": "^5.3.3"
45
+ },
46
+ "peerDependencies": {
47
+ "@grpc/grpc-js": "^1.14.1"
48
+ }
49
+ }
package/proto/auth.proto CHANGED
@@ -1,75 +1,75 @@
1
- syntax = "proto3";
2
-
3
- import "google/protobuf/empty.proto";
4
-
5
- package auth;
6
-
7
- service AuthService {
8
- rpc Login (LoginRequest) returns (LoginResponse);
9
- rpc Register (RegisterRequest) returns (google.protobuf.Empty);
10
- rpc GetMe (GetMeRequest) returns (GetMeResponse);
11
- rpc InviteToCompany (InviteToCompanyRequest) returns (InviteToCompanyResponse);
12
- rpc UpdateInviteStatus (UpdateInviteStatusRequest) returns (UpdateInviteStatusResponse);
13
- }
14
-
15
- message LoginRequest {
16
- string email = 1;
17
- string password = 2;
18
- }
19
-
20
- message LoginResponse {
21
- string jwt = 1;
22
- string expiresIn = 2;
23
- }
24
-
25
- message RegisterRequest {
26
- string name = 1;
27
- string email = 2;
28
- string password = 3;
29
- }
30
-
31
- message GetMeRequest {
32
- string jwt = 1;
33
- }
34
-
35
- message Company {
36
- string id = 1;
37
- string name = 2;
38
- string createdAt = 3;
39
- string updatedAt = 4;
40
- }
41
-
42
- message CompanyUser {
43
- Company company = 1;
44
- }
45
-
46
- message InviteToCompanyRequest {
47
- string companyId = 1;
48
- string email = 2;
49
- }
50
-
51
- message InviteToCompanyResponse{
52
- string id = 1;
53
- string companyId = 2;
54
- string email = 3;
55
- }
56
-
57
- message UpdateInviteStatusRequest{
58
- string inviteId = 1;
59
- string userId =2;
60
- string status = 3;
61
- }
62
-
63
- message UpdateInviteStatusResponse{
64
- string id = 1 ;
65
- string status = 2;
66
- }
67
-
68
- message GetMeResponse {
69
- string id = 1;
70
- string name = 2;
71
- string email = 3;
72
- string createdAt = 4;
73
- string updatedAt = 5;
74
- repeated CompanyUser companyUsersOnUser = 6;
1
+ syntax = "proto3";
2
+
3
+ import "google/protobuf/empty.proto";
4
+
5
+ package auth;
6
+
7
+ service AuthService {
8
+ rpc Login (LoginRequest) returns (LoginResponse);
9
+ rpc Register (RegisterRequest) returns (google.protobuf.Empty);
10
+ rpc GetMe (GetMeRequest) returns (GetMeResponse);
11
+ rpc InviteToCompany (InviteToCompanyRequest) returns (InviteToCompanyResponse);
12
+ rpc UpdateInviteStatus (UpdateInviteStatusRequest) returns (UpdateInviteStatusResponse);
13
+ }
14
+
15
+ message LoginRequest {
16
+ string email = 1;
17
+ string password = 2;
18
+ }
19
+
20
+ message LoginResponse {
21
+ string jwt = 1;
22
+ string expiresIn = 2;
23
+ }
24
+
25
+ message RegisterRequest {
26
+ string name = 1;
27
+ string email = 2;
28
+ string password = 3;
29
+ }
30
+
31
+ message GetMeRequest {
32
+ string jwt = 1;
33
+ }
34
+
35
+ message Company {
36
+ string id = 1;
37
+ string name = 2;
38
+ string createdAt = 3;
39
+ string updatedAt = 4;
40
+ }
41
+
42
+ message CompanyUser {
43
+ Company company = 1;
44
+ }
45
+
46
+ message InviteToCompanyRequest {
47
+ string companyId = 1;
48
+ string email = 2;
49
+ }
50
+
51
+ message InviteToCompanyResponse{
52
+ string id = 1;
53
+ string companyId = 2;
54
+ string email = 3;
55
+ }
56
+
57
+ message UpdateInviteStatusRequest{
58
+ string inviteId = 1;
59
+ string userId =2;
60
+ string status = 3;
61
+ }
62
+
63
+ message UpdateInviteStatusResponse{
64
+ string id = 1 ;
65
+ string status = 2;
66
+ }
67
+
68
+ message GetMeResponse {
69
+ string id = 1;
70
+ string name = 2;
71
+ string email = 3;
72
+ string createdAt = 4;
73
+ string updatedAt = 5;
74
+ repeated CompanyUser companyUsersOnUser = 6;
75
75
  }
@@ -1,51 +1,52 @@
1
- syntax = "proto3";
2
-
3
- import "google/protobuf/empty.proto";
4
-
5
-
6
- package project;
7
-
8
- service ProjectService {
9
- rpc Create (CreateProjectRequest) returns (ProjectResponse);
10
- rpc GetAll (GetAllRequest) returns (GetAllResponse);
11
- rpc Delete (DeleteProjectRequest) returns (google.protobuf.Empty);
12
- rpc Update (UpdateProjectRequest) returns (ProjectResponse);
13
- rpc GetById (GetProjectByIdRequest) returns (GetProjectByIdResponse);
14
- }
15
-
16
- message CreateProjectRequest {
17
- string name = 1;
18
- }
19
-
20
- message ProjectResponse {
21
- string id = 1;
22
- string name = 2;
23
- string companyId = 3;
24
- string createdAt = 4;
25
- string updatedAt = 5;
26
- }
27
-
28
- message DeleteProjectRequest{
29
- string id = 1;
30
- }
31
-
32
- message UpdateProjectRequest{
33
- string id = 1;
34
- string name = 2;
35
- }
36
-
37
- message GetAllRequest{
38
- string companyId = 1;
39
- }
40
-
41
- message GetAllResponse{
42
- repeated ProjectResponse projects = 1;
43
- }
44
-
45
- message GetProjectByIdRequest{
46
- string id = 1;
47
- }
48
-
49
- message GetProjectByIdResponse{
50
- ProjectResponse project = 1;
1
+ syntax = "proto3";
2
+
3
+ import "google/protobuf/empty.proto";
4
+
5
+ package project;
6
+
7
+ service ProjectService {
8
+ rpc Create (CreateProjectRequest) returns (ProjectResponse);
9
+ rpc FindMany (FindManyRequest) returns (FindManyResponse);
10
+ rpc Delete (DeleteProjectRequest) returns (google.protobuf.Empty);
11
+ rpc Update (UpdateProjectRequest) returns (ProjectResponse);
12
+ rpc FindFirst (FindFirstRequest) returns (FindFirstResponse);
13
+ }
14
+
15
+ message CreateProjectRequest {
16
+ string name = 1;
17
+ }
18
+
19
+ message ProjectResponse {
20
+ string id = 1;
21
+ string name = 2;
22
+ string companyId = 3;
23
+ string createdAt = 4;
24
+ string updatedAt = 5;
25
+ }
26
+
27
+ message DeleteProjectRequest{
28
+ string id = 1;
29
+ }
30
+
31
+ message UpdateProjectRequest{
32
+ string id = 1;
33
+ string name = 2;
34
+ }
35
+
36
+ message FindManyRequest{
37
+ int32 skip = 1;
38
+ int32 take = 2;
39
+ }
40
+
41
+ message FindManyResponse{
42
+ repeated ProjectResponse data = 1;
43
+ int32 total = 2;
44
+ }
45
+
46
+ message FindFirstRequest{
47
+ string id = 1;
48
+ }
49
+
50
+ message FindFirstResponse{
51
+ ProjectResponse project = 1;
51
52
  }
@@ -1,105 +1,112 @@
1
- syntax = "proto3";
2
-
3
- import "google/protobuf/empty.proto";
4
-
5
- package workflow;
6
-
7
- service WorkflowService {
8
- rpc Create (CreateWorkflowRequest) returns (WorkflowResponse);
9
- rpc GetAll (GetAllWorkflowRequest) returns (GetAllWorkflowResponse);
10
- rpc Delete (DeleteWorkflowRequest) returns (google.protobuf.Empty);
11
- rpc Update (UpdateWorkflowRequest) returns (WorkflowResponse);
12
- rpc CreateNode (NodeCreateRequest) returns (NodeResponse);
13
- rpc GetAllNode (NodeGetAllRequest) returns (NodeGetAllResponse);
14
- rpc GetByIdNode (NodeGetByIdRequest) returns (NodeGetByIdResponse);
15
- rpc UpdateNode (NodeUpdateRequest) returns (NodeResponse);
16
- rpc DeleteNode (NodeDeleteRequest) returns (google.protobuf.Empty);
17
- }
18
-
19
- message CreateWorkflowRequest {
20
- string name = 1;
21
- string projectId = 2;
22
- }
23
-
24
- message WorkflowResponse {
25
- string id = 1;
26
- string name = 2;
27
- string companyId = 3;
28
- string createdAt = 4;
29
- string updatedAt = 5;
30
- }
31
-
32
- message DeleteWorkflowRequest{
33
- string id = 1;
34
- }
35
-
36
- message UpdateWorkflowRequest{
37
- string id = 1;
38
- string name = 2;
39
- }
40
-
41
- message GetAllWorkflowRequest{
42
- string companyId = 1;
43
- }
44
-
45
- message GetAllWorkflowResponse{
46
- repeated WorkflowResponse workflows = 1;
47
- }
48
-
49
- // NODE SERVICE COMPS
50
- message NodeCreateRequest{
51
- string workflowId = 1;
52
- string name = 2;
53
- string type = 3;
54
- int32 positionX = 4;
55
- int32 positionY = 5;
56
- string inputSchema = 6;
57
- string outputSchema = 7;
58
- string config = 8;
59
- repeated string nextNodeIds = 9;
60
- }
61
-
62
- message NodeUpdateRequest{
63
- string id = 1;
64
- string name = 2;
65
- string type =3;
66
- int32 positionX = 4;
67
- int32 positionY=5;
68
- repeated string nextNodeIds = 6;
69
- string inputSchema = 7;
70
- string outputSchema = 8;
71
- string config = 9;
72
- }
73
-
74
- message NodeDeleteRequest{
75
- string id = 1;
76
- }
77
-
78
- message NodeGetAllRequest{
79
- string workflowId = 1;
80
- }
81
-
82
- message NodeGetAllResponse{
83
- repeated NodeResponse nodes = 1;
84
- }
85
-
86
- message NodeGetByIdRequest{
87
- string id = 1;
88
- }
89
- message NodeGetByIdResponse{
90
- NodeResponse node = 1;
91
- }
92
-
93
- message NodeResponse{
94
- string id = 1;
95
- string name = 2;
96
- string type = 3;
97
- int32 positionX = 4;
98
- int32 positionY = 5;
99
- string inputSchema = 6;
100
- string outputSchema = 7;
101
- string config = 8;
102
- repeated string nextNodeIds = 9;
103
- string createdAt = 10;
104
- string updatedAt = 11;
1
+ syntax = "proto3";
2
+
3
+ import "google/protobuf/empty.proto";
4
+
5
+ package workflow;
6
+
7
+ service WorkflowService {
8
+ rpc Create (CreateWorkflowRequest) returns (WorkflowResponse);
9
+ rpc FindMany (FindManyWorkflowRequest) returns (FindManyWorkflowResponse);
10
+ rpc Delete (DeleteWorkflowRequest) returns (google.protobuf.Empty);
11
+ rpc Update (UpdateWorkflowRequest) returns (WorkflowResponse);
12
+ rpc CreateWorkflowNode (CreateWorkflowNodeRequest) returns (WorkflowNodeResponse);
13
+ rpc FindManyWorkflowNode (FindManyWorkflowNodeRequest) returns (FindManyWorkflowNodeResponse);
14
+ rpc FindFirstWorkflowNode (FindFirstWorkflowNodeRequest) returns (FindFirstWorkflowNodeResponse);
15
+ rpc UpdateWorkflowNode (UpdateWorkflowNodeRequest) returns (WorkflowNodeResponse);
16
+ rpc DeleteWorkflowNode (DeleteWorkflowNodeRequest) returns (google.protobuf.Empty);
17
+ }
18
+
19
+ message CreateWorkflowRequest {
20
+ string name = 1;
21
+ string projectId = 2;
22
+ }
23
+
24
+ message WorkflowResponse {
25
+ string id = 1;
26
+ string name = 2;
27
+ string companyId = 3;
28
+ string projectId = 4;
29
+ string createdAt = 5;
30
+ string updatedAt = 6;
31
+ }
32
+
33
+ message DeleteWorkflowRequest{
34
+ string id = 1;
35
+ }
36
+
37
+ message UpdateWorkflowRequest{
38
+ string id = 1;
39
+ string name = 2;
40
+ }
41
+
42
+ message FindManyWorkflowRequest{
43
+ string projectId = 1;
44
+ int32 skip = 2;
45
+ int32 take = 3;
46
+ }
47
+
48
+ message FindManyWorkflowResponse{
49
+ repeated WorkflowResponse data = 1;
50
+ int32 total = 2;
51
+ }
52
+
53
+ // NODE SERVICE COMPS
54
+ message CreateWorkflowNodeRequest{
55
+ string workflowId = 1;
56
+ string name = 2;
57
+ string type = 3;
58
+ int32 positionX = 4;
59
+ int32 positionY = 5;
60
+ string inputSchema = 6;
61
+ string outputSchema = 7;
62
+ string config = 8;
63
+ repeated string nextNodeIds = 9;
64
+ }
65
+
66
+ message UpdateWorkflowNodeRequest{
67
+ string id = 1;
68
+ string name = 2;
69
+ string type =3;
70
+ int32 positionX = 4;
71
+ int32 positionY=5;
72
+ repeated string nextNodeIds = 6;
73
+ string inputSchema = 7;
74
+ string outputSchema = 8;
75
+ string config = 9;
76
+ }
77
+
78
+ message DeleteWorkflowNodeRequest{
79
+ string id = 1;
80
+ }
81
+
82
+ message FindManyWorkflowNodeRequest{
83
+ string workflowId = 1;
84
+ int32 skip = 2;
85
+ int32 take = 3;
86
+ }
87
+
88
+ message FindManyWorkflowNodeResponse{
89
+ repeated WorkflowNodeResponse data = 1;
90
+ int32 total = 2;
91
+ }
92
+
93
+ message FindFirstWorkflowNodeRequest{
94
+ string id = 1;
95
+ }
96
+ message FindFirstWorkflowNodeResponse{
97
+ WorkflowNodeResponse node = 1;
98
+ }
99
+
100
+ message WorkflowNodeResponse{
101
+ string id = 1;
102
+ string name = 2;
103
+ string type = 3;
104
+ int32 positionX = 4;
105
+ int32 positionY = 5;
106
+ string inputSchema = 6;
107
+ string outputSchema = 7;
108
+ string config = 8;
109
+ repeated string nextNodeIds = 9;
110
+ string createdAt = 10;
111
+ string updatedAt = 11;
105
112
  }
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v1.181.2
4
- // protoc v3.21.5
4
+ // protoc v6.33.1
5
5
  // source: auth.proto
6
6
 
7
7
  /* eslint-disable */
@@ -0,0 +1,16 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v1.181.2
4
+ // protoc v6.33.1
5
+ // source: common.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "common";
10
+
11
+ export interface PaginateRequest {
12
+ skip: number;
13
+ take: number;
14
+ }
15
+
16
+ export const COMMON_PACKAGE_NAME = "common";
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v1.181.2
4
- // protoc v3.21.5
4
+ // protoc v6.33.1
5
5
  // source: google/protobuf/empty.proto
6
6
 
7
7
  /* eslint-disable */
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v1.181.2
4
- // protoc v3.21.5
4
+ // protoc v6.33.1
5
5
  // source: project.proto
6
6
 
7
7
  /* eslint-disable */
@@ -33,19 +33,21 @@ export interface UpdateProjectRequest {
33
33
  name: string;
34
34
  }
35
35
 
36
- export interface GetAllRequest {
37
- companyId: string;
36
+ export interface FindManyRequest {
37
+ skip: number;
38
+ take: number;
38
39
  }
39
40
 
40
- export interface GetAllResponse {
41
- projects: ProjectResponse[];
41
+ export interface FindManyResponse {
42
+ data: ProjectResponse[];
43
+ total: number;
42
44
  }
43
45
 
44
- export interface GetProjectByIdRequest {
46
+ export interface FindFirstRequest {
45
47
  id: string;
46
48
  }
47
49
 
48
- export interface GetProjectByIdResponse {
50
+ export interface FindFirstResponse {
49
51
  project?: ProjectResponse | undefined;
50
52
  }
51
53
 
@@ -54,13 +56,13 @@ export const PROJECT_PACKAGE_NAME = "project";
54
56
  export interface ProjectServiceClient {
55
57
  create(request: CreateProjectRequest, metadata?: Metadata): Observable<ProjectResponse>;
56
58
 
57
- getAll(request: GetAllRequest, metadata?: Metadata): Observable<GetAllResponse>;
59
+ findMany(request: FindManyRequest, metadata?: Metadata): Observable<FindManyResponse>;
58
60
 
59
61
  delete(request: DeleteProjectRequest, metadata?: Metadata): Observable<Empty>;
60
62
 
61
63
  update(request: UpdateProjectRequest, metadata?: Metadata): Observable<ProjectResponse>;
62
64
 
63
- getById(request: GetProjectByIdRequest, metadata?: Metadata): Observable<GetProjectByIdResponse>;
65
+ findFirst(request: FindFirstRequest, metadata?: Metadata): Observable<FindFirstResponse>;
64
66
  }
65
67
 
66
68
  export interface ProjectServiceController {
@@ -69,10 +71,10 @@ export interface ProjectServiceController {
69
71
  metadata?: Metadata,
70
72
  ): Promise<ProjectResponse> | Observable<ProjectResponse> | ProjectResponse;
71
73
 
72
- getAll(
73
- request: GetAllRequest,
74
+ findMany(
75
+ request: FindManyRequest,
74
76
  metadata?: Metadata,
75
- ): Promise<GetAllResponse> | Observable<GetAllResponse> | GetAllResponse;
77
+ ): Promise<FindManyResponse> | Observable<FindManyResponse> | FindManyResponse;
76
78
 
77
79
  delete(request: DeleteProjectRequest, metadata?: Metadata): void;
78
80
 
@@ -81,15 +83,15 @@ export interface ProjectServiceController {
81
83
  metadata?: Metadata,
82
84
  ): Promise<ProjectResponse> | Observable<ProjectResponse> | ProjectResponse;
83
85
 
84
- getById(
85
- request: GetProjectByIdRequest,
86
+ findFirst(
87
+ request: FindFirstRequest,
86
88
  metadata?: Metadata,
87
- ): Promise<GetProjectByIdResponse> | Observable<GetProjectByIdResponse> | GetProjectByIdResponse;
89
+ ): Promise<FindFirstResponse> | Observable<FindFirstResponse> | FindFirstResponse;
88
90
  }
89
91
 
90
92
  export function ProjectServiceControllerMethods() {
91
93
  return function (constructor: Function) {
92
- const grpcMethods: string[] = ["create", "getAll", "delete", "update", "getById"];
94
+ const grpcMethods: string[] = ["create", "findMany", "delete", "update", "findFirst"];
93
95
  for (const method of grpcMethods) {
94
96
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
95
97
  GrpcMethod("ProjectService", method)(constructor.prototype[method], method, descriptor);
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v1.181.2
4
- // protoc v3.21.5
4
+ // protoc v6.33.1
5
5
  // source: workflow.proto
6
6
 
7
7
  /* eslint-disable */
@@ -21,6 +21,7 @@ export interface WorkflowResponse {
21
21
  id: string;
22
22
  name: string;
23
23
  companyId: string;
24
+ projectId: string;
24
25
  createdAt: string;
25
26
  updatedAt: string;
26
27
  }
@@ -34,16 +35,19 @@ export interface UpdateWorkflowRequest {
34
35
  name: string;
35
36
  }
36
37
 
37
- export interface GetAllWorkflowRequest {
38
- companyId: string;
38
+ export interface FindManyWorkflowRequest {
39
+ projectId: string;
40
+ skip: number;
41
+ take: number;
39
42
  }
40
43
 
41
- export interface GetAllWorkflowResponse {
42
- workflows: WorkflowResponse[];
44
+ export interface FindManyWorkflowResponse {
45
+ data: WorkflowResponse[];
46
+ total: number;
43
47
  }
44
48
 
45
49
  /** NODE SERVICE COMPS */
46
- export interface NodeCreateRequest {
50
+ export interface CreateWorkflowNodeRequest {
47
51
  workflowId: string;
48
52
  name: string;
49
53
  type: string;
@@ -55,7 +59,7 @@ export interface NodeCreateRequest {
55
59
  nextNodeIds: string[];
56
60
  }
57
61
 
58
- export interface NodeUpdateRequest {
62
+ export interface UpdateWorkflowNodeRequest {
59
63
  id: string;
60
64
  name: string;
61
65
  type: string;
@@ -67,27 +71,30 @@ export interface NodeUpdateRequest {
67
71
  config: string;
68
72
  }
69
73
 
70
- export interface NodeDeleteRequest {
74
+ export interface DeleteWorkflowNodeRequest {
71
75
  id: string;
72
76
  }
73
77
 
74
- export interface NodeGetAllRequest {
78
+ export interface FindManyWorkflowNodeRequest {
75
79
  workflowId: string;
80
+ skip: number;
81
+ take: number;
76
82
  }
77
83
 
78
- export interface NodeGetAllResponse {
79
- nodes: NodeResponse[];
84
+ export interface FindManyWorkflowNodeResponse {
85
+ data: WorkflowNodeResponse[];
86
+ total: number;
80
87
  }
81
88
 
82
- export interface NodeGetByIdRequest {
89
+ export interface FindFirstWorkflowNodeRequest {
83
90
  id: string;
84
91
  }
85
92
 
86
- export interface NodeGetByIdResponse {
87
- node?: NodeResponse | undefined;
93
+ export interface FindFirstWorkflowNodeResponse {
94
+ node?: WorkflowNodeResponse | undefined;
88
95
  }
89
96
 
90
- export interface NodeResponse {
97
+ export interface WorkflowNodeResponse {
91
98
  id: string;
92
99
  name: string;
93
100
  type: string;
@@ -106,21 +113,27 @@ export const WORKFLOW_PACKAGE_NAME = "workflow";
106
113
  export interface WorkflowServiceClient {
107
114
  create(request: CreateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
108
115
 
109
- getAll(request: GetAllWorkflowRequest, metadata?: Metadata): Observable<GetAllWorkflowResponse>;
116
+ findMany(request: FindManyWorkflowRequest, metadata?: Metadata): Observable<FindManyWorkflowResponse>;
110
117
 
111
118
  delete(request: DeleteWorkflowRequest, metadata?: Metadata): Observable<Empty>;
112
119
 
113
120
  update(request: UpdateWorkflowRequest, metadata?: Metadata): Observable<WorkflowResponse>;
114
121
 
115
- createNode(request: NodeCreateRequest, metadata?: Metadata): Observable<NodeResponse>;
122
+ createWorkflowNode(request: CreateWorkflowNodeRequest, metadata?: Metadata): Observable<WorkflowNodeResponse>;
116
123
 
117
- getAllNode(request: NodeGetAllRequest, metadata?: Metadata): Observable<NodeGetAllResponse>;
124
+ findManyWorkflowNode(
125
+ request: FindManyWorkflowNodeRequest,
126
+ metadata?: Metadata,
127
+ ): Observable<FindManyWorkflowNodeResponse>;
118
128
 
119
- getByIdNode(request: NodeGetByIdRequest, metadata?: Metadata): Observable<NodeGetByIdResponse>;
129
+ findFirstWorkflowNode(
130
+ request: FindFirstWorkflowNodeRequest,
131
+ metadata?: Metadata,
132
+ ): Observable<FindFirstWorkflowNodeResponse>;
120
133
 
121
- updateNode(request: NodeUpdateRequest, metadata?: Metadata): Observable<NodeResponse>;
134
+ updateWorkflowNode(request: UpdateWorkflowNodeRequest, metadata?: Metadata): Observable<WorkflowNodeResponse>;
122
135
 
123
- deleteNode(request: NodeDeleteRequest, metadata?: Metadata): Observable<Empty>;
136
+ deleteWorkflowNode(request: DeleteWorkflowNodeRequest, metadata?: Metadata): Observable<Empty>;
124
137
  }
125
138
 
126
139
  export interface WorkflowServiceController {
@@ -129,10 +142,10 @@ export interface WorkflowServiceController {
129
142
  metadata?: Metadata,
130
143
  ): Promise<WorkflowResponse> | Observable<WorkflowResponse> | WorkflowResponse;
131
144
 
132
- getAll(
133
- request: GetAllWorkflowRequest,
145
+ findMany(
146
+ request: FindManyWorkflowRequest,
134
147
  metadata?: Metadata,
135
- ): Promise<GetAllWorkflowResponse> | Observable<GetAllWorkflowResponse> | GetAllWorkflowResponse;
148
+ ): Promise<FindManyWorkflowResponse> | Observable<FindManyWorkflowResponse> | FindManyWorkflowResponse;
136
149
 
137
150
  delete(request: DeleteWorkflowRequest, metadata?: Metadata): void;
138
151
 
@@ -141,41 +154,41 @@ export interface WorkflowServiceController {
141
154
  metadata?: Metadata,
142
155
  ): Promise<WorkflowResponse> | Observable<WorkflowResponse> | WorkflowResponse;
143
156
 
144
- createNode(
145
- request: NodeCreateRequest,
157
+ createWorkflowNode(
158
+ request: CreateWorkflowNodeRequest,
146
159
  metadata?: Metadata,
147
- ): Promise<NodeResponse> | Observable<NodeResponse> | NodeResponse;
160
+ ): Promise<WorkflowNodeResponse> | Observable<WorkflowNodeResponse> | WorkflowNodeResponse;
148
161
 
149
- getAllNode(
150
- request: NodeGetAllRequest,
162
+ findManyWorkflowNode(
163
+ request: FindManyWorkflowNodeRequest,
151
164
  metadata?: Metadata,
152
- ): Promise<NodeGetAllResponse> | Observable<NodeGetAllResponse> | NodeGetAllResponse;
165
+ ): Promise<FindManyWorkflowNodeResponse> | Observable<FindManyWorkflowNodeResponse> | FindManyWorkflowNodeResponse;
153
166
 
154
- getByIdNode(
155
- request: NodeGetByIdRequest,
167
+ findFirstWorkflowNode(
168
+ request: FindFirstWorkflowNodeRequest,
156
169
  metadata?: Metadata,
157
- ): Promise<NodeGetByIdResponse> | Observable<NodeGetByIdResponse> | NodeGetByIdResponse;
170
+ ): Promise<FindFirstWorkflowNodeResponse> | Observable<FindFirstWorkflowNodeResponse> | FindFirstWorkflowNodeResponse;
158
171
 
159
- updateNode(
160
- request: NodeUpdateRequest,
172
+ updateWorkflowNode(
173
+ request: UpdateWorkflowNodeRequest,
161
174
  metadata?: Metadata,
162
- ): Promise<NodeResponse> | Observable<NodeResponse> | NodeResponse;
175
+ ): Promise<WorkflowNodeResponse> | Observable<WorkflowNodeResponse> | WorkflowNodeResponse;
163
176
 
164
- deleteNode(request: NodeDeleteRequest, metadata?: Metadata): void;
177
+ deleteWorkflowNode(request: DeleteWorkflowNodeRequest, metadata?: Metadata): void;
165
178
  }
166
179
 
167
180
  export function WorkflowServiceControllerMethods() {
168
181
  return function (constructor: Function) {
169
182
  const grpcMethods: string[] = [
170
183
  "create",
171
- "getAll",
184
+ "findMany",
172
185
  "delete",
173
186
  "update",
174
- "createNode",
175
- "getAllNode",
176
- "getByIdNode",
177
- "updateNode",
178
- "deleteNode",
187
+ "createWorkflowNode",
188
+ "findManyWorkflowNode",
189
+ "findFirstWorkflowNode",
190
+ "updateWorkflowNode",
191
+ "deleteWorkflowNode",
179
192
  ];
180
193
  for (const method of grpcMethods) {
181
194
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -1,108 +0,0 @@
1
- export declare const protobufPackage = "google.protobuf";
2
- /**
3
- * A Timestamp represents a point in time independent of any time zone or local
4
- * calendar, encoded as a count of seconds and fractions of seconds at
5
- * nanosecond resolution. The count is relative to an epoch at UTC midnight on
6
- * January 1, 1970, in the proleptic Gregorian calendar which extends the
7
- * Gregorian calendar backwards to year one.
8
- *
9
- * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
10
- * second table is needed for interpretation, using a [24-hour linear
11
- * smear](https://developers.google.com/time/smear).
12
- *
13
- * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
14
- * restricting to that range, we ensure that we can convert to and from [RFC
15
- * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
16
- *
17
- * # Examples
18
- *
19
- * Example 1: Compute Timestamp from POSIX `time()`.
20
- *
21
- * Timestamp timestamp;
22
- * timestamp.set_seconds(time(NULL));
23
- * timestamp.set_nanos(0);
24
- *
25
- * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
26
- *
27
- * struct timeval tv;
28
- * gettimeofday(&tv, NULL);
29
- *
30
- * Timestamp timestamp;
31
- * timestamp.set_seconds(tv.tv_sec);
32
- * timestamp.set_nanos(tv.tv_usec * 1000);
33
- *
34
- * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
35
- *
36
- * FILETIME ft;
37
- * GetSystemTimeAsFileTime(&ft);
38
- * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
39
- *
40
- * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
41
- * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
42
- * Timestamp timestamp;
43
- * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
44
- * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
45
- *
46
- * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
47
- *
48
- * long millis = System.currentTimeMillis();
49
- *
50
- * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
51
- * .setNanos((int) ((millis % 1000) * 1000000)).build();
52
- *
53
- * Example 5: Compute Timestamp from Java `Instant.now()`.
54
- *
55
- * Instant now = Instant.now();
56
- *
57
- * Timestamp timestamp =
58
- * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
59
- * .setNanos(now.getNano()).build();
60
- *
61
- * Example 6: Compute Timestamp from current time in Python.
62
- *
63
- * timestamp = Timestamp()
64
- * timestamp.GetCurrentTime()
65
- *
66
- * # JSON Mapping
67
- *
68
- * In JSON format, the Timestamp type is encoded as a string in the
69
- * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
70
- * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
71
- * where {year} is always expressed using four digits while {month}, {day},
72
- * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
73
- * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
74
- * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
75
- * is required. A proto3 JSON serializer should always use UTC (as indicated by
76
- * "Z") when printing the Timestamp type and a proto3 JSON parser should be
77
- * able to accept both UTC and other timezones (as indicated by an offset).
78
- *
79
- * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
80
- * 01:30 UTC on January 15, 2017.
81
- *
82
- * In JavaScript, one can convert a Date object to this format using the
83
- * standard
84
- * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
85
- * method. In Python, a standard `datetime.datetime` object can be converted
86
- * to this format using
87
- * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
88
- * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
89
- * the Joda Time's [`ISODateTimeFormat.dateTime()`](
90
- * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
91
- * ) to obtain a formatter capable of generating timestamps in this format.
92
- */
93
- export interface Timestamp {
94
- /**
95
- * Represents seconds of UTC time since Unix epoch
96
- * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
97
- * 9999-12-31T23:59:59Z inclusive.
98
- */
99
- seconds: string;
100
- /**
101
- * Non-negative fractions of a second at nanosecond resolution. Negative
102
- * second values with fractions must still have non-negative nanos values
103
- * that count forward in time. Must be from 0 to 999,999,999
104
- * inclusive.
105
- */
106
- nanos: number;
107
- }
108
- export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
- // versions:
4
- // protoc-gen-ts_proto v1.181.2
5
- // protoc v3.21.5
6
- // source: google/protobuf/timestamp.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufPackage = void 0;
9
- /* eslint-disable */
10
- exports.protobufPackage = "google.protobuf";
11
- exports.GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";