@replit/protocol 0.4.20 → 0.4.23-dev.1

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 (40) hide show
  1. package/README.md +54 -0
  2. package/dist/api/client.d.ts +202 -0
  3. package/dist/api/client.js +394 -0
  4. package/dist/api/features/features.d.ts +112 -0
  5. package/dist/api/features/features.js +199 -0
  6. package/dist/api/lore/lore.d.ts +543 -0
  7. package/dist/api/lore/lore.js +982 -0
  8. package/dist/api/lore/service.client.d.ts +283 -0
  9. package/dist/api/lore/service.client.js +172 -0
  10. package/dist/api/lore/service.d.ts +1093 -0
  11. package/dist/api/lore/service.js +2271 -0
  12. package/dist/api/powerup.d.ts +147 -0
  13. package/dist/api/powerup.js +286 -0
  14. package/dist/api/repl/repl.d.ts +552 -0
  15. package/dist/api/repl/repl.js +787 -0
  16. package/dist/api/signing.d.ts +618 -0
  17. package/dist/api/signing.js +785 -0
  18. package/dist/api/token/token.d.ts +335 -0
  19. package/dist/api/token/token.js +463 -0
  20. package/dist/api/types.d.ts +8633 -0
  21. package/dist/api/types.js +17229 -0
  22. package/dist/google/protobuf/empty.d.ts +31 -0
  23. package/dist/google/protobuf/empty.js +41 -0
  24. package/dist/google/protobuf/field_mask.d.ts +239 -0
  25. package/dist/google/protobuf/field_mask.js +83 -0
  26. package/dist/google/protobuf/struct.d.ts +186 -0
  27. package/dist/google/protobuf/struct.js +337 -0
  28. package/dist/google/protobuf/timestamp.d.ts +155 -0
  29. package/dist/google/protobuf/timestamp.js +132 -0
  30. package/dist/index.d.ts +13 -0
  31. package/dist/index.js +16 -0
  32. package/dist/package.json +3 -0
  33. package/iotester/index.d.ts +2 -7
  34. package/iotester/index.js +9 -12
  35. package/main/index.d.ts +2 -7
  36. package/main/index.js +9 -12
  37. package/package.json +48 -8
  38. package/gen.sh +0 -51
  39. package/jsdoc.js +0 -171
  40. package/pnpm-workspace.yaml +0 -6
package/README.md CHANGED
@@ -1,3 +1,57 @@
1
+ # @replit/protocol
2
+
3
+ JavaScript/TypeScript bindings for the Replit protocol.
4
+
5
+ ## Tree-Shakeable ESM Build
6
+
7
+ This package now includes a tree-shakeable ES Module build alongside the existing CommonJS build.
8
+
9
+ ### Usage
10
+
11
+ **Legacy namespace imports (default, fully backward compatible):**
12
+ ```typescript
13
+ import { api } from '@replit/protocol';
14
+
15
+ // Access types via namespace
16
+ const target = api.DeploymentConfig.Target.VM;
17
+ const token = api.token.ReplToken.create({ ... });
18
+ ```
19
+
20
+ This is the default import and works in all environments without configuration changes.
21
+
22
+ **Tree-shakeable ESM imports (recommended for new code in Next.js apps):**
23
+ ```typescript
24
+ import { Persistence, ReplToken_WireFormat, Timestamp } from '@replit/protocol/esm';
25
+
26
+ // Direct access to types
27
+ const persistence: Persistence = Persistence.NONE;
28
+ const format: ReplToken_WireFormat = ReplToken_WireFormat.PROTOBUF;
29
+ ```
30
+
31
+ ⚠️ **Note**: ESM imports require adding `@replit/protocol` to `transpilePackages` in `next.config.js`:
32
+ ```javascript
33
+ transpilePackages: ['@replit/protocol', /* other packages */]
34
+ ```
35
+
36
+ **CommonJS (Node.js require):**
37
+ ```typescript
38
+ const { api } = require('@replit/protocol');
39
+ const { Command } = api;
40
+ ```
41
+
42
+ ### Bundle Size Impact
43
+
44
+ The ESM build enables ~80-90% bundle size reduction through tree-shaking:
45
+ - **Full bundle**: ~848 KB
46
+ - **Single type import**: ~23 KB (96% reduction)
47
+
48
+ ### Key Differences
49
+
50
+ - **Legacy namespace** (`@replit/protocol`): Uses `api.token.ReplToken`, imports everything
51
+ - **ESM direct imports** (`@replit/protocol/esm`): Uses `ReplToken_WireFormat`, tree-shakeable
52
+ - ESM uses protobuf-ts with `toBinary()`/`fromBinary()` instead of `encode()`/`decode()`
53
+ - ESM uses native `BigInt` instead of Long.js
54
+
1
55
  # Developing
2
56
  * Change goval/api/types.proto
3
57
  * In this directory:
@@ -0,0 +1,202 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import { MessageType } from "@protobuf-ts/runtime";
7
+ import { Metadata } from "./repl/repl.js";
8
+ import { ResourceLimits } from "./repl/repl.js";
9
+ import { Repl } from "./repl/repl.js";
10
+ /**
11
+ * TLSCertificate is a SSL/TLS certificate for a specific domain. This is used
12
+ * to transfer certificates between clusters when a repl is transferred so we do
13
+ * not need to request a new certificate in the new cluster.
14
+ *
15
+ * @generated from protobuf message replit.goval.api.TLSCertificate
16
+ */
17
+ export interface TLSCertificate {
18
+ /**
19
+ * @generated from protobuf field: string domain = 1
20
+ */
21
+ domain: string;
22
+ /**
23
+ * @generated from protobuf field: bytes cert = 2
24
+ */
25
+ cert: Uint8Array;
26
+ }
27
+ /**
28
+ * ReplTransfer includes all the data needed to transfer a repl between
29
+ * clusters.
30
+ *
31
+ * @generated from protobuf message replit.goval.api.ReplTransfer
32
+ */
33
+ export interface ReplTransfer {
34
+ /**
35
+ * @generated from protobuf field: replit.goval.api.repl.Repl repl = 1
36
+ */
37
+ repl?: Repl;
38
+ /**
39
+ * @generated from protobuf field: replit.goval.api.repl.ResourceLimits replLimits = 2
40
+ */
41
+ replLimits?: ResourceLimits;
42
+ /**
43
+ * @generated from protobuf field: replit.goval.api.repl.ResourceLimits userLimits = 3
44
+ */
45
+ userLimits?: ResourceLimits;
46
+ /**
47
+ * @generated from protobuf field: repeated string customDomains = 4
48
+ */
49
+ customDomains: string[];
50
+ /**
51
+ * @generated from protobuf field: repeated replit.goval.api.TLSCertificate certificates = 5
52
+ */
53
+ certificates: TLSCertificate[];
54
+ /**
55
+ * @generated from protobuf field: repeated string flags = 6
56
+ */
57
+ flags: string[];
58
+ /**
59
+ * @generated from protobuf field: replit.goval.api.repl.Metadata metadata = 7
60
+ */
61
+ metadata?: Metadata;
62
+ }
63
+ /**
64
+ * AllowReplRequest represents a request to allow a repl into a cluster.
65
+ *
66
+ * @generated from protobuf message replit.goval.api.AllowReplRequest
67
+ */
68
+ export interface AllowReplRequest {
69
+ /**
70
+ * @generated from protobuf field: replit.goval.api.ReplTransfer replTransfer = 1
71
+ */
72
+ replTransfer?: ReplTransfer;
73
+ }
74
+ /**
75
+ * ClusterMetadata represents all the metadata Lore knows about a cluster. This
76
+ * includes all endpoints needed to communicate with the cluster.
77
+ *
78
+ * @generated from protobuf message replit.goval.api.ClusterMetadata
79
+ */
80
+ export interface ClusterMetadata {
81
+ /**
82
+ * @generated from protobuf field: string id = 1
83
+ */
84
+ id: string;
85
+ /**
86
+ * @generated from protobuf field: string conmanURL = 2
87
+ */
88
+ conmanURL: string;
89
+ /**
90
+ * @generated from protobuf field: string gurl = 3
91
+ */
92
+ gurl: string;
93
+ /**
94
+ * @generated from protobuf field: string proxy = 5
95
+ */
96
+ proxy: string;
97
+ /**
98
+ * @generated from protobuf field: string continent = 7
99
+ */
100
+ continent: string;
101
+ }
102
+ /**
103
+ * EvictReplRequest represents a request to evict a repl from a cluster.
104
+ * Includes the metadata about the repl that will be evicted and a token in
105
+ * case conman needs to forward this request to another instance.
106
+ *
107
+ * @generated from protobuf message replit.goval.api.EvictReplRequest
108
+ */
109
+ export interface EvictReplRequest {
110
+ /**
111
+ * @generated from protobuf field: replit.goval.api.ClusterMetadata clusterMetadata = 1
112
+ */
113
+ clusterMetadata?: ClusterMetadata;
114
+ /**
115
+ * @generated from protobuf field: string token = 2
116
+ */
117
+ token: string;
118
+ /**
119
+ * User and slug are sent so that a repl route can be added even if the
120
+ * cluster doesn't have metadata for this repl.
121
+ *
122
+ * @generated from protobuf field: string user = 3
123
+ */
124
+ user: string;
125
+ /**
126
+ * @generated from protobuf field: string slug = 4
127
+ */
128
+ slug: string;
129
+ }
130
+ /**
131
+ * EvictReplResponse represents a response after evicting a repl from a cluster
132
+ * and includes metadata about the repl that was evicted.
133
+ *
134
+ * @generated from protobuf message replit.goval.api.EvictReplResponse
135
+ */
136
+ export interface EvictReplResponse {
137
+ /**
138
+ * @generated from protobuf field: replit.goval.api.ReplTransfer replTransfer = 1
139
+ */
140
+ replTransfer?: ReplTransfer;
141
+ }
142
+ declare class TLSCertificate$Type extends MessageType<TLSCertificate> {
143
+ constructor();
144
+ create(value?: PartialMessage<TLSCertificate>): TLSCertificate;
145
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TLSCertificate): TLSCertificate;
146
+ internalBinaryWrite(message: TLSCertificate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
147
+ }
148
+ /**
149
+ * @generated MessageType for protobuf message replit.goval.api.TLSCertificate
150
+ */
151
+ export declare const TLSCertificate: TLSCertificate$Type;
152
+ declare class ReplTransfer$Type extends MessageType<ReplTransfer> {
153
+ constructor();
154
+ create(value?: PartialMessage<ReplTransfer>): ReplTransfer;
155
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReplTransfer): ReplTransfer;
156
+ internalBinaryWrite(message: ReplTransfer, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
157
+ }
158
+ /**
159
+ * @generated MessageType for protobuf message replit.goval.api.ReplTransfer
160
+ */
161
+ export declare const ReplTransfer: ReplTransfer$Type;
162
+ declare class AllowReplRequest$Type extends MessageType<AllowReplRequest> {
163
+ constructor();
164
+ create(value?: PartialMessage<AllowReplRequest>): AllowReplRequest;
165
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AllowReplRequest): AllowReplRequest;
166
+ internalBinaryWrite(message: AllowReplRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
167
+ }
168
+ /**
169
+ * @generated MessageType for protobuf message replit.goval.api.AllowReplRequest
170
+ */
171
+ export declare const AllowReplRequest: AllowReplRequest$Type;
172
+ declare class ClusterMetadata$Type extends MessageType<ClusterMetadata> {
173
+ constructor();
174
+ create(value?: PartialMessage<ClusterMetadata>): ClusterMetadata;
175
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ClusterMetadata): ClusterMetadata;
176
+ internalBinaryWrite(message: ClusterMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
177
+ }
178
+ /**
179
+ * @generated MessageType for protobuf message replit.goval.api.ClusterMetadata
180
+ */
181
+ export declare const ClusterMetadata: ClusterMetadata$Type;
182
+ declare class EvictReplRequest$Type extends MessageType<EvictReplRequest> {
183
+ constructor();
184
+ create(value?: PartialMessage<EvictReplRequest>): EvictReplRequest;
185
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EvictReplRequest): EvictReplRequest;
186
+ internalBinaryWrite(message: EvictReplRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
187
+ }
188
+ /**
189
+ * @generated MessageType for protobuf message replit.goval.api.EvictReplRequest
190
+ */
191
+ export declare const EvictReplRequest: EvictReplRequest$Type;
192
+ declare class EvictReplResponse$Type extends MessageType<EvictReplResponse> {
193
+ constructor();
194
+ create(value?: PartialMessage<EvictReplResponse>): EvictReplResponse;
195
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EvictReplResponse): EvictReplResponse;
196
+ internalBinaryWrite(message: EvictReplResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
197
+ }
198
+ /**
199
+ * @generated MessageType for protobuf message replit.goval.api.EvictReplResponse
200
+ */
201
+ export declare const EvictReplResponse: EvictReplResponse$Type;
202
+ export {};
@@ -0,0 +1,394 @@
1
+ import { WireType } from "@protobuf-ts/runtime";
2
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
3
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
4
+ import { MessageType } from "@protobuf-ts/runtime";
5
+ import { Metadata } from "./repl/repl.js";
6
+ import { ResourceLimits } from "./repl/repl.js";
7
+ import { Repl } from "./repl/repl.js";
8
+ // @generated message type with reflection information, may provide speed optimized methods
9
+ class TLSCertificate$Type extends MessageType {
10
+ constructor() {
11
+ super("replit.goval.api.TLSCertificate", [
12
+ { no: 1, name: "domain", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
13
+ { no: 2, name: "cert", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
14
+ ]);
15
+ }
16
+ create(value) {
17
+ const message = globalThis.Object.create((this.messagePrototype));
18
+ message.domain = "";
19
+ message.cert = new Uint8Array(0);
20
+ if (value !== undefined)
21
+ reflectionMergePartial(this, message, value);
22
+ return message;
23
+ }
24
+ internalBinaryRead(reader, length, options, target) {
25
+ let message = target ?? this.create(), end = reader.pos + length;
26
+ while (reader.pos < end) {
27
+ let [fieldNo, wireType] = reader.tag();
28
+ switch (fieldNo) {
29
+ case /* string domain */ 1:
30
+ message.domain = reader.string();
31
+ break;
32
+ case /* bytes cert */ 2:
33
+ message.cert = reader.bytes();
34
+ break;
35
+ default:
36
+ let u = options.readUnknownField;
37
+ if (u === "throw")
38
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
39
+ let d = reader.skip(wireType);
40
+ if (u !== false)
41
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
42
+ }
43
+ }
44
+ return message;
45
+ }
46
+ internalBinaryWrite(message, writer, options) {
47
+ /* string domain = 1; */
48
+ if (message.domain !== "")
49
+ writer.tag(1, WireType.LengthDelimited).string(message.domain);
50
+ /* bytes cert = 2; */
51
+ if (message.cert.length)
52
+ writer.tag(2, WireType.LengthDelimited).bytes(message.cert);
53
+ let u = options.writeUnknownFields;
54
+ if (u !== false)
55
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
56
+ return writer;
57
+ }
58
+ }
59
+ /**
60
+ * @generated MessageType for protobuf message replit.goval.api.TLSCertificate
61
+ */
62
+ export const TLSCertificate = new TLSCertificate$Type();
63
+ // @generated message type with reflection information, may provide speed optimized methods
64
+ class ReplTransfer$Type extends MessageType {
65
+ constructor() {
66
+ super("replit.goval.api.ReplTransfer", [
67
+ { no: 1, name: "repl", kind: "message", T: () => Repl },
68
+ { no: 2, name: "replLimits", kind: "message", T: () => ResourceLimits },
69
+ { no: 3, name: "userLimits", kind: "message", T: () => ResourceLimits },
70
+ { no: 4, name: "customDomains", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
71
+ { no: 5, name: "certificates", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => TLSCertificate },
72
+ { no: 6, name: "flags", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
73
+ { no: 7, name: "metadata", kind: "message", T: () => Metadata }
74
+ ]);
75
+ }
76
+ create(value) {
77
+ const message = globalThis.Object.create((this.messagePrototype));
78
+ message.customDomains = [];
79
+ message.certificates = [];
80
+ message.flags = [];
81
+ if (value !== undefined)
82
+ reflectionMergePartial(this, message, value);
83
+ return message;
84
+ }
85
+ internalBinaryRead(reader, length, options, target) {
86
+ let message = target ?? this.create(), end = reader.pos + length;
87
+ while (reader.pos < end) {
88
+ let [fieldNo, wireType] = reader.tag();
89
+ switch (fieldNo) {
90
+ case /* replit.goval.api.repl.Repl repl */ 1:
91
+ message.repl = Repl.internalBinaryRead(reader, reader.uint32(), options, message.repl);
92
+ break;
93
+ case /* replit.goval.api.repl.ResourceLimits replLimits */ 2:
94
+ message.replLimits = ResourceLimits.internalBinaryRead(reader, reader.uint32(), options, message.replLimits);
95
+ break;
96
+ case /* replit.goval.api.repl.ResourceLimits userLimits */ 3:
97
+ message.userLimits = ResourceLimits.internalBinaryRead(reader, reader.uint32(), options, message.userLimits);
98
+ break;
99
+ case /* repeated string customDomains */ 4:
100
+ message.customDomains.push(reader.string());
101
+ break;
102
+ case /* repeated replit.goval.api.TLSCertificate certificates */ 5:
103
+ message.certificates.push(TLSCertificate.internalBinaryRead(reader, reader.uint32(), options));
104
+ break;
105
+ case /* repeated string flags */ 6:
106
+ message.flags.push(reader.string());
107
+ break;
108
+ case /* replit.goval.api.repl.Metadata metadata */ 7:
109
+ message.metadata = Metadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata);
110
+ break;
111
+ default:
112
+ let u = options.readUnknownField;
113
+ if (u === "throw")
114
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
115
+ let d = reader.skip(wireType);
116
+ if (u !== false)
117
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
118
+ }
119
+ }
120
+ return message;
121
+ }
122
+ internalBinaryWrite(message, writer, options) {
123
+ /* replit.goval.api.repl.Repl repl = 1; */
124
+ if (message.repl)
125
+ Repl.internalBinaryWrite(message.repl, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
126
+ /* replit.goval.api.repl.ResourceLimits replLimits = 2; */
127
+ if (message.replLimits)
128
+ ResourceLimits.internalBinaryWrite(message.replLimits, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
129
+ /* replit.goval.api.repl.ResourceLimits userLimits = 3; */
130
+ if (message.userLimits)
131
+ ResourceLimits.internalBinaryWrite(message.userLimits, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
132
+ /* repeated string customDomains = 4; */
133
+ for (let i = 0; i < message.customDomains.length; i++)
134
+ writer.tag(4, WireType.LengthDelimited).string(message.customDomains[i]);
135
+ /* repeated replit.goval.api.TLSCertificate certificates = 5; */
136
+ for (let i = 0; i < message.certificates.length; i++)
137
+ TLSCertificate.internalBinaryWrite(message.certificates[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
138
+ /* repeated string flags = 6; */
139
+ for (let i = 0; i < message.flags.length; i++)
140
+ writer.tag(6, WireType.LengthDelimited).string(message.flags[i]);
141
+ /* replit.goval.api.repl.Metadata metadata = 7; */
142
+ if (message.metadata)
143
+ Metadata.internalBinaryWrite(message.metadata, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
144
+ let u = options.writeUnknownFields;
145
+ if (u !== false)
146
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
147
+ return writer;
148
+ }
149
+ }
150
+ /**
151
+ * @generated MessageType for protobuf message replit.goval.api.ReplTransfer
152
+ */
153
+ export const ReplTransfer = new ReplTransfer$Type();
154
+ // @generated message type with reflection information, may provide speed optimized methods
155
+ class AllowReplRequest$Type extends MessageType {
156
+ constructor() {
157
+ super("replit.goval.api.AllowReplRequest", [
158
+ { no: 1, name: "replTransfer", kind: "message", T: () => ReplTransfer }
159
+ ]);
160
+ }
161
+ create(value) {
162
+ const message = globalThis.Object.create((this.messagePrototype));
163
+ if (value !== undefined)
164
+ reflectionMergePartial(this, message, value);
165
+ return message;
166
+ }
167
+ internalBinaryRead(reader, length, options, target) {
168
+ let message = target ?? this.create(), end = reader.pos + length;
169
+ while (reader.pos < end) {
170
+ let [fieldNo, wireType] = reader.tag();
171
+ switch (fieldNo) {
172
+ case /* replit.goval.api.ReplTransfer replTransfer */ 1:
173
+ message.replTransfer = ReplTransfer.internalBinaryRead(reader, reader.uint32(), options, message.replTransfer);
174
+ break;
175
+ default:
176
+ let u = options.readUnknownField;
177
+ if (u === "throw")
178
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
179
+ let d = reader.skip(wireType);
180
+ if (u !== false)
181
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
182
+ }
183
+ }
184
+ return message;
185
+ }
186
+ internalBinaryWrite(message, writer, options) {
187
+ /* replit.goval.api.ReplTransfer replTransfer = 1; */
188
+ if (message.replTransfer)
189
+ ReplTransfer.internalBinaryWrite(message.replTransfer, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
190
+ let u = options.writeUnknownFields;
191
+ if (u !== false)
192
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
193
+ return writer;
194
+ }
195
+ }
196
+ /**
197
+ * @generated MessageType for protobuf message replit.goval.api.AllowReplRequest
198
+ */
199
+ export const AllowReplRequest = new AllowReplRequest$Type();
200
+ // @generated message type with reflection information, may provide speed optimized methods
201
+ class ClusterMetadata$Type extends MessageType {
202
+ constructor() {
203
+ super("replit.goval.api.ClusterMetadata", [
204
+ { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
205
+ { no: 2, name: "conmanURL", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
206
+ { no: 3, name: "gurl", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
207
+ { no: 5, name: "proxy", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
208
+ { no: 7, name: "continent", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
209
+ ]);
210
+ }
211
+ create(value) {
212
+ const message = globalThis.Object.create((this.messagePrototype));
213
+ message.id = "";
214
+ message.conmanURL = "";
215
+ message.gurl = "";
216
+ message.proxy = "";
217
+ message.continent = "";
218
+ if (value !== undefined)
219
+ reflectionMergePartial(this, message, value);
220
+ return message;
221
+ }
222
+ internalBinaryRead(reader, length, options, target) {
223
+ let message = target ?? this.create(), end = reader.pos + length;
224
+ while (reader.pos < end) {
225
+ let [fieldNo, wireType] = reader.tag();
226
+ switch (fieldNo) {
227
+ case /* string id */ 1:
228
+ message.id = reader.string();
229
+ break;
230
+ case /* string conmanURL */ 2:
231
+ message.conmanURL = reader.string();
232
+ break;
233
+ case /* string gurl */ 3:
234
+ message.gurl = reader.string();
235
+ break;
236
+ case /* string proxy */ 5:
237
+ message.proxy = reader.string();
238
+ break;
239
+ case /* string continent */ 7:
240
+ message.continent = reader.string();
241
+ break;
242
+ default:
243
+ let u = options.readUnknownField;
244
+ if (u === "throw")
245
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
246
+ let d = reader.skip(wireType);
247
+ if (u !== false)
248
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
249
+ }
250
+ }
251
+ return message;
252
+ }
253
+ internalBinaryWrite(message, writer, options) {
254
+ /* string id = 1; */
255
+ if (message.id !== "")
256
+ writer.tag(1, WireType.LengthDelimited).string(message.id);
257
+ /* string conmanURL = 2; */
258
+ if (message.conmanURL !== "")
259
+ writer.tag(2, WireType.LengthDelimited).string(message.conmanURL);
260
+ /* string gurl = 3; */
261
+ if (message.gurl !== "")
262
+ writer.tag(3, WireType.LengthDelimited).string(message.gurl);
263
+ /* string proxy = 5; */
264
+ if (message.proxy !== "")
265
+ writer.tag(5, WireType.LengthDelimited).string(message.proxy);
266
+ /* string continent = 7; */
267
+ if (message.continent !== "")
268
+ writer.tag(7, WireType.LengthDelimited).string(message.continent);
269
+ let u = options.writeUnknownFields;
270
+ if (u !== false)
271
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
272
+ return writer;
273
+ }
274
+ }
275
+ /**
276
+ * @generated MessageType for protobuf message replit.goval.api.ClusterMetadata
277
+ */
278
+ export const ClusterMetadata = new ClusterMetadata$Type();
279
+ // @generated message type with reflection information, may provide speed optimized methods
280
+ class EvictReplRequest$Type extends MessageType {
281
+ constructor() {
282
+ super("replit.goval.api.EvictReplRequest", [
283
+ { no: 1, name: "clusterMetadata", kind: "message", T: () => ClusterMetadata },
284
+ { no: 2, name: "token", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
285
+ { no: 3, name: "user", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
286
+ { no: 4, name: "slug", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
287
+ ]);
288
+ }
289
+ create(value) {
290
+ const message = globalThis.Object.create((this.messagePrototype));
291
+ message.token = "";
292
+ message.user = "";
293
+ message.slug = "";
294
+ if (value !== undefined)
295
+ reflectionMergePartial(this, message, value);
296
+ return message;
297
+ }
298
+ internalBinaryRead(reader, length, options, target) {
299
+ let message = target ?? this.create(), end = reader.pos + length;
300
+ while (reader.pos < end) {
301
+ let [fieldNo, wireType] = reader.tag();
302
+ switch (fieldNo) {
303
+ case /* replit.goval.api.ClusterMetadata clusterMetadata */ 1:
304
+ message.clusterMetadata = ClusterMetadata.internalBinaryRead(reader, reader.uint32(), options, message.clusterMetadata);
305
+ break;
306
+ case /* string token */ 2:
307
+ message.token = reader.string();
308
+ break;
309
+ case /* string user */ 3:
310
+ message.user = reader.string();
311
+ break;
312
+ case /* string slug */ 4:
313
+ message.slug = reader.string();
314
+ break;
315
+ default:
316
+ let u = options.readUnknownField;
317
+ if (u === "throw")
318
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
319
+ let d = reader.skip(wireType);
320
+ if (u !== false)
321
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
322
+ }
323
+ }
324
+ return message;
325
+ }
326
+ internalBinaryWrite(message, writer, options) {
327
+ /* replit.goval.api.ClusterMetadata clusterMetadata = 1; */
328
+ if (message.clusterMetadata)
329
+ ClusterMetadata.internalBinaryWrite(message.clusterMetadata, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
330
+ /* string token = 2; */
331
+ if (message.token !== "")
332
+ writer.tag(2, WireType.LengthDelimited).string(message.token);
333
+ /* string user = 3; */
334
+ if (message.user !== "")
335
+ writer.tag(3, WireType.LengthDelimited).string(message.user);
336
+ /* string slug = 4; */
337
+ if (message.slug !== "")
338
+ writer.tag(4, WireType.LengthDelimited).string(message.slug);
339
+ let u = options.writeUnknownFields;
340
+ if (u !== false)
341
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
342
+ return writer;
343
+ }
344
+ }
345
+ /**
346
+ * @generated MessageType for protobuf message replit.goval.api.EvictReplRequest
347
+ */
348
+ export const EvictReplRequest = new EvictReplRequest$Type();
349
+ // @generated message type with reflection information, may provide speed optimized methods
350
+ class EvictReplResponse$Type extends MessageType {
351
+ constructor() {
352
+ super("replit.goval.api.EvictReplResponse", [
353
+ { no: 1, name: "replTransfer", kind: "message", T: () => ReplTransfer }
354
+ ]);
355
+ }
356
+ create(value) {
357
+ const message = globalThis.Object.create((this.messagePrototype));
358
+ if (value !== undefined)
359
+ reflectionMergePartial(this, message, value);
360
+ return message;
361
+ }
362
+ internalBinaryRead(reader, length, options, target) {
363
+ let message = target ?? this.create(), end = reader.pos + length;
364
+ while (reader.pos < end) {
365
+ let [fieldNo, wireType] = reader.tag();
366
+ switch (fieldNo) {
367
+ case /* replit.goval.api.ReplTransfer replTransfer */ 1:
368
+ message.replTransfer = ReplTransfer.internalBinaryRead(reader, reader.uint32(), options, message.replTransfer);
369
+ break;
370
+ default:
371
+ let u = options.readUnknownField;
372
+ if (u === "throw")
373
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
374
+ let d = reader.skip(wireType);
375
+ if (u !== false)
376
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
377
+ }
378
+ }
379
+ return message;
380
+ }
381
+ internalBinaryWrite(message, writer, options) {
382
+ /* replit.goval.api.ReplTransfer replTransfer = 1; */
383
+ if (message.replTransfer)
384
+ ReplTransfer.internalBinaryWrite(message.replTransfer, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
385
+ let u = options.writeUnknownFields;
386
+ if (u !== false)
387
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
388
+ return writer;
389
+ }
390
+ }
391
+ /**
392
+ * @generated MessageType for protobuf message replit.goval.api.EvictReplResponse
393
+ */
394
+ export const EvictReplResponse = new EvictReplResponse$Type();