@claimscore/event-schemas 0.1.0-beta.2 → 1.0.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 (45) hide show
  1. package/README.md +78 -19
  2. package/dist/{account/v1/account_activated.js → cjs/account/v1/activated.js} +2 -2
  3. package/dist/{case/v1/case_created.js → cjs/case/v1/created.js} +2 -2
  4. package/dist/{file → cjs/file}/v1/analysis_requested.js +1 -1
  5. package/dist/{file → cjs/file}/v1/preprocess_completed.js +1 -1
  6. package/dist/cjs/index.js +32 -0
  7. package/dist/{invitation/v1/invitation_approved.js → cjs/invitation/v1/approved.js} +2 -2
  8. package/dist/{organization/v1/invitation_created.js → cjs/invitation/v1/created.js} +3 -3
  9. package/dist/{invitation/v1/invitation_verification_resent.js → cjs/invitation/v1/verification_resent.js} +2 -2
  10. package/dist/cjs/package.json +3 -0
  11. package/dist/{case/v1/permission_created.js → cjs/permission/v1/created.js} +3 -3
  12. package/dist/{case/v1/permission_deleted.js → cjs/permission/v1/deleted.js} +3 -3
  13. package/dist/{case/v1/permission_updated.js → cjs/permission/v1/updated.js} +3 -3
  14. package/dist/{report/v1/report_generated.js → cjs/report/v1/generated.js} +2 -2
  15. package/dist/cjs/topics.js +17 -0
  16. package/dist/esm/account/v1/activated.js +186 -0
  17. package/dist/esm/case/v1/created.js +232 -0
  18. package/dist/esm/file/v1/analysis_requested.js +144 -0
  19. package/dist/esm/file/v1/preprocess_completed.js +144 -0
  20. package/dist/esm/index.d.ts +12 -0
  21. package/dist/esm/index.js +13 -0
  22. package/dist/esm/invitation/v1/approved.js +140 -0
  23. package/dist/{organization/v1/invitation_created.d.ts → esm/invitation/v1/created.d.ts} +1 -1
  24. package/dist/esm/invitation/v1/created.js +302 -0
  25. package/dist/esm/invitation/v1/verification_resent.js +186 -0
  26. package/dist/esm/package.json +3 -0
  27. package/dist/{case/v1/permission_created.d.ts → esm/permission/v1/created.d.ts} +1 -1
  28. package/dist/esm/permission/v1/created.js +206 -0
  29. package/dist/{case/v1/permission_deleted.d.ts → esm/permission/v1/deleted.d.ts} +1 -1
  30. package/dist/esm/permission/v1/deleted.js +206 -0
  31. package/dist/{case/v1/permission_updated.d.ts → esm/permission/v1/updated.d.ts} +1 -1
  32. package/dist/esm/permission/v1/updated.js +206 -0
  33. package/dist/esm/report/v1/generated.js +378 -0
  34. package/dist/esm/topics.d.ts +13 -0
  35. package/dist/esm/topics.js +14 -0
  36. package/package.json +20 -5
  37. package/dist/index.d.ts +0 -11
  38. package/dist/index.js +0 -29
  39. /package/dist/{account/v1/account_activated.d.ts → esm/account/v1/activated.d.ts} +0 -0
  40. /package/dist/{case/v1/case_created.d.ts → esm/case/v1/created.d.ts} +0 -0
  41. /package/dist/{file → esm/file}/v1/analysis_requested.d.ts +0 -0
  42. /package/dist/{file → esm/file}/v1/preprocess_completed.d.ts +0 -0
  43. /package/dist/{invitation/v1/invitation_approved.d.ts → esm/invitation/v1/approved.d.ts} +0 -0
  44. /package/dist/{invitation/v1/invitation_verification_resent.d.ts → esm/invitation/v1/verification_resent.d.ts} +0 -0
  45. /package/dist/{report/v1/report_generated.d.ts → esm/report/v1/generated.d.ts} +0 -0
package/README.md CHANGED
@@ -8,35 +8,70 @@ See the [Event Schemas ADR](https://www.notion.so/Event-Schemas-ADR-33d12233cdbc
8
8
 
9
9
  ## How it works
10
10
 
11
- 1. Schemas are written as `.proto` files under `schemas/{domain}/`
11
+ 1. Schemas are written as `.proto` files under `schemas/{domain}/v{N}/`
12
12
  2. [`buf`](https://buf.build/) compiles them to TypeScript under `gen/node/`
13
- 3. Generated files are **committed** CI fails if they drift from the source
14
- 4. The npm package `@claimscore/event-schemas` is published on every `v*` git tag
15
- 5. Schemas are registered in the Confluent Schema Registry on every merge to `main`
13
+ 3. `scripts/generate-index.mjs` auto-generates `gen/node/index.ts` (root barrel) and `gen/node/topics.ts` (Kafka topic name constants) from the file structure
14
+ 4. Generated files are **committed** CI fails if they drift from the source
15
+ 5. The npm package `@claimscore/event-schemas` is published on every `v*` git tag
16
+ 6. Schemas are registered in the Confluent Schema Registry on every merge to `main`
16
17
 
17
18
  ---
18
19
 
19
20
  ## Naming convention
20
21
 
21
- `{domain}.{entity}.{event}.{version}` → e.g. `organization.invitation.created.v1`
22
+ `{domain}.{event}.{version}` → e.g. `permission.created.v1`
22
23
 
23
- - Proto file: `schemas/organization/v1/invitation_created.proto`
24
- - Kafka topic subject: `organization.invitation.created.v1-value`
25
- - Package: `organization.v1`
24
+ | Part | Source | Example |
25
+ |---|---|---|
26
+ | `domain` | folder under `schemas/` | `permission` |
27
+ | `event` | proto filename (no extension) | `created` |
28
+ | `version` | version folder | `v1` |
29
+
30
+ **Proto file path:** `schemas/{domain}/v{N}/{event}.proto`
31
+ **Proto package:** `{domain}.v{N}`
32
+ **Kafka topic:** `{domain}.{event}.v{N}`
33
+
34
+ ### Examples
35
+
36
+ | Proto file | Package | Kafka topic |
37
+ |---|---|---|
38
+ | `schemas/permission/v1/created.proto` | `permission.v1` | `permission.created.v1` |
39
+ | `schemas/invitation/v1/verification_resent.proto` | `invitation.v1` | `invitation.verification_resent.v1` |
40
+ | `schemas/report/v1/generated.proto` | `report.v1` | `report.generated.v1` |
41
+
42
+ > The domain folder is the entity. Do **not** repeat the domain name in the filename — `case/v1/created.proto` not `case/v1/case_created.proto`.
43
+
44
+ ---
45
+
46
+ ## Topic name auto-generation
47
+
48
+ `gen/node/topics.ts` is fully auto-generated from the file structure. The `Topics` constant is keyed by PascalCase `{Domain}{Event}` and valued with the topic string:
49
+
50
+ ```ts
51
+ export const Topics = {
52
+ PermissionCreated: "permission.created.v1",
53
+ InvitationVerificationResent: "invitation.verification_resent.v1",
54
+ ReportGenerated: "report.generated.v1",
55
+ // ...
56
+ } as const;
57
+ ```
58
+
59
+ This file is regenerated every time you run `npm run generate`. **Do not edit it manually.**
26
60
 
27
61
  ---
28
62
 
29
63
  ## Adding a new schema
30
64
 
31
- 1. Create `schemas/{domain}/v{N}/{entity}_{event}.proto`
32
- 2. Run `buf generate` locally
33
- 3. Export the new type from `gen/node/index.ts`
34
- 4. Open a PR CI will lint, check for breaking changes, and verify generated files match
65
+ 1. Create `schemas/{domain}/v{N}/{event}.proto` following the naming convention above
66
+ 2. Set the proto package to `{domain}.v{N}`
67
+ 3. Run `npm run generate` — this regenerates TypeScript types, the root barrel, and the `Topics` constant automatically
68
+ 4. Commit all files under `gen/node/`
69
+ 5. Open a PR — CI will lint, check for breaking changes, and verify generated files match
35
70
 
36
71
  **Backward compatibility rules (BACKWARD mode):**
37
72
  - New fields must be `optional`
38
73
  - Never remove a field — mark it `reserved` instead
39
- - Breaking changes require a new version (e.g. `invitation_created_v2.proto`)
74
+ - Breaking changes require a new version folder (e.g. `schemas/invitation/v2/`)
40
75
 
41
76
  ---
42
77
 
@@ -51,11 +86,32 @@ Add to your `.npmrc` (or set via environment):
51
86
  @claimscore:registry=https://registry.npmjs.org/
52
87
  ```
53
88
 
54
- Usage:
89
+ ### Importing types
90
+
55
91
  ```ts
56
- import { InvitationCreated } from '@claimscore/event-schemas/organization/v1/invitation_created';
92
+ // Root import tree-shakeable, only used schemas are bundled
93
+ import { InvitationCreated, PermissionCreated } from '@claimscore/event-schemas';
94
+
95
+ // Deep import — also available but not needed
96
+ import { InvitationCreated } from '@claimscore/event-schemas/invitation/v1/created';
57
97
  ```
58
98
 
99
+ ### Importing topic names
100
+
101
+ ```ts
102
+ import { Topics } from '@covalynt/event-schemas';
103
+ // or direct (tree-shakes to just the Topics object)
104
+ import { Topics } from '@covalynt/event-schemas/topics';
105
+
106
+ // Producer
107
+ await producer.send({ topic: Topics.InvitationCreated, messages: [...] });
108
+
109
+ // Consumer
110
+ await consumer.subscribe({ topics: [Topics.PermissionCreated] });
111
+ ```
112
+
113
+ `Topics` values are typed as string literals (`"permission.created.v1"`, not `string`), so TypeScript catches mismatches at the call site.
114
+
59
115
  ---
60
116
 
61
117
  ## Local development
@@ -63,14 +119,17 @@ import { InvitationCreated } from '@claimscore/event-schemas/organization/v1/inv
63
119
  **Prerequisites:** [`buf`](https://buf.build/docs/installation)
64
120
 
65
121
  ```bash
122
+ # Regenerate TypeScript types, barrel index, and topic constants
123
+ npm run generate
124
+
66
125
  # Lint all schemas
67
- buf lint
126
+ npm run lint
68
127
 
69
128
  # Check for breaking changes against main
70
- buf breaking --against '.git#branch=main'
129
+ npm run breaking
71
130
 
72
- # Regenerate TypeScript types
73
- buf generate
131
+ # Full build (clean dist + generate + compile)
132
+ npm run build
74
133
  ```
75
134
 
76
135
  ---
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
- // source: account/v1/account_activated.proto
6
+ // source: account/v1/activated.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.AccountActivated = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
- // source: case/v1/case_created.proto
6
+ // source: case/v1/created.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.CaseCreated = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
6
  // source: file/v1/analysis_requested.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
6
  // source: file/v1/preprocess_completed.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Topics = exports.ReportGenerated = exports.Attachment = exports.DeliveryType = exports.FileType = exports.PermissionUpdated = exports.PermissionDeleted = exports.PermissionCreated = exports.InvitationVerificationResent = exports.InvitationCreated = exports.CasePermission = exports.InvitationApproved = exports.PreprocessCompleted = exports.AnalysisRequested = exports.CaseCreated = exports.AccountActivated = void 0;
4
+ // AUTO-GENERATED by scripts/generate-index.mjs. Do not edit manually.
5
+ var activated_1 = require("./account/v1/activated");
6
+ Object.defineProperty(exports, "AccountActivated", { enumerable: true, get: function () { return activated_1.AccountActivated; } });
7
+ var created_1 = require("./case/v1/created");
8
+ Object.defineProperty(exports, "CaseCreated", { enumerable: true, get: function () { return created_1.CaseCreated; } });
9
+ var analysis_requested_1 = require("./file/v1/analysis_requested");
10
+ Object.defineProperty(exports, "AnalysisRequested", { enumerable: true, get: function () { return analysis_requested_1.AnalysisRequested; } });
11
+ var preprocess_completed_1 = require("./file/v1/preprocess_completed");
12
+ Object.defineProperty(exports, "PreprocessCompleted", { enumerable: true, get: function () { return preprocess_completed_1.PreprocessCompleted; } });
13
+ var approved_1 = require("./invitation/v1/approved");
14
+ Object.defineProperty(exports, "InvitationApproved", { enumerable: true, get: function () { return approved_1.InvitationApproved; } });
15
+ var created_2 = require("./invitation/v1/created");
16
+ Object.defineProperty(exports, "CasePermission", { enumerable: true, get: function () { return created_2.CasePermission; } });
17
+ Object.defineProperty(exports, "InvitationCreated", { enumerable: true, get: function () { return created_2.InvitationCreated; } });
18
+ var verification_resent_1 = require("./invitation/v1/verification_resent");
19
+ Object.defineProperty(exports, "InvitationVerificationResent", { enumerable: true, get: function () { return verification_resent_1.InvitationVerificationResent; } });
20
+ var created_3 = require("./permission/v1/created");
21
+ Object.defineProperty(exports, "PermissionCreated", { enumerable: true, get: function () { return created_3.PermissionCreated; } });
22
+ var deleted_1 = require("./permission/v1/deleted");
23
+ Object.defineProperty(exports, "PermissionDeleted", { enumerable: true, get: function () { return deleted_1.PermissionDeleted; } });
24
+ var updated_1 = require("./permission/v1/updated");
25
+ Object.defineProperty(exports, "PermissionUpdated", { enumerable: true, get: function () { return updated_1.PermissionUpdated; } });
26
+ var generated_1 = require("./report/v1/generated");
27
+ Object.defineProperty(exports, "FileType", { enumerable: true, get: function () { return generated_1.FileType; } });
28
+ Object.defineProperty(exports, "DeliveryType", { enumerable: true, get: function () { return generated_1.DeliveryType; } });
29
+ Object.defineProperty(exports, "Attachment", { enumerable: true, get: function () { return generated_1.Attachment; } });
30
+ Object.defineProperty(exports, "ReportGenerated", { enumerable: true, get: function () { return generated_1.ReportGenerated; } });
31
+ var topics_1 = require("./topics");
32
+ Object.defineProperty(exports, "Topics", { enumerable: true, get: function () { return topics_1.Topics; } });
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
- // source: invitation/v1/invitation_approved.proto
6
+ // source: invitation/v1/approved.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.InvitationApproved = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
- // source: organization/v1/invitation_created.proto
6
+ // source: invitation/v1/created.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.InvitationCreated = exports.CasePermission = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
- exports.protobufPackage = "organization.v1";
11
+ exports.protobufPackage = "invitation.v1";
12
12
  function createBaseCasePermission() {
13
13
  return { caseId: "", roleName: "" };
14
14
  }
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
- // source: invitation/v1/invitation_verification_resent.proto
6
+ // source: invitation/v1/verification_resent.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.InvitationVerificationResent = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
- // source: case/v1/permission_created.proto
6
+ // source: permission/v1/created.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.PermissionCreated = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
- exports.protobufPackage = "case.v1";
11
+ exports.protobufPackage = "permission.v1";
12
12
  function createBasePermissionCreated() {
13
13
  return {
14
14
  caseId: "",
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
- // source: case/v1/permission_deleted.proto
6
+ // source: permission/v1/deleted.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.PermissionDeleted = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
- exports.protobufPackage = "case.v1";
11
+ exports.protobufPackage = "permission.v1";
12
12
  function createBasePermissionDeleted() {
13
13
  return {
14
14
  caseId: "",
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
- // source: case/v1/permission_updated.proto
6
+ // source: permission/v1/updated.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.PermissionUpdated = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
- exports.protobufPackage = "case.v1";
11
+ exports.protobufPackage = "permission.v1";
12
12
  function createBasePermissionUpdated() {
13
13
  return {
14
14
  caseId: "",
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.11.7
4
+ // protoc-gen-ts_proto v2.11.8
5
5
  // protoc unknown
6
- // source: report/v1/report_generated.proto
6
+ // source: report/v1/generated.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ReportGenerated = exports.Attachment = exports.DeliveryType = exports.FileType = exports.protobufPackage = void 0;
9
9
  exports.fileTypeFromJSON = fileTypeFromJSON;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Topics = void 0;
4
+ // AUTO-GENERATED by scripts/generate-index.mjs. Do not edit manually.
5
+ exports.Topics = {
6
+ AccountActivated: "account.activated.v1",
7
+ CaseCreated: "case.created.v1",
8
+ FileAnalysisRequested: "file.analysis_requested.v1",
9
+ FilePreprocessCompleted: "file.preprocess_completed.v1",
10
+ InvitationApproved: "invitation.approved.v1",
11
+ InvitationCreated: "invitation.created.v1",
12
+ InvitationVerificationResent: "invitation.verification_resent.v1",
13
+ PermissionCreated: "permission.created.v1",
14
+ PermissionDeleted: "permission.deleted.v1",
15
+ PermissionUpdated: "permission.updated.v1",
16
+ ReportGenerated: "report.generated.v1",
17
+ };
@@ -0,0 +1,186 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc unknown
5
+ // source: account/v1/activated.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ export const protobufPackage = "account.v1";
9
+ function createBaseAccountActivated() {
10
+ return {
11
+ accountId: "",
12
+ email: "",
13
+ firstName: "",
14
+ lastName: "",
15
+ organizationId: "",
16
+ organizationName: "",
17
+ invitationId: "",
18
+ };
19
+ }
20
+ export const AccountActivated = {
21
+ encode(message, writer = new BinaryWriter()) {
22
+ if (message.accountId !== "") {
23
+ writer.uint32(10).string(message.accountId);
24
+ }
25
+ if (message.email !== "") {
26
+ writer.uint32(18).string(message.email);
27
+ }
28
+ if (message.firstName !== "") {
29
+ writer.uint32(26).string(message.firstName);
30
+ }
31
+ if (message.lastName !== "") {
32
+ writer.uint32(34).string(message.lastName);
33
+ }
34
+ if (message.organizationId !== "") {
35
+ writer.uint32(42).string(message.organizationId);
36
+ }
37
+ if (message.organizationName !== "") {
38
+ writer.uint32(50).string(message.organizationName);
39
+ }
40
+ if (message.invitationId !== "") {
41
+ writer.uint32(58).string(message.invitationId);
42
+ }
43
+ return writer;
44
+ },
45
+ decode(input, length) {
46
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
47
+ const end = length === undefined ? reader.len : reader.pos + length;
48
+ const message = createBaseAccountActivated();
49
+ while (reader.pos < end) {
50
+ const tag = reader.uint32();
51
+ switch (tag >>> 3) {
52
+ case 1: {
53
+ if (tag !== 10) {
54
+ break;
55
+ }
56
+ message.accountId = reader.string();
57
+ continue;
58
+ }
59
+ case 2: {
60
+ if (tag !== 18) {
61
+ break;
62
+ }
63
+ message.email = reader.string();
64
+ continue;
65
+ }
66
+ case 3: {
67
+ if (tag !== 26) {
68
+ break;
69
+ }
70
+ message.firstName = reader.string();
71
+ continue;
72
+ }
73
+ case 4: {
74
+ if (tag !== 34) {
75
+ break;
76
+ }
77
+ message.lastName = reader.string();
78
+ continue;
79
+ }
80
+ case 5: {
81
+ if (tag !== 42) {
82
+ break;
83
+ }
84
+ message.organizationId = reader.string();
85
+ continue;
86
+ }
87
+ case 6: {
88
+ if (tag !== 50) {
89
+ break;
90
+ }
91
+ message.organizationName = reader.string();
92
+ continue;
93
+ }
94
+ case 7: {
95
+ if (tag !== 58) {
96
+ break;
97
+ }
98
+ message.invitationId = reader.string();
99
+ continue;
100
+ }
101
+ }
102
+ if ((tag & 7) === 4 || tag === 0) {
103
+ break;
104
+ }
105
+ reader.skip(tag & 7);
106
+ }
107
+ return message;
108
+ },
109
+ fromJSON(object) {
110
+ return {
111
+ accountId: isSet(object.accountId)
112
+ ? globalThis.String(object.accountId)
113
+ : isSet(object.account_id)
114
+ ? globalThis.String(object.account_id)
115
+ : "",
116
+ email: isSet(object.email) ? globalThis.String(object.email) : "",
117
+ firstName: isSet(object.firstName)
118
+ ? globalThis.String(object.firstName)
119
+ : isSet(object.first_name)
120
+ ? globalThis.String(object.first_name)
121
+ : "",
122
+ lastName: isSet(object.lastName)
123
+ ? globalThis.String(object.lastName)
124
+ : isSet(object.last_name)
125
+ ? globalThis.String(object.last_name)
126
+ : "",
127
+ organizationId: isSet(object.organizationId)
128
+ ? globalThis.String(object.organizationId)
129
+ : isSet(object.organization_id)
130
+ ? globalThis.String(object.organization_id)
131
+ : "",
132
+ organizationName: isSet(object.organizationName)
133
+ ? globalThis.String(object.organizationName)
134
+ : isSet(object.organization_name)
135
+ ? globalThis.String(object.organization_name)
136
+ : "",
137
+ invitationId: isSet(object.invitationId)
138
+ ? globalThis.String(object.invitationId)
139
+ : isSet(object.invitation_id)
140
+ ? globalThis.String(object.invitation_id)
141
+ : "",
142
+ };
143
+ },
144
+ toJSON(message) {
145
+ const obj = {};
146
+ if (message.accountId !== "") {
147
+ obj.accountId = message.accountId;
148
+ }
149
+ if (message.email !== "") {
150
+ obj.email = message.email;
151
+ }
152
+ if (message.firstName !== "") {
153
+ obj.firstName = message.firstName;
154
+ }
155
+ if (message.lastName !== "") {
156
+ obj.lastName = message.lastName;
157
+ }
158
+ if (message.organizationId !== "") {
159
+ obj.organizationId = message.organizationId;
160
+ }
161
+ if (message.organizationName !== "") {
162
+ obj.organizationName = message.organizationName;
163
+ }
164
+ if (message.invitationId !== "") {
165
+ obj.invitationId = message.invitationId;
166
+ }
167
+ return obj;
168
+ },
169
+ create(base) {
170
+ return AccountActivated.fromPartial(base ?? {});
171
+ },
172
+ fromPartial(object) {
173
+ const message = createBaseAccountActivated();
174
+ message.accountId = object.accountId ?? "";
175
+ message.email = object.email ?? "";
176
+ message.firstName = object.firstName ?? "";
177
+ message.lastName = object.lastName ?? "";
178
+ message.organizationId = object.organizationId ?? "";
179
+ message.organizationName = object.organizationName ?? "";
180
+ message.invitationId = object.invitationId ?? "";
181
+ return message;
182
+ },
183
+ };
184
+ function isSet(value) {
185
+ return value !== null && value !== undefined;
186
+ }