@photon-ai/proto 0.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.
@@ -0,0 +1,93 @@
1
+ // MessageService — the Slack runtime contract for spectrum-ts.
2
+ //
3
+ // See slack.md "Runtime contract (gRPC)" for the full design. Every RPC
4
+ // requires two metadata keys: `access_token` (LightAuth JWT) and `team_id`.
5
+
6
+ // @generated by protoc-gen-es v2.12.0 with parameter "target=js+dts,import_extension=js"
7
+ // @generated from file photon/slack/v1/message_service.proto (package photon.slack.v1, syntax proto3)
8
+ /* eslint-disable */
9
+
10
+ import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
11
+
12
+ /**
13
+ * Describes the file photon/slack/v1/message_service.proto.
14
+ */
15
+ export const file_photon_slack_v1_message_service = /*@__PURE__*/
16
+ fileDesc("CiVwaG90b24vc2xhY2svdjEvbWVzc2FnZV9zZXJ2aWNlLnByb3RvEg9waG90b24uc2xhY2sudjEi2gIKElNlbmRNZXNzYWdlUmVxdWVzdBIPCgdjaGFubmVsGAEgASgJEiwKBHRleHQYCiABKAsyHC5waG90b24uc2xhY2sudjEuVGV4dENvbnRlbnRIABIwCgZibG9ja3MYCyABKAsyHi5waG90b24uc2xhY2sudjEuQmxvY2tzQ29udGVudEgAEjoKC2F0dGFjaG1lbnRzGAwgASgLMiMucGhvdG9uLnNsYWNrLnYxLkF0dGFjaG1lbnRzQ29udGVudEgAEjQKCHJlYWN0aW9uGA0gASgLMiAucGhvdG9uLnNsYWNrLnYxLlJlYWN0aW9uQ29udGVudEgAEhYKCXRocmVhZF90cxgeIAEoCUgBiAEBEhwKD3JlcGx5X2Jyb2FkY2FzdBgfIAEoCEgCiAEBQgkKB2NvbnRlbnRCDAoKX3RocmVhZF90c0ISChBfcmVwbHlfYnJvYWRjYXN0IhsKC1RleHRDb250ZW50EgwKBGJvZHkYASABKAkiOwoNQmxvY2tzQ29udGVudBITCgtibG9ja3NfanNvbhgBIAEoCRIVCg1mYWxsYmFja190ZXh0GAIgASgJIjwKEkF0dGFjaG1lbnRzQ29udGVudBIYChBhdHRhY2htZW50c19qc29uGAEgASgJEgwKBHRleHQYAiABKAkiRwoPUmVhY3Rpb25Db250ZW50Eg8KB2l0ZW1fdHMYASABKAkSFAoMaXRlbV9jaGFubmVsGAIgASgJEg0KBWVtb2ppGAMgASgJIjIKE1NlbmRNZXNzYWdlUmVzcG9uc2USCgoCdHMYASABKAkSDwoHY2hhbm5lbBgCIAEoCSIuCg9NYXJrUmVhZFJlcXVlc3QSDwoHY2hhbm5lbBgBIAEoCRIKCgJ0cxgCIAEoCSISChBNYXJrUmVhZFJlc3BvbnNlIg8KDVdob0FtSVJlcXVlc3QiRgoOV2hvQW1JUmVzcG9uc2USEwoLYm90X3VzZXJfaWQYASABKAkSDwoHdGVhbV9pZBgCIAEoCRIOCgZhcHBfaWQYAyABKAkyhgIKDk1lc3NhZ2VTZXJ2aWNlElgKC1NlbmRNZXNzYWdlEiMucGhvdG9uLnNsYWNrLnYxLlNlbmRNZXNzYWdlUmVxdWVzdBokLnBob3Rvbi5zbGFjay52MS5TZW5kTWVzc2FnZVJlc3BvbnNlEk8KCE1hcmtSZWFkEiAucGhvdG9uLnNsYWNrLnYxLk1hcmtSZWFkUmVxdWVzdBohLnBob3Rvbi5zbGFjay52MS5NYXJrUmVhZFJlc3BvbnNlEkkKBldob0FtSRIeLnBob3Rvbi5zbGFjay52MS5XaG9BbUlSZXF1ZXN0Gh8ucGhvdG9uLnNsYWNrLnYxLldob0FtSVJlc3BvbnNlYgZwcm90bzM");
17
+
18
+ /**
19
+ * Describes the message photon.slack.v1.SendMessageRequest.
20
+ * Use `create(SendMessageRequestSchema)` to create a new message.
21
+ */
22
+ export const SendMessageRequestSchema = /*@__PURE__*/
23
+ messageDesc(file_photon_slack_v1_message_service, 0);
24
+
25
+ /**
26
+ * Describes the message photon.slack.v1.TextContent.
27
+ * Use `create(TextContentSchema)` to create a new message.
28
+ */
29
+ export const TextContentSchema = /*@__PURE__*/
30
+ messageDesc(file_photon_slack_v1_message_service, 1);
31
+
32
+ /**
33
+ * Describes the message photon.slack.v1.BlocksContent.
34
+ * Use `create(BlocksContentSchema)` to create a new message.
35
+ */
36
+ export const BlocksContentSchema = /*@__PURE__*/
37
+ messageDesc(file_photon_slack_v1_message_service, 2);
38
+
39
+ /**
40
+ * Describes the message photon.slack.v1.AttachmentsContent.
41
+ * Use `create(AttachmentsContentSchema)` to create a new message.
42
+ */
43
+ export const AttachmentsContentSchema = /*@__PURE__*/
44
+ messageDesc(file_photon_slack_v1_message_service, 3);
45
+
46
+ /**
47
+ * Describes the message photon.slack.v1.ReactionContent.
48
+ * Use `create(ReactionContentSchema)` to create a new message.
49
+ */
50
+ export const ReactionContentSchema = /*@__PURE__*/
51
+ messageDesc(file_photon_slack_v1_message_service, 4);
52
+
53
+ /**
54
+ * Describes the message photon.slack.v1.SendMessageResponse.
55
+ * Use `create(SendMessageResponseSchema)` to create a new message.
56
+ */
57
+ export const SendMessageResponseSchema = /*@__PURE__*/
58
+ messageDesc(file_photon_slack_v1_message_service, 5);
59
+
60
+ /**
61
+ * Describes the message photon.slack.v1.MarkReadRequest.
62
+ * Use `create(MarkReadRequestSchema)` to create a new message.
63
+ */
64
+ export const MarkReadRequestSchema = /*@__PURE__*/
65
+ messageDesc(file_photon_slack_v1_message_service, 6);
66
+
67
+ /**
68
+ * Describes the message photon.slack.v1.MarkReadResponse.
69
+ * Use `create(MarkReadResponseSchema)` to create a new message.
70
+ */
71
+ export const MarkReadResponseSchema = /*@__PURE__*/
72
+ messageDesc(file_photon_slack_v1_message_service, 7);
73
+
74
+ /**
75
+ * Describes the message photon.slack.v1.WhoAmIRequest.
76
+ * Use `create(WhoAmIRequestSchema)` to create a new message.
77
+ */
78
+ export const WhoAmIRequestSchema = /*@__PURE__*/
79
+ messageDesc(file_photon_slack_v1_message_service, 8);
80
+
81
+ /**
82
+ * Describes the message photon.slack.v1.WhoAmIResponse.
83
+ * Use `create(WhoAmIResponseSchema)` to create a new message.
84
+ */
85
+ export const WhoAmIResponseSchema = /*@__PURE__*/
86
+ messageDesc(file_photon_slack_v1_message_service, 9);
87
+
88
+ /**
89
+ * @generated from service photon.slack.v1.MessageService
90
+ */
91
+ export const MessageService = /*@__PURE__*/
92
+ serviceDesc(file_photon_slack_v1_message_service, 0);
93
+
@@ -0,0 +1,182 @@
1
+ // Cross-channel envelope for raw inbound events as they enter the Spectrum
2
+ // platform.
3
+ //
4
+ // The design promise is "zero server-side payload normalization": each channel
5
+ // adapter (spectrum-slack, spectrum-whatsapp-business, ...) verifies the
6
+ // channel-specific signature, then publishes the original HTTP body bit-exact
7
+ // inside this envelope onto NATS JetStream subject
8
+ // `inbound.<project_id>.<channel>`. Parsers live SDK-side
9
+ // (`@photon-hq/spectrum-parsers-*`), keeping channel shape knowledge at the
10
+ // edges and letting Spectrum add new channels without touching the routing
11
+ // fabric.
12
+ //
13
+ // `body` is bytes (not a string) so callers can transport any encoding without
14
+ // risk of UTF-8 sanitization; `headers` carries the original signature header
15
+ // (X-Slack-Signature, X-Hub-Signature-256, ...) so consumers that want a
16
+ // second proof-of-origin can verify it themselves.
17
+
18
+ // @generated by protoc-gen-es v2.12.0 with parameter "target=js+dts,import_extension=js"
19
+ // @generated from file photon/spectrum/v1/inbound.proto (package photon.spectrum.v1, syntax proto3)
20
+ /* eslint-disable */
21
+
22
+ import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
23
+ import type { Message } from "@bufbuild/protobuf";
24
+ import type { Timestamp } from "@bufbuild/protobuf/wkt";
25
+
26
+ /**
27
+ * Describes the file photon/spectrum/v1/inbound.proto.
28
+ */
29
+ export declare const file_photon_spectrum_v1_inbound: GenFile;
30
+
31
+ /**
32
+ * The minimal envelope every channel adapter agrees on. spectrum-slack
33
+ * produces it from the verified `POST /slack/events` request;
34
+ * spectrum-grpc-fanout consumes it from JetStream and re-emits it to SDK
35
+ * clients verbatim.
36
+ *
37
+ * ── Routing + audit metadata. Low field numbers; cheap to skim. ──
38
+ *
39
+ * @generated from message photon.spectrum.v1.RawInboundEvent
40
+ */
41
+ export declare type RawInboundEvent = Message<"photon.spectrum.v1.RawInboundEvent"> & {
42
+ /**
43
+ * UUIDv7 set by the publisher. Mirrored to the JetStream message's `Nats-Msg-Id`
44
+ * header so the broker's duplicate-detection window collapses Slack retries
45
+ * of the same delivery. SDKs can also use it for end-to-end dedup if they
46
+ * process the same stream twice.
47
+ *
48
+ * @generated from field: string event_id = 1;
49
+ */
50
+ eventId: string;
51
+
52
+ /**
53
+ * Project that owns this event. The first dotted segment after `inbound.`
54
+ * in the NATS subject is derived from this field; consumers filter on it.
55
+ *
56
+ * @generated from field: string project_id = 2;
57
+ */
58
+ projectId: string;
59
+
60
+ /**
61
+ * Which channel adapter produced the event. Same value the NATS subject's
62
+ * third segment encodes (`inbound.<project_id>.slack` for CHANNEL_SLACK).
63
+ *
64
+ * @generated from field: photon.spectrum.v1.Channel channel = 3;
65
+ */
66
+ channel: Channel;
67
+
68
+ /**
69
+ * Wall-clock time the publisher accepted the request. Independent of any
70
+ * timestamp the channel itself supplied inside `body`.
71
+ *
72
+ * @generated from field: google.protobuf.Timestamp received_at = 4;
73
+ */
74
+ receivedAt?: Timestamp | undefined;
75
+
76
+ /**
77
+ * Channel-side identifier for the source that produced the event. For
78
+ * spectrum-slack this is the Slack `api_app_id`; once `webhook_sources`
79
+ * lands in spectrum-cloud it becomes the `ws_…` source id. Optional from
80
+ * the SDK's point of view — useful for audit, not for parsing.
81
+ *
82
+ * @generated from field: string source_id = 5;
83
+ */
84
+ sourceId: string;
85
+
86
+ /**
87
+ * HTTP `Content-Type` of the original request. For Slack: typically
88
+ * `application/json` for event callbacks, `application/x-www-form-urlencoded`
89
+ * for interactive callbacks and slash commands.
90
+ *
91
+ * @generated from field: string content_type = 10;
92
+ */
93
+ contentType: string;
94
+
95
+ /**
96
+ * The raw HTTP body, byte-for-byte as the channel delivered it. NEVER
97
+ * re-serialized — HMAC verification on the consumer side needs the exact
98
+ * bytes the channel signed.
99
+ *
100
+ * @generated from field: bytes body = 11;
101
+ */
102
+ body: Uint8Array;
103
+
104
+ /**
105
+ * Subset of original HTTP request headers the publisher chose to preserve.
106
+ * Always includes the channel's signature pair (e.g. `X-Slack-Signature`
107
+ * + `X-Slack-Request-Timestamp`) so a downstream consumer can re-verify if
108
+ * it wants a second independent check. Casing matches what the channel
109
+ * sent — do not normalize.
110
+ *
111
+ * @generated from field: map<string, string> headers = 12;
112
+ */
113
+ headers: { [key: string]: string };
114
+
115
+ /**
116
+ * Path of the original HTTP request (e.g. `/slack/events`). Audit-only;
117
+ * parsers should not branch on it.
118
+ *
119
+ * @generated from field: string source_path = 13;
120
+ */
121
+ sourcePath: string;
122
+
123
+ /**
124
+ * HTTP method of the original request (always `POST` today; reserved for
125
+ * future protocols).
126
+ *
127
+ * @generated from field: string http_method = 14;
128
+ */
129
+ httpMethod: string;
130
+ };
131
+
132
+ /**
133
+ * Describes the message photon.spectrum.v1.RawInboundEvent.
134
+ * Use `create(RawInboundEventSchema)` to create a new message.
135
+ */
136
+ export declare const RawInboundEventSchema: GenMessage<RawInboundEvent>;
137
+
138
+ /**
139
+ * Wire identifier for the source channel that produced an event. Used as the
140
+ * third segment of the NATS subject (`inbound.<project_id>.<channel>`) and as
141
+ * a stable discriminator for SDK-side parsers — adding a new channel reserves
142
+ * a new enum value rather than introducing a new top-level message.
143
+ *
144
+ * @generated from enum photon.spectrum.v1.Channel
145
+ */
146
+ export enum Channel {
147
+ /**
148
+ * @generated from enum value: CHANNEL_UNSPECIFIED = 0;
149
+ */
150
+ UNSPECIFIED = 0,
151
+
152
+ /**
153
+ * @generated from enum value: CHANNEL_SLACK = 1;
154
+ */
155
+ SLACK = 1,
156
+
157
+ /**
158
+ * @generated from enum value: CHANNEL_IMESSAGE = 2;
159
+ */
160
+ IMESSAGE = 2,
161
+
162
+ /**
163
+ * @generated from enum value: CHANNEL_WHATSAPP_BUSINESS = 3;
164
+ */
165
+ WHATSAPP_BUSINESS = 3,
166
+
167
+ /**
168
+ * @generated from enum value: CHANNEL_VOICE = 4;
169
+ */
170
+ VOICE = 4,
171
+
172
+ /**
173
+ * @generated from enum value: CHANNEL_SIP = 5;
174
+ */
175
+ SIP = 5,
176
+ }
177
+
178
+ /**
179
+ * Describes the enum photon.spectrum.v1.Channel.
180
+ */
181
+ export declare const ChannelSchema: GenEnum<Channel>;
182
+
@@ -0,0 +1,54 @@
1
+ // Cross-channel envelope for raw inbound events as they enter the Spectrum
2
+ // platform.
3
+ //
4
+ // The design promise is "zero server-side payload normalization": each channel
5
+ // adapter (spectrum-slack, spectrum-whatsapp-business, ...) verifies the
6
+ // channel-specific signature, then publishes the original HTTP body bit-exact
7
+ // inside this envelope onto NATS JetStream subject
8
+ // `inbound.<project_id>.<channel>`. Parsers live SDK-side
9
+ // (`@photon-hq/spectrum-parsers-*`), keeping channel shape knowledge at the
10
+ // edges and letting Spectrum add new channels without touching the routing
11
+ // fabric.
12
+ //
13
+ // `body` is bytes (not a string) so callers can transport any encoding without
14
+ // risk of UTF-8 sanitization; `headers` carries the original signature header
15
+ // (X-Slack-Signature, X-Hub-Signature-256, ...) so consumers that want a
16
+ // second proof-of-origin can verify it themselves.
17
+
18
+ // @generated by protoc-gen-es v2.12.0 with parameter "target=js+dts,import_extension=js"
19
+ // @generated from file photon/spectrum/v1/inbound.proto (package photon.spectrum.v1, syntax proto3)
20
+ /* eslint-disable */
21
+
22
+ import { enumDesc, fileDesc, messageDesc, tsEnum } from "@bufbuild/protobuf/codegenv2";
23
+ import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
24
+
25
+ /**
26
+ * Describes the file photon/spectrum/v1/inbound.proto.
27
+ */
28
+ export const file_photon_spectrum_v1_inbound = /*@__PURE__*/
29
+ fileDesc("CiBwaG90b24vc3BlY3RydW0vdjEvaW5ib3VuZC5wcm90bxIScGhvdG9uLnNwZWN0cnVtLnYxIuoCCg9SYXdJbmJvdW5kRXZlbnQSEAoIZXZlbnRfaWQYASABKAkSEgoKcHJvamVjdF9pZBgCIAEoCRIsCgdjaGFubmVsGAMgASgOMhsucGhvdG9uLnNwZWN0cnVtLnYxLkNoYW5uZWwSLwoLcmVjZWl2ZWRfYXQYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhEKCXNvdXJjZV9pZBgFIAEoCRIUCgxjb250ZW50X3R5cGUYCiABKAkSDAoEYm9keRgLIAEoDBJBCgdoZWFkZXJzGAwgAygLMjAucGhvdG9uLnNwZWN0cnVtLnYxLlJhd0luYm91bmRFdmVudC5IZWFkZXJzRW50cnkSEwoLc291cmNlX3BhdGgYDSABKAkSEwoLaHR0cF9tZXRob2QYDiABKAkaLgoMSGVhZGVyc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEqjgEKB0NoYW5uZWwSFwoTQ0hBTk5FTF9VTlNQRUNJRklFRBAAEhEKDUNIQU5ORUxfU0xBQ0sQARIUChBDSEFOTkVMX0lNRVNTQUdFEAISHQoZQ0hBTk5FTF9XSEFUU0FQUF9CVVNJTkVTUxADEhEKDUNIQU5ORUxfVk9JQ0UQBBIPCgtDSEFOTkVMX1NJUBAFYgZwcm90bzM", [file_google_protobuf_timestamp]);
30
+
31
+ /**
32
+ * Describes the message photon.spectrum.v1.RawInboundEvent.
33
+ * Use `create(RawInboundEventSchema)` to create a new message.
34
+ */
35
+ export const RawInboundEventSchema = /*@__PURE__*/
36
+ messageDesc(file_photon_spectrum_v1_inbound, 0);
37
+
38
+ /**
39
+ * Describes the enum photon.spectrum.v1.Channel.
40
+ */
41
+ export const ChannelSchema = /*@__PURE__*/
42
+ enumDesc(file_photon_spectrum_v1_inbound, 0);
43
+
44
+ /**
45
+ * Wire identifier for the source channel that produced an event. Used as the
46
+ * third segment of the NATS subject (`inbound.<project_id>.<channel>`) and as
47
+ * a stable discriminator for SDK-side parsers — adding a new channel reserves
48
+ * a new enum value rather than introducing a new top-level message.
49
+ *
50
+ * @generated from enum photon.spectrum.v1.Channel
51
+ */
52
+ export const Channel = /*@__PURE__*/
53
+ tsEnum(ChannelSchema);
54
+
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@photon-ai/proto",
3
+ "version": "0.0.0",
4
+ "description": "Generated TypeScript bindings for photon.slack.v1 and photon.spectrum.v1 gRPC services.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "files": ["gen/"],
8
+ "exports": {
9
+ "./*": {
10
+ "types": "./gen/*.d.ts",
11
+ "default": "./gen/*.js"
12
+ }
13
+ },
14
+ "dependencies": {
15
+ "@bufbuild/protobuf": "^2.12.0"
16
+ },
17
+ "devDependencies": {
18
+ "@bufbuild/buf": "^1.69.0"
19
+ },
20
+ "scripts": {
21
+ "generate": "buf generate",
22
+ "prepublishOnly": "npm run generate"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/photon-hq/spectrum-slack-buf.git",
30
+ "directory": "public"
31
+ },
32
+ "license": "MIT"
33
+ }