@ssoeasy-dev/proto 1.1.0-dev-feat-auth.5 → 1.1.0-dev-feat-auth.7

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 (45) hide show
  1. package/gen/ts/auth/v1/auth.ts +3 -2
  2. package/gen/ts/auth/v1/common.ts +1 -66
  3. package/gen/ts/{companies/v1/models/employee_company.ts → auth/v1/permission.ts} +63 -35
  4. package/gen/ts/auth/v1/user_policy.ts +1 -1
  5. package/gen/ts/auth/v1/verification.ts +8 -8
  6. package/gen/ts/common/v1/types.ts +25 -67
  7. package/gen/ts/companies/v1/owner.ts +41 -284
  8. package/gen/ts/companies/v1/service.ts +150 -0
  9. package/gen/ts/index.auth.ts +1 -1
  10. package/gen/ts/index.auth.v1.ts +3 -2
  11. package/gen/ts/index.common.ts +1 -1
  12. package/gen/ts/index.common.v1.ts +1 -1
  13. package/gen/ts/index.companies.ts +1 -1
  14. package/gen/ts/index.companies.v1.ts +2 -2
  15. package/gen/ts/index.ts +2 -5
  16. package/package.json +1 -1
  17. package/proto/auth/v1/auth.proto +3 -2
  18. package/proto/auth/v1/common.proto +0 -4
  19. package/proto/auth/v1/permission.proto +15 -0
  20. package/proto/auth/v1/verification.proto +3 -3
  21. package/proto/common/v1/types.proto +2 -5
  22. package/proto/companies/v1/owner.proto +4 -19
  23. package/proto/companies/v1/service.proto +14 -0
  24. package/gen/ts/abac/v1/employee_attribute.ts +0 -501
  25. package/gen/ts/abac/v1/models/employee_attribute.ts +0 -190
  26. package/gen/ts/companies/v1/models/company.ts +0 -204
  27. package/gen/ts/companies/v1/models/employee.ts +0 -175
  28. package/gen/ts/companies/v1/models/subscription.ts +0 -166
  29. package/gen/ts/google/protobuf/timestamp.ts +0 -233
  30. package/gen/ts/index.abac.ts +0 -8
  31. package/gen/ts/index.abac.v1.models.ts +0 -8
  32. package/gen/ts/index.abac.v1.ts +0 -9
  33. package/gen/ts/index.companies.v1.models.ts +0 -11
  34. package/gen/ts/index.google.protobuf.ts +0 -8
  35. package/gen/ts/index.google.ts +0 -8
  36. package/gen/ts/index.services.ts +0 -8
  37. package/gen/ts/index.services.v1.ts +0 -8
  38. package/gen/ts/services/v1/services.ts +0 -293
  39. package/proto/abac/v1/employee_attribute.proto +0 -31
  40. package/proto/abac/v1/models/employee_attribute.proto +0 -11
  41. package/proto/companies/v1/models/company.proto +0 -12
  42. package/proto/companies/v1/models/employee.proto +0 -11
  43. package/proto/companies/v1/models/employee_company.proto +0 -9
  44. package/proto/companies/v1/models/subscription.proto +0 -10
  45. package/proto/services/v1/services.proto +0 -19
@@ -1,13 +1,14 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc unknown
5
5
  // source: auth/v1/auth.proto
6
6
 
7
7
  /* eslint-disable */
8
8
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
9
  import type { CallContext, CallOptions } from "nice-grpc-common";
10
- import { StatusResponse, Tokens } from "./common";
10
+ import { StatusResponse } from "../../common/v1/types";
11
+ import { Tokens } from "./common";
11
12
  import { UserPolicyRequest, UserPolicyResponse } from "./user_policy";
12
13
  import {
13
14
  Verification,
@@ -1,83 +1,18 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc unknown
5
5
  // source: auth/v1/common.proto
6
6
 
7
7
  /* eslint-disable */
8
8
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
9
 
10
- export interface StatusResponse {
11
- $type: "auth.v1.StatusResponse";
12
- success: boolean;
13
- }
14
-
15
10
  export interface Tokens {
16
11
  $type: "auth.v1.Tokens";
17
12
  access: string;
18
13
  refresh: string;
19
14
  }
20
15
 
21
- function createBaseStatusResponse(): StatusResponse {
22
- return { $type: "auth.v1.StatusResponse", success: false };
23
- }
24
-
25
- export const StatusResponse: MessageFns<StatusResponse, "auth.v1.StatusResponse"> = {
26
- $type: "auth.v1.StatusResponse" as const,
27
-
28
- encode(message: StatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
29
- if (message.success !== false) {
30
- writer.uint32(8).bool(message.success);
31
- }
32
- return writer;
33
- },
34
-
35
- decode(input: BinaryReader | Uint8Array, length?: number): StatusResponse {
36
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
37
- const end = length === undefined ? reader.len : reader.pos + length;
38
- const message = createBaseStatusResponse();
39
- while (reader.pos < end) {
40
- const tag = reader.uint32();
41
- switch (tag >>> 3) {
42
- case 1: {
43
- if (tag !== 8) {
44
- break;
45
- }
46
-
47
- message.success = reader.bool();
48
- continue;
49
- }
50
- }
51
- if ((tag & 7) === 4 || tag === 0) {
52
- break;
53
- }
54
- reader.skip(tag & 7);
55
- }
56
- return message;
57
- },
58
-
59
- fromJSON(object: any): StatusResponse {
60
- return { $type: StatusResponse.$type, success: isSet(object.success) ? globalThis.Boolean(object.success) : false };
61
- },
62
-
63
- toJSON(message: StatusResponse): unknown {
64
- const obj: any = {};
65
- if (message.success !== false) {
66
- obj.success = message.success;
67
- }
68
- return obj;
69
- },
70
-
71
- create<I extends Exact<DeepPartial<StatusResponse>, I>>(base?: I): StatusResponse {
72
- return StatusResponse.fromPartial(base ?? ({} as any));
73
- },
74
- fromPartial<I extends Exact<DeepPartial<StatusResponse>, I>>(object: I): StatusResponse {
75
- const message = createBaseStatusResponse();
76
- message.success = object.success ?? false;
77
- return message;
78
- },
79
- };
80
-
81
16
  function createBaseTokens(): Tokens {
82
17
  return { $type: "auth.v1.Tokens", access: "", refresh: "" };
83
18
  }
@@ -1,43 +1,45 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc unknown
5
- // source: companies/v1/models/employee_company.proto
5
+ // source: auth/v1/permission.proto
6
6
 
7
7
  /* eslint-disable */
8
8
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import type { CallContext, CallOptions } from "nice-grpc-common";
10
+ import { StatusResponse } from "../../common/v1/types";
9
11
 
10
- export interface EmployeeCompany {
11
- $type: "companies.v1.models.EmployeeCompany";
12
+ export interface CheckPermissionRequest {
13
+ $type: "auth.v1.CheckPermissionRequest";
12
14
  id: string;
13
- employeeId: string;
14
- companyId: string;
15
+ token: string;
16
+ companyId?: string | undefined;
15
17
  }
16
18
 
17
- function createBaseEmployeeCompany(): EmployeeCompany {
18
- return { $type: "companies.v1.models.EmployeeCompany", id: "", employeeId: "", companyId: "" };
19
+ function createBaseCheckPermissionRequest(): CheckPermissionRequest {
20
+ return { $type: "auth.v1.CheckPermissionRequest", id: "", token: "", companyId: undefined };
19
21
  }
20
22
 
21
- export const EmployeeCompany: MessageFns<EmployeeCompany, "companies.v1.models.EmployeeCompany"> = {
22
- $type: "companies.v1.models.EmployeeCompany" as const,
23
+ export const CheckPermissionRequest: MessageFns<CheckPermissionRequest, "auth.v1.CheckPermissionRequest"> = {
24
+ $type: "auth.v1.CheckPermissionRequest" as const,
23
25
 
24
- encode(message: EmployeeCompany, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
26
+ encode(message: CheckPermissionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
25
27
  if (message.id !== "") {
26
28
  writer.uint32(10).string(message.id);
27
29
  }
28
- if (message.employeeId !== "") {
29
- writer.uint32(18).string(message.employeeId);
30
+ if (message.token !== "") {
31
+ writer.uint32(18).string(message.token);
30
32
  }
31
- if (message.companyId !== "") {
33
+ if (message.companyId !== undefined) {
32
34
  writer.uint32(26).string(message.companyId);
33
35
  }
34
36
  return writer;
35
37
  },
36
38
 
37
- decode(input: BinaryReader | Uint8Array, length?: number): EmployeeCompany {
39
+ decode(input: BinaryReader | Uint8Array, length?: number): CheckPermissionRequest {
38
40
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
39
41
  const end = length === undefined ? reader.len : reader.pos + length;
40
- const message = createBaseEmployeeCompany();
42
+ const message = createBaseCheckPermissionRequest();
41
43
  while (reader.pos < end) {
42
44
  const tag = reader.uint32();
43
45
  switch (tag >>> 3) {
@@ -54,7 +56,7 @@ export const EmployeeCompany: MessageFns<EmployeeCompany, "companies.v1.models.E
54
56
  break;
55
57
  }
56
58
 
57
- message.employeeId = reader.string();
59
+ message.token = reader.string();
58
60
  continue;
59
61
  }
60
62
  case 3: {
@@ -74,49 +76,75 @@ export const EmployeeCompany: MessageFns<EmployeeCompany, "companies.v1.models.E
74
76
  return message;
75
77
  },
76
78
 
77
- fromJSON(object: any): EmployeeCompany {
79
+ fromJSON(object: any): CheckPermissionRequest {
78
80
  return {
79
- $type: EmployeeCompany.$type,
81
+ $type: CheckPermissionRequest.$type,
80
82
  id: isSet(object.id) ? globalThis.String(object.id) : "",
81
- employeeId: isSet(object.employeeId)
82
- ? globalThis.String(object.employeeId)
83
- : isSet(object.employee_id)
84
- ? globalThis.String(object.employee_id)
85
- : "",
83
+ token: isSet(object.token) ? globalThis.String(object.token) : "",
86
84
  companyId: isSet(object.companyId)
87
85
  ? globalThis.String(object.companyId)
88
86
  : isSet(object.company_id)
89
87
  ? globalThis.String(object.company_id)
90
- : "",
88
+ : undefined,
91
89
  };
92
90
  },
93
91
 
94
- toJSON(message: EmployeeCompany): unknown {
92
+ toJSON(message: CheckPermissionRequest): unknown {
95
93
  const obj: any = {};
96
94
  if (message.id !== "") {
97
95
  obj.id = message.id;
98
96
  }
99
- if (message.employeeId !== "") {
100
- obj.employeeId = message.employeeId;
97
+ if (message.token !== "") {
98
+ obj.token = message.token;
101
99
  }
102
- if (message.companyId !== "") {
100
+ if (message.companyId !== undefined) {
103
101
  obj.companyId = message.companyId;
104
102
  }
105
103
  return obj;
106
104
  },
107
105
 
108
- create<I extends Exact<DeepPartial<EmployeeCompany>, I>>(base?: I): EmployeeCompany {
109
- return EmployeeCompany.fromPartial(base ?? ({} as any));
106
+ create<I extends Exact<DeepPartial<CheckPermissionRequest>, I>>(base?: I): CheckPermissionRequest {
107
+ return CheckPermissionRequest.fromPartial(base ?? ({} as any));
110
108
  },
111
- fromPartial<I extends Exact<DeepPartial<EmployeeCompany>, I>>(object: I): EmployeeCompany {
112
- const message = createBaseEmployeeCompany();
109
+ fromPartial<I extends Exact<DeepPartial<CheckPermissionRequest>, I>>(object: I): CheckPermissionRequest {
110
+ const message = createBaseCheckPermissionRequest();
113
111
  message.id = object.id ?? "";
114
- message.employeeId = object.employeeId ?? "";
115
- message.companyId = object.companyId ?? "";
112
+ message.token = object.token ?? "";
113
+ message.companyId = object.companyId ?? undefined;
116
114
  return message;
117
115
  },
118
116
  };
119
117
 
118
+ export type PermissionServiceDefinition = typeof PermissionServiceDefinition;
119
+ export const PermissionServiceDefinition = {
120
+ name: "PermissionService",
121
+ fullName: "auth.v1.PermissionService",
122
+ methods: {
123
+ checkPermission: {
124
+ name: "CheckPermission",
125
+ requestType: CheckPermissionRequest,
126
+ requestStream: false,
127
+ responseType: StatusResponse,
128
+ responseStream: false,
129
+ options: {},
130
+ },
131
+ },
132
+ } as const;
133
+
134
+ export interface PermissionServiceImplementation<CallContextExt = {}> {
135
+ checkPermission(
136
+ request: CheckPermissionRequest,
137
+ context: CallContext & CallContextExt,
138
+ ): Promise<DeepPartial<StatusResponse>>;
139
+ }
140
+
141
+ export interface PermissionServiceClient<CallOptionsExt = {}> {
142
+ checkPermission(
143
+ request: DeepPartial<CheckPermissionRequest>,
144
+ options?: CallOptions & CallOptionsExt,
145
+ ): Promise<StatusResponse>;
146
+ }
147
+
120
148
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
121
149
 
122
150
  type DeepPartial<T> = T extends Builtin ? T
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc unknown
5
5
  // source: auth/v1/user_policy.proto
6
6
 
@@ -1,17 +1,17 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc unknown
5
5
  // source: auth/v1/verification.proto
6
6
 
7
7
  /* eslint-disable */
8
8
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
9
  import type { CallContext, CallOptions } from "nice-grpc-common";
10
- import { StatusResponse } from "./common";
10
+ import { StatusResponse } from "../../common/v1/types";
11
11
 
12
12
  export enum VerificationType {
13
13
  VERIFICATION_TYPE_UNSPECIFIED = "VERIFICATION_TYPE_UNSPECIFIED",
14
- VERIFICATION_TYPE_EMMAIL_CODE = "VERIFICATION_TYPE_EMMAIL_CODE",
14
+ VERIFICATION_TYPE_EMAIL_CODE = "VERIFICATION_TYPE_EMAIL_CODE",
15
15
  VERIFICATION_TYPE_EMAIL_LINK = "VERIFICATION_TYPE_EMAIL_LINK",
16
16
  UNRECOGNIZED = "UNRECOGNIZED",
17
17
  }
@@ -22,8 +22,8 @@ export function verificationTypeFromJSON(object: any): VerificationType {
22
22
  case "VERIFICATION_TYPE_UNSPECIFIED":
23
23
  return VerificationType.VERIFICATION_TYPE_UNSPECIFIED;
24
24
  case 1:
25
- case "VERIFICATION_TYPE_EMMAIL_CODE":
26
- return VerificationType.VERIFICATION_TYPE_EMMAIL_CODE;
25
+ case "VERIFICATION_TYPE_EMAIL_CODE":
26
+ return VerificationType.VERIFICATION_TYPE_EMAIL_CODE;
27
27
  case 2:
28
28
  case "VERIFICATION_TYPE_EMAIL_LINK":
29
29
  return VerificationType.VERIFICATION_TYPE_EMAIL_LINK;
@@ -38,8 +38,8 @@ export function verificationTypeToJSON(object: VerificationType): string {
38
38
  switch (object) {
39
39
  case VerificationType.VERIFICATION_TYPE_UNSPECIFIED:
40
40
  return "VERIFICATION_TYPE_UNSPECIFIED";
41
- case VerificationType.VERIFICATION_TYPE_EMMAIL_CODE:
42
- return "VERIFICATION_TYPE_EMMAIL_CODE";
41
+ case VerificationType.VERIFICATION_TYPE_EMAIL_CODE:
42
+ return "VERIFICATION_TYPE_EMAIL_CODE";
43
43
  case VerificationType.VERIFICATION_TYPE_EMAIL_LINK:
44
44
  return "VERIFICATION_TYPE_EMAIL_LINK";
45
45
  case VerificationType.UNRECOGNIZED:
@@ -52,7 +52,7 @@ export function verificationTypeToNumber(object: VerificationType): number {
52
52
  switch (object) {
53
53
  case VerificationType.VERIFICATION_TYPE_UNSPECIFIED:
54
54
  return 0;
55
- case VerificationType.VERIFICATION_TYPE_EMMAIL_CODE:
55
+ case VerificationType.VERIFICATION_TYPE_EMAIL_CODE:
56
56
  return 1;
57
57
  case VerificationType.VERIFICATION_TYPE_EMAIL_LINK:
58
58
  return 2;
@@ -1,57 +1,44 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc unknown
5
5
  // source: common/v1/types.proto
6
6
 
7
7
  /* eslint-disable */
8
8
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
- import { Timestamp } from "../../google/protobuf/timestamp";
10
9
 
11
- export interface AuditMetadata {
12
- $type: "common.v1.AuditMetadata";
13
- createdAt?: string | undefined;
14
- updatedAt?: string | undefined;
10
+ export interface StatusResponse {
11
+ $type: "common.v1.StatusResponse";
12
+ success: boolean;
15
13
  }
16
14
 
17
- function createBaseAuditMetadata(): AuditMetadata {
18
- return { $type: "common.v1.AuditMetadata", createdAt: undefined, updatedAt: undefined };
15
+ function createBaseStatusResponse(): StatusResponse {
16
+ return { $type: "common.v1.StatusResponse", success: false };
19
17
  }
20
18
 
21
- export const AuditMetadata: MessageFns<AuditMetadata, "common.v1.AuditMetadata"> = {
22
- $type: "common.v1.AuditMetadata" as const,
19
+ export const StatusResponse: MessageFns<StatusResponse, "common.v1.StatusResponse"> = {
20
+ $type: "common.v1.StatusResponse" as const,
23
21
 
24
- encode(message: AuditMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
25
- if (message.createdAt !== undefined) {
26
- Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(10).fork()).join();
27
- }
28
- if (message.updatedAt !== undefined) {
29
- Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(18).fork()).join();
22
+ encode(message: StatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
23
+ if (message.success !== false) {
24
+ writer.uint32(8).bool(message.success);
30
25
  }
31
26
  return writer;
32
27
  },
33
28
 
34
- decode(input: BinaryReader | Uint8Array, length?: number): AuditMetadata {
29
+ decode(input: BinaryReader | Uint8Array, length?: number): StatusResponse {
35
30
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
36
31
  const end = length === undefined ? reader.len : reader.pos + length;
37
- const message = createBaseAuditMetadata();
32
+ const message = createBaseStatusResponse();
38
33
  while (reader.pos < end) {
39
34
  const tag = reader.uint32();
40
35
  switch (tag >>> 3) {
41
36
  case 1: {
42
- if (tag !== 10) {
43
- break;
44
- }
45
-
46
- message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
47
- continue;
48
- }
49
- case 2: {
50
- if (tag !== 18) {
37
+ if (tag !== 8) {
51
38
  break;
52
39
  }
53
40
 
54
- message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
41
+ message.success = reader.bool();
55
42
  continue;
56
43
  }
57
44
  }
@@ -63,40 +50,24 @@ export const AuditMetadata: MessageFns<AuditMetadata, "common.v1.AuditMetadata">
63
50
  return message;
64
51
  },
65
52
 
66
- fromJSON(object: any): AuditMetadata {
67
- return {
68
- $type: AuditMetadata.$type,
69
- createdAt: isSet(object.createdAt)
70
- ? globalThis.String(object.createdAt)
71
- : isSet(object.created_at)
72
- ? globalThis.String(object.created_at)
73
- : undefined,
74
- updatedAt: isSet(object.updatedAt)
75
- ? globalThis.String(object.updatedAt)
76
- : isSet(object.updated_at)
77
- ? globalThis.String(object.updated_at)
78
- : undefined,
79
- };
53
+ fromJSON(object: any): StatusResponse {
54
+ return { $type: StatusResponse.$type, success: isSet(object.success) ? globalThis.Boolean(object.success) : false };
80
55
  },
81
56
 
82
- toJSON(message: AuditMetadata): unknown {
57
+ toJSON(message: StatusResponse): unknown {
83
58
  const obj: any = {};
84
- if (message.createdAt !== undefined) {
85
- obj.createdAt = message.createdAt;
86
- }
87
- if (message.updatedAt !== undefined) {
88
- obj.updatedAt = message.updatedAt;
59
+ if (message.success !== false) {
60
+ obj.success = message.success;
89
61
  }
90
62
  return obj;
91
63
  },
92
64
 
93
- create<I extends Exact<DeepPartial<AuditMetadata>, I>>(base?: I): AuditMetadata {
94
- return AuditMetadata.fromPartial(base ?? ({} as any));
65
+ create<I extends Exact<DeepPartial<StatusResponse>, I>>(base?: I): StatusResponse {
66
+ return StatusResponse.fromPartial(base ?? ({} as any));
95
67
  },
96
- fromPartial<I extends Exact<DeepPartial<AuditMetadata>, I>>(object: I): AuditMetadata {
97
- const message = createBaseAuditMetadata();
98
- message.createdAt = object.createdAt ?? undefined;
99
- message.updatedAt = object.updatedAt ?? undefined;
68
+ fromPartial<I extends Exact<DeepPartial<StatusResponse>, I>>(object: I): StatusResponse {
69
+ const message = createBaseStatusResponse();
70
+ message.success = object.success ?? false;
100
71
  return message;
101
72
  },
102
73
  };
@@ -114,19 +85,6 @@ type KeysOfUnion<T> = T extends T ? keyof T : never;
114
85
  type Exact<P, I extends P> = P extends Builtin ? P
115
86
  : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
116
87
 
117
- function toTimestamp(dateStr: string): Timestamp {
118
- const date = new globalThis.Date(dateStr);
119
- const seconds = Math.trunc(date.getTime() / 1_000);
120
- const nanos = (date.getTime() % 1_000) * 1_000_000;
121
- return { $type: "google.protobuf.Timestamp", seconds, nanos };
122
- }
123
-
124
- function fromTimestamp(t: Timestamp): string {
125
- let millis = (t.seconds || 0) * 1_000;
126
- millis += (t.nanos || 0) / 1_000_000;
127
- return new globalThis.Date(millis).toISOString();
128
- }
129
-
130
88
  function isSet(value: any): boolean {
131
89
  return value !== null && value !== undefined;
132
90
  }