@togatherlabs/event-sdk 1.0.22 → 1.0.24

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.
package/README.md CHANGED
@@ -152,19 +152,25 @@ const json = toJson(UserCreatedSchema, decoded);
152
152
 
153
153
  ### Python
154
154
 
155
- **Dependencies:**
155
+ **Install dependencies (for usage):**
156
+
157
+ ```bash
158
+ pip install protobuf togather-event-sdk
159
+ ```
160
+
161
+ **Dependencies (for maintainers / publishing):**
156
162
 
157
163
  ```bash
158
- pip install protobuf
164
+ pip install build twine
159
165
  ```
160
166
 
161
167
  **Example usage:**
162
168
 
163
169
  ```python
164
- from gen.python.user.create.v1 import user_pb2
170
+ from togather_event_sdk.user.v1 import UserCreated
165
171
 
166
172
  # Create a new message
167
- msg = user_pb2.UserCreated(
173
+ msg = UserCreated(
168
174
  id="1",
169
175
  name="Abhiram",
170
176
  email="abhiram@gmail.com",
@@ -175,12 +181,24 @@ msg = user_pb2.UserCreated(
175
181
  binary_data = msg.SerializeToString()
176
182
 
177
183
  # Deserialize from bytes
178
- decoded = user_pb2.UserCreated()
184
+ decoded = UserCreated()
179
185
  decoded.ParseFromString(binary_data)
180
186
 
181
187
  print(decoded)
182
188
  ```
183
189
 
190
+ **Build & Publish Python SDK (for maintainers):**
191
+
192
+ ```bash
193
+ pnpm python:build
194
+ ```
195
+ This runs:
196
+ * buf generate
197
+ * Adds __init__.py files
198
+ * Builds the Python wheel + source tarball
199
+
200
+
201
+
184
202
  > **Tip:** Python type hints can be added with `mypy-protobuf` or community plugins for full static type checking.
185
203
 
186
204
 
@@ -1,5 +1,5 @@
1
1
  // @generated by protoc-gen-es v2.10.0 with parameter "target=js+dts,import_extension=none"
2
- // @generated from file admin/v1/admin_created.proto (package admin.v1, syntax proto3)
2
+ // @generated from file admin/v1/admin_account_created.proto (package admin.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
5
  import type { GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
@@ -7,14 +7,14 @@ import type { Message } from "@bufbuild/protobuf";
7
7
  import type { FieldOptions } from "@bufbuild/protobuf/wkt";
8
8
 
9
9
  /**
10
- * Describes the file admin/v1/admin_created.proto.
10
+ * Describes the file admin/v1/admin_account_created.proto.
11
11
  */
12
- export declare const file_admin_v1_admin_created: GenFile;
12
+ export declare const file_admin_v1_admin_account_created: GenFile;
13
13
 
14
14
  /**
15
- * @generated from message admin.v1.Payload
15
+ * @generated from message admin.v1.AdminAccountCreatedPayload
16
16
  */
17
- export declare type Payload = Message<"admin.v1.Payload"> & {
17
+ export declare type AdminAccountCreatedPayload = Message<"admin.v1.AdminAccountCreatedPayload"> & {
18
18
  /**
19
19
  * @generated from field: string id = 10;
20
20
  */
@@ -42,10 +42,10 @@ export declare type Payload = Message<"admin.v1.Payload"> & {
42
42
  };
43
43
 
44
44
  /**
45
- * Describes the message admin.v1.Payload.
46
- * Use `create(PayloadSchema)` to create a new message.
45
+ * Describes the message admin.v1.AdminAccountCreatedPayload.
46
+ * Use `create(AdminAccountCreatedPayloadSchema)` to create a new message.
47
47
  */
48
- export declare const PayloadSchema: GenMessage<Payload>;
48
+ export declare const AdminAccountCreatedPayloadSchema: GenMessage<AdminAccountCreatedPayload>;
49
49
 
50
50
  /**
51
51
  * @generated from message admin.v1.AdminAccountCreated
@@ -72,14 +72,14 @@ export declare type AdminAccountCreated = Message<"admin.v1.AdminAccountCreated"
72
72
  timestamp: bigint;
73
73
 
74
74
  /**
75
- * @generated from field: string trace_id = 5;
75
+ * @generated from field: optional string trace_id = 5;
76
76
  */
77
- traceId: string;
77
+ traceId?: string;
78
78
 
79
79
  /**
80
- * @generated from field: admin.v1.Payload payload = 9;
80
+ * @generated from field: admin.v1.AdminAccountCreatedPayload payload = 9;
81
81
  */
82
- payload?: Payload;
82
+ payload?: AdminAccountCreatedPayload;
83
83
  };
84
84
 
85
85
  /**
@@ -0,0 +1,33 @@
1
+ // @generated by protoc-gen-es v2.10.0 with parameter "target=js+dts,import_extension=none"
2
+ // @generated from file admin/v1/admin_account_created.proto (package admin.v1, syntax proto3)
3
+ /* eslint-disable */
4
+
5
+ import { extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
6
+ import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt";
7
+
8
+ /**
9
+ * Describes the file admin/v1/admin_account_created.proto.
10
+ */
11
+ export const file_admin_v1_admin_account_created = /*@__PURE__*/
12
+ fileDesc("CiRhZG1pbi92MS9hZG1pbl9hY2NvdW50X2NyZWF0ZWQucHJvdG8SCGFkbWluLnYxInIKGkFkbWluQWNjb3VudENyZWF0ZWRQYXlsb2FkEgoKAmlkGAogASgJEg0KBWVtYWlsGAsgASgJEhIKCmZpcnN0X25hbWUYDCABKAkSEQoJbGFzdF9uYW1lGA0gASgJEhIKCmNyZWF0ZWRfYXQYDiABKAMi5gEKE0FkbWluQWNjb3VudENyZWF0ZWQSLQoKZXZlbnRfbmFtZRgBIAEoCUIZirUYFWFkbWluLmFjY291bnQuY3JlYXRlZBIcCg1ldmVudF92ZXJzaW9uGAIgASgFQgWKtRgBMRIUCgxhZ2dyZWdhdGVfaWQYAyABKAkSEQoJdGltZXN0YW1wGAQgASgDEhUKCHRyYWNlX2lkGAUgASgJSACIAQESNQoHcGF5bG9hZBgJIAEoCzIkLmFkbWluLnYxLkFkbWluQWNjb3VudENyZWF0ZWRQYXlsb2FkQgsKCV90cmFjZV9pZDpACgtmaXhlZF92YWx1ZRIdLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnMY0YYDIAEoCVIKZml4ZWRWYWx1ZUJpCgxjb20uYWRtaW4udjFCGEFkbWluQWNjb3VudENyZWF0ZWRQcm90b1ABogIDQVhYqgIIQWRtaW4uVjHKAghBZG1pblxWMeICFEFkbWluXFYxXEdQQk1ldGFkYXRh6gIJQWRtaW46OlYxYgZwcm90bzM", [file_google_protobuf_descriptor]);
13
+
14
+ /**
15
+ * Describes the message admin.v1.AdminAccountCreatedPayload.
16
+ * Use `create(AdminAccountCreatedPayloadSchema)` to create a new message.
17
+ */
18
+ export const AdminAccountCreatedPayloadSchema = /*@__PURE__*/
19
+ messageDesc(file_admin_v1_admin_account_created, 0);
20
+
21
+ /**
22
+ * Describes the message admin.v1.AdminAccountCreated.
23
+ * Use `create(AdminAccountCreatedSchema)` to create a new message.
24
+ */
25
+ export const AdminAccountCreatedSchema = /*@__PURE__*/
26
+ messageDesc(file_admin_v1_admin_account_created, 1);
27
+
28
+ /**
29
+ * @generated from extension: string fixed_value = 50001;
30
+ */
31
+ export const fixed_value = /*@__PURE__*/
32
+ extDesc(file_admin_v1_admin_account_created, 0);
33
+
@@ -0,0 +1,94 @@
1
+ // @generated by protoc-gen-es v2.10.0 with parameter "target=js+dts,import_extension=none"
2
+ // @generated from file admin/v1/admin_emai_verification_requested.proto (package admin.v1, syntax proto3)
3
+ /* eslint-disable */
4
+
5
+ import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
6
+ import type { Message } from "@bufbuild/protobuf";
7
+
8
+ /**
9
+ * Describes the file admin/v1/admin_emai_verification_requested.proto.
10
+ */
11
+ export declare const file_admin_v1_admin_emai_verification_requested: GenFile;
12
+
13
+ /**
14
+ * @generated from message admin.v1.AdminEmailVerificationRequestedPayload
15
+ */
16
+ export declare type AdminEmailVerificationRequestedPayload = Message<"admin.v1.AdminEmailVerificationRequestedPayload"> & {
17
+ /**
18
+ * @generated from field: string id = 10;
19
+ */
20
+ id: string;
21
+
22
+ /**
23
+ * @generated from field: string email = 11;
24
+ */
25
+ email: string;
26
+
27
+ /**
28
+ * @generated from field: optional string first_name = 12;
29
+ */
30
+ firstName?: string;
31
+
32
+ /**
33
+ * @generated from field: optional string last_name = 13;
34
+ */
35
+ lastName?: string;
36
+
37
+ /**
38
+ * @generated from field: string verification_token = 14;
39
+ */
40
+ verificationToken: string;
41
+
42
+ /**
43
+ * @generated from field: int64 created_at = 15;
44
+ */
45
+ createdAt: bigint;
46
+ };
47
+
48
+ /**
49
+ * Describes the message admin.v1.AdminEmailVerificationRequestedPayload.
50
+ * Use `create(AdminEmailVerificationRequestedPayloadSchema)` to create a new message.
51
+ */
52
+ export declare const AdminEmailVerificationRequestedPayloadSchema: GenMessage<AdminEmailVerificationRequestedPayload>;
53
+
54
+ /**
55
+ * @generated from message admin.v1.AdminEmailVerificationRequested
56
+ */
57
+ export declare type AdminEmailVerificationRequested = Message<"admin.v1.AdminEmailVerificationRequested"> & {
58
+ /**
59
+ * @generated from field: string event_name = 1;
60
+ */
61
+ eventName: string;
62
+
63
+ /**
64
+ * @generated from field: int32 event_version = 2;
65
+ */
66
+ eventVersion: number;
67
+
68
+ /**
69
+ * @generated from field: string aggregate_id = 3;
70
+ */
71
+ aggregateId: string;
72
+
73
+ /**
74
+ * @generated from field: int64 timestamp = 4;
75
+ */
76
+ timestamp: bigint;
77
+
78
+ /**
79
+ * @generated from field: optional string trace_id = 5;
80
+ */
81
+ traceId?: string;
82
+
83
+ /**
84
+ * @generated from field: admin.v1.AdminEmailVerificationRequestedPayload payload = 9;
85
+ */
86
+ payload?: AdminEmailVerificationRequestedPayload;
87
+ };
88
+
89
+ /**
90
+ * Describes the message admin.v1.AdminEmailVerificationRequested.
91
+ * Use `create(AdminEmailVerificationRequestedSchema)` to create a new message.
92
+ */
93
+ export declare const AdminEmailVerificationRequestedSchema: GenMessage<AdminEmailVerificationRequested>;
94
+
@@ -0,0 +1,26 @@
1
+ // @generated by protoc-gen-es v2.10.0 with parameter "target=js+dts,import_extension=none"
2
+ // @generated from file admin/v1/admin_emai_verification_requested.proto (package admin.v1, syntax proto3)
3
+ /* eslint-disable */
4
+
5
+ import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
6
+
7
+ /**
8
+ * Describes the file admin/v1/admin_emai_verification_requested.proto.
9
+ */
10
+ export const file_admin_v1_admin_emai_verification_requested = /*@__PURE__*/
11
+ fileDesc("CjBhZG1pbi92MS9hZG1pbl9lbWFpX3ZlcmlmaWNhdGlvbl9yZXF1ZXN0ZWQucHJvdG8SCGFkbWluLnYxIsEBCiZBZG1pbkVtYWlsVmVyaWZpY2F0aW9uUmVxdWVzdGVkUGF5bG9hZBIKCgJpZBgKIAEoCRINCgVlbWFpbBgLIAEoCRIXCgpmaXJzdF9uYW1lGAwgASgJSACIAQESFgoJbGFzdF9uYW1lGA0gASgJSAGIAQESGgoSdmVyaWZpY2F0aW9uX3Rva2VuGA4gASgJEhIKCmNyZWF0ZWRfYXQYDyABKANCDQoLX2ZpcnN0X25hbWVCDAoKX2xhc3RfbmFtZSLcAQofQWRtaW5FbWFpbFZlcmlmaWNhdGlvblJlcXVlc3RlZBISCgpldmVudF9uYW1lGAEgASgJEhUKDWV2ZW50X3ZlcnNpb24YAiABKAUSFAoMYWdncmVnYXRlX2lkGAMgASgJEhEKCXRpbWVzdGFtcBgEIAEoAxIVCgh0cmFjZV9pZBgFIAEoCUgAiAEBEkEKB3BheWxvYWQYCSABKAsyMC5hZG1pbi52MS5BZG1pbkVtYWlsVmVyaWZpY2F0aW9uUmVxdWVzdGVkUGF5bG9hZEILCglfdHJhY2VfaWRCdAoMY29tLmFkbWluLnYxQiNBZG1pbkVtYWlWZXJpZmljYXRpb25SZXF1ZXN0ZWRQcm90b1ABogIDQVhYqgIIQWRtaW4uVjHKAghBZG1pblxWMeICFEFkbWluXFYxXEdQQk1ldGFkYXRh6gIJQWRtaW46OlYxYgZwcm90bzM");
12
+
13
+ /**
14
+ * Describes the message admin.v1.AdminEmailVerificationRequestedPayload.
15
+ * Use `create(AdminEmailVerificationRequestedPayloadSchema)` to create a new message.
16
+ */
17
+ export const AdminEmailVerificationRequestedPayloadSchema = /*@__PURE__*/
18
+ messageDesc(file_admin_v1_admin_emai_verification_requested, 0);
19
+
20
+ /**
21
+ * Describes the message admin.v1.AdminEmailVerificationRequested.
22
+ * Use `create(AdminEmailVerificationRequestedSchema)` to create a new message.
23
+ */
24
+ export const AdminEmailVerificationRequestedSchema = /*@__PURE__*/
25
+ messageDesc(file_admin_v1_admin_emai_verification_requested, 1);
26
+
@@ -1 +1,2 @@
1
- export * from './admin_created_pb';
1
+ export * from './admin_account_created_pb';
2
+ export * from './admin_emai_verification_requested_pb';
@@ -1 +1,2 @@
1
- export * from './admin_created_pb';
1
+ export * from './admin_account_created_pb';
2
+ export * from './admin_emai_verification_requested_pb';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@togatherlabs/event-sdk",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Shared Protobuf event schemas and generated code for toGather microservices",
5
5
  "exports": {
6
6
  "./admin/v1": {
@@ -25,6 +25,7 @@
25
25
  "author": "toGather team",
26
26
  "license": "ISC",
27
27
  "devDependencies": {
28
+ "@bufbuild/buf": "^1.58.0",
28
29
  "@commitlint/cli": "^20.1.0",
29
30
  "@commitlint/config-conventional": "^20.0.0",
30
31
  "@commitlint/cz-commitlint": "^20.1.0",
@@ -47,12 +48,15 @@
47
48
  "access": "public"
48
49
  },
49
50
  "scripts": {
51
+ "check": "./script/check-environment.sh",
50
52
  "test": "echo \"Error: no test specified\" && exit 1",
51
53
  "commit": "git-cz",
52
54
  "buf:lint": "buf lint",
53
- "buf:generate": "buf generate && node ./script/gen-index.js",
55
+ "buf:generate": "pnpm check && buf generate && node ./script/gen-index.js && python3 ./script/add-init-files.py",
54
56
  "package:patch": "pnpm version patch",
55
57
  "package:publish": "pnpm publish --access public",
58
+ "python:build": "pnpm check && pnpm buf:generate && node ./script/sync-python-version.js && python3 -m build",
59
+ "python:publish": "rm -rf dist gen && pnpm python:build && python3 -m twine upload dist/* --verbose",
56
60
  "release": "rm -rf gen && pnpm buf:lint && pnpm buf:generate && git add . && pnpm commit && pnpm package:patch && git push --follow-tags && pnpm package:publish"
57
61
  }
58
62
  }
@@ -1,33 +0,0 @@
1
- // @generated by protoc-gen-es v2.10.0 with parameter "target=js+dts,import_extension=none"
2
- // @generated from file admin/v1/admin_created.proto (package admin.v1, syntax proto3)
3
- /* eslint-disable */
4
-
5
- import { extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
6
- import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt";
7
-
8
- /**
9
- * Describes the file admin/v1/admin_created.proto.
10
- */
11
- export const file_admin_v1_admin_created = /*@__PURE__*/
12
- fileDesc("ChxhZG1pbi92MS9hZG1pbl9jcmVhdGVkLnByb3RvEghhZG1pbi52MSJfCgdQYXlsb2FkEgoKAmlkGAogASgJEg0KBWVtYWlsGAsgASgJEhIKCmZpcnN0X25hbWUYDCABKAkSEQoJbGFzdF9uYW1lGA0gASgJEhIKCmNyZWF0ZWRfYXQYDiABKAMiwQEKE0FkbWluQWNjb3VudENyZWF0ZWQSLQoKZXZlbnRfbmFtZRgBIAEoCUIZirUYFWFkbWluLmFjY291bnQuY3JlYXRlZBIcCg1ldmVudF92ZXJzaW9uGAIgASgFQgWKtRgBMRIUCgxhZ2dyZWdhdGVfaWQYAyABKAkSEQoJdGltZXN0YW1wGAQgASgDEhAKCHRyYWNlX2lkGAUgASgJEiIKB3BheWxvYWQYCSABKAsyES5hZG1pbi52MS5QYXlsb2FkOkAKC2ZpeGVkX3ZhbHVlEh0uZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucxjRhgMgASgJUgpmaXhlZFZhbHVlQmIKDGNvbS5hZG1pbi52MUIRQWRtaW5DcmVhdGVkUHJvdG9QAaICA0FYWKoCCEFkbWluLlYxygIIQWRtaW5cVjHiAhRBZG1pblxWMVxHUEJNZXRhZGF0YeoCCUFkbWluOjpWMWIGcHJvdG8z", [file_google_protobuf_descriptor]);
13
-
14
- /**
15
- * Describes the message admin.v1.Payload.
16
- * Use `create(PayloadSchema)` to create a new message.
17
- */
18
- export const PayloadSchema = /*@__PURE__*/
19
- messageDesc(file_admin_v1_admin_created, 0);
20
-
21
- /**
22
- * Describes the message admin.v1.AdminAccountCreated.
23
- * Use `create(AdminAccountCreatedSchema)` to create a new message.
24
- */
25
- export const AdminAccountCreatedSchema = /*@__PURE__*/
26
- messageDesc(file_admin_v1_admin_created, 1);
27
-
28
- /**
29
- * @generated from extension: string fixed_value = 50001;
30
- */
31
- export const fixed_value = /*@__PURE__*/
32
- extDesc(file_admin_v1_admin_created, 0);
33
-