@devvit/protos 0.10.18-next-2024-03-04-ca2afc49c.0 → 0.10.18-next-2024-03-04-cb729b65f.0
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@devvit/protos",
|
3
|
-
"version": "0.10.18-next-2024-03-04-
|
3
|
+
"version": "0.10.18-next-2024-03-04-cb729b65f.0",
|
4
4
|
"license": "BSD-3-Clause",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -42,7 +42,7 @@
|
|
42
42
|
"devDependencies": {
|
43
43
|
"@devvit/eslint-config": "0.10.17",
|
44
44
|
"@devvit/repo-tools": "0.10.17",
|
45
|
-
"@devvit/tsconfig": "0.10.18-next-2024-03-04-
|
45
|
+
"@devvit/tsconfig": "0.10.18-next-2024-03-04-cb729b65f.0",
|
46
46
|
"eslint": "8.9.0",
|
47
47
|
"glob": "10.3.10",
|
48
48
|
"ts-proto-kmx-2": "1.129.4",
|
@@ -53,5 +53,5 @@
|
|
53
53
|
"publishConfig": {
|
54
54
|
"directory": "dist"
|
55
55
|
},
|
56
|
-
"gitHead": "
|
56
|
+
"gitHead": "085b41f7f88b3047f95e5405d8980f487479ec9a"
|
57
57
|
}
|
@@ -7,6 +7,15 @@ import "google/protobuf/empty.proto";
|
|
7
7
|
|
8
8
|
option go_package = "github.snooguts.net/reddit/reddit-devplatform-monorepo/go-common/generated/protos/types/devvit/service";
|
9
9
|
|
10
|
+
// Fetch a bundle by its hostname
|
11
|
+
message BundleRequest {
|
12
|
+
string hostname = 1;
|
13
|
+
}
|
14
|
+
|
10
15
|
service BundleService {
|
16
|
+
// Upload a bundle to the bundle repo
|
11
17
|
rpc Upload(devvit.runtime.LinkedBundle) returns (google.protobuf.Empty);
|
18
|
+
|
19
|
+
// Retrieve a bundle from the bundle repo
|
20
|
+
rpc Fetch(BundleRequest) returns (devvit.runtime.LinkedBundle);
|
12
21
|
}
|
@@ -4,10 +4,30 @@
|
|
4
4
|
* @packageDocumentation
|
5
5
|
*/
|
6
6
|
import { Metadata, MethodDefinition } from "@lib/Types.js";
|
7
|
+
import _m0 from 'protobufjs/minimal.js';
|
7
8
|
import { Empty } from '../../google/protobuf/empty.js';
|
8
9
|
import { LinkedBundle } from '../runtime/bundle.js';
|
10
|
+
/** Fetch a bundle by its hostname */
|
11
|
+
export interface BundleRequest {
|
12
|
+
hostname: string;
|
13
|
+
}
|
14
|
+
export declare const BundleRequest: {
|
15
|
+
$type: "devvit.service.BundleRequest";
|
16
|
+
encode(message: BundleRequest, writer?: _m0.Writer): _m0.Writer;
|
17
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): BundleRequest;
|
18
|
+
fromJSON(object: any): BundleRequest;
|
19
|
+
toJSON(message: BundleRequest): unknown;
|
20
|
+
fromPartial<I extends {
|
21
|
+
hostname?: string | undefined;
|
22
|
+
} & {
|
23
|
+
hostname?: string | undefined;
|
24
|
+
} & { [K in Exclude<keyof I, "$type" | "hostname">]: never; }>(object: I): BundleRequest;
|
25
|
+
};
|
9
26
|
export interface BundleService {
|
27
|
+
/** Upload a bundle to the bundle repo */
|
10
28
|
Upload(request: LinkedBundle, metadata?: Metadata): Promise<Empty>;
|
29
|
+
/** Retrieve a bundle from the bundle repo */
|
30
|
+
Fetch(request: BundleRequest, metadata?: Metadata): Promise<LinkedBundle>;
|
11
31
|
}
|
12
32
|
export declare class BundleServiceClientImpl implements BundleService {
|
13
33
|
private readonly rpc;
|
@@ -16,6 +36,7 @@ export declare class BundleServiceClientImpl implements BundleService {
|
|
16
36
|
service?: string;
|
17
37
|
});
|
18
38
|
Upload(request: LinkedBundle): Promise<Empty>;
|
39
|
+
Fetch(request: BundleRequest): Promise<LinkedBundle>;
|
19
40
|
}
|
20
41
|
export type BundleServiceDefinition = typeof BundleServiceDefinition;
|
21
42
|
export declare const BundleServiceDefinition: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"bundle_service.d.ts","sourceRoot":"","sources":["../../../../src/types/devvit/service/bundle_service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAc,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"bundle_service.d.ts","sourceRoot":"","sources":["../../../../src/types/devvit/service/bundle_service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAc,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,GAAG,MAAM,uBAAuB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,eAAO,MAAM,aAAa;;oBAGR,aAAa,WAAU,IAAI,MAAM,GAAyB,IAAI,MAAM;kBAOtE,IAAI,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,aAAa;qBAkBrD,GAAG,GAAG,aAAa;oBAIpB,aAAa,GAAG,OAAO;;;;;+EAMiC,aAAa;CAKtF,CAAC;AAIF,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACnE,6CAA6C;IAC7C,KAAK,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC3E;AAED,qBAAa,uBAAwB,YAAW,aAAa;IAC3D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBACrB,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;IAMjD,MAAM,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC;IAM7C,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;CAKrD;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAC;AACrE,eAAO,MAAM,uBAAuB,EAAE;IACpC,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,GAAG;YAAE,OAAO,EAAE,EAAE,CAAA;SAAE,CAAA;KAAE,CAAC;CAwB9D,CAAC;AAEX,UAAU,GAAG;IACX,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACjF"}
|
@@ -6,23 +6,74 @@
|
|
6
6
|
/* eslint-disable */
|
7
7
|
import _m0 from 'protobufjs/minimal.js';
|
8
8
|
import { Empty } from '../../google/protobuf/empty.js';
|
9
|
+
import { messageTypeRegistry } from '../../typeRegistry.js';
|
9
10
|
import { LinkedBundle } from '../runtime/bundle.js';
|
11
|
+
function createBaseBundleRequest() {
|
12
|
+
return { hostname: "" };
|
13
|
+
}
|
14
|
+
export const BundleRequest = {
|
15
|
+
$type: "devvit.service.BundleRequest",
|
16
|
+
encode(message, writer = _m0.Writer.create()) {
|
17
|
+
if (message.hostname !== "") {
|
18
|
+
writer.uint32(10).string(message.hostname);
|
19
|
+
}
|
20
|
+
return writer;
|
21
|
+
},
|
22
|
+
decode(input, length) {
|
23
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
24
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
25
|
+
const message = createBaseBundleRequest();
|
26
|
+
while (reader.pos < end) {
|
27
|
+
const tag = reader.uint32();
|
28
|
+
switch (tag >>> 3) {
|
29
|
+
case 1:
|
30
|
+
message.hostname = reader.string();
|
31
|
+
break;
|
32
|
+
default:
|
33
|
+
reader.skipType(tag & 7);
|
34
|
+
break;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
return message;
|
38
|
+
},
|
39
|
+
fromJSON(object) {
|
40
|
+
return { hostname: isSet(object.hostname) ? String(object.hostname) : "" };
|
41
|
+
},
|
42
|
+
toJSON(message) {
|
43
|
+
const obj = {};
|
44
|
+
message.hostname !== undefined && (obj.hostname = message.hostname);
|
45
|
+
return obj;
|
46
|
+
},
|
47
|
+
fromPartial(object) {
|
48
|
+
const message = createBaseBundleRequest();
|
49
|
+
message.hostname = object.hostname ?? "";
|
50
|
+
return message;
|
51
|
+
},
|
52
|
+
};
|
53
|
+
messageTypeRegistry.set("devvit.service.BundleRequest", BundleRequest);
|
10
54
|
export class BundleServiceClientImpl {
|
11
55
|
constructor(rpc, opts) {
|
12
56
|
this.service = opts?.service || "devvit.service.BundleService";
|
13
57
|
this.rpc = rpc;
|
14
58
|
this.Upload = this.Upload.bind(this);
|
59
|
+
this.Fetch = this.Fetch.bind(this);
|
15
60
|
}
|
16
61
|
Upload(request) {
|
17
62
|
const data = LinkedBundle.encode(request).finish();
|
18
63
|
const promise = this.rpc.request(this.service, "Upload", data);
|
19
64
|
return promise.then((data) => Empty.decode(new _m0.Reader(data)));
|
20
65
|
}
|
66
|
+
Fetch(request) {
|
67
|
+
const data = BundleRequest.encode(request).finish();
|
68
|
+
const promise = this.rpc.request(this.service, "Fetch", data);
|
69
|
+
return promise.then((data) => LinkedBundle.decode(new _m0.Reader(data)));
|
70
|
+
}
|
21
71
|
}
|
22
72
|
export const BundleServiceDefinition = {
|
23
73
|
name: "BundleService",
|
24
74
|
fullName: "devvit.service.BundleService",
|
25
75
|
methods: {
|
76
|
+
/** Upload a bundle to the bundle repo */
|
26
77
|
upload: {
|
27
78
|
name: "Upload",
|
28
79
|
requestType: LinkedBundle,
|
@@ -31,5 +82,17 @@ export const BundleServiceDefinition = {
|
|
31
82
|
responseStream: false,
|
32
83
|
options: {},
|
33
84
|
},
|
85
|
+
/** Retrieve a bundle from the bundle repo */
|
86
|
+
fetch: {
|
87
|
+
name: "Fetch",
|
88
|
+
requestType: BundleRequest,
|
89
|
+
requestStream: false,
|
90
|
+
responseType: LinkedBundle,
|
91
|
+
responseStream: false,
|
92
|
+
options: {},
|
93
|
+
},
|
34
94
|
},
|
35
95
|
};
|
96
|
+
function isSet(value) {
|
97
|
+
return value !== null && value !== undefined;
|
98
|
+
}
|