@devvit/ui-renderer 0.10.19-next-2024-04-18-32fa016bb.0 → 0.10.19-next-2024-04-18-8f16790d3.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.
- package/client/remote-app.d.ts +9 -3
- package/client/remote-app.d.ts.map +1 -1
- package/client/remote-app.js +18 -4
- package/package.json +8 -8
package/client/remote-app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContextAction, ContextActionList, ContextActionRequest, ContextActionResponse,
|
|
1
|
+
import type { AutomationUIBuilder, AutomationUIBuilderGetAutomationRequest, AutomationUIBuilderGetAutomationResponse, AutomationUIBuilderUpdateAutomationRequest, AutomationUIBuilderUpdateAutomationResponse, ContextAction, ContextActionList, ContextActionRequest, ContextActionResponse, Empty } from '@devvit/protos';
|
|
2
2
|
import { type HandleUIEventRequest, type HandleUIEventResponse, type Metadata, type RenderPostRequest, type RenderPostResponse, type UIRequest, type UIResponse } from '@devvit/protos';
|
|
3
3
|
import { type CallOptions } from 'nice-grpc-web';
|
|
4
4
|
type CustomPostNiceClient = {
|
|
@@ -13,7 +13,11 @@ type ContextActionNiceClient = {
|
|
|
13
13
|
getActions(req: Readonly<Empty>, opts: Readonly<CallOptions>): Promise<ContextActionList>;
|
|
14
14
|
onAction(req: Readonly<ContextActionRequest>, opts: Readonly<CallOptions>): Promise<ContextActionResponse>;
|
|
15
15
|
};
|
|
16
|
-
type
|
|
16
|
+
type AutomationUIBuilderNiceClient = {
|
|
17
|
+
getAutomation(req: Readonly<AutomationUIBuilderGetAutomationRequest>, opts: Readonly<CallOptions>): Promise<AutomationUIBuilderGetAutomationResponse>;
|
|
18
|
+
updateAutomation(req: Readonly<AutomationUIBuilderUpdateAutomationRequest>, opts: Readonly<CallOptions>): Promise<AutomationUIBuilderUpdateAutomationResponse>;
|
|
19
|
+
};
|
|
20
|
+
type UIApp = ContextAction & Pick<AutomationUIBuilder, 'GetAutomation' | 'UpdateAutomation'>;
|
|
17
21
|
type Meta = {
|
|
18
22
|
installation: string;
|
|
19
23
|
actor: string;
|
|
@@ -21,13 +25,15 @@ type Meta = {
|
|
|
21
25
|
export declare class RemoteApp implements UIApp {
|
|
22
26
|
#private;
|
|
23
27
|
static new(gatewayOrigin: string, meta: Meta): RemoteApp;
|
|
24
|
-
constructor(contextAction: ContextActionNiceClient, customPost: CustomPostNiceClient, uiEventHandler: UIEventHandlerNiceClient, meta: Meta);
|
|
28
|
+
constructor(automationBuilder: AutomationUIBuilderNiceClient, contextAction: ContextActionNiceClient, customPost: CustomPostNiceClient, uiEventHandler: UIEventHandlerNiceClient, meta: Meta);
|
|
25
29
|
GetActions(req: Readonly<Empty>, meta?: Readonly<Metadata> | undefined): Promise<ContextActionList>;
|
|
30
|
+
GetAutomation(req: AutomationUIBuilderGetAutomationRequest, meta?: Metadata | undefined): Promise<AutomationUIBuilderGetAutomationResponse>;
|
|
26
31
|
HandleUIEvent(req: Readonly<HandleUIEventRequest>, meta: Readonly<Metadata> | undefined): Promise<HandleUIEventResponse>;
|
|
27
32
|
OnAction(req: Readonly<ContextActionRequest>, meta?: Readonly<Metadata> | undefined): Promise<ContextActionResponse>;
|
|
28
33
|
RenderPost(req: Readonly<RenderPostRequest>, meta: Readonly<Metadata> | undefined): Promise<RenderPostResponse>;
|
|
29
34
|
RenderPostContent(req: Readonly<UIRequest>, meta: Readonly<Metadata> | undefined): Promise<UIResponse>;
|
|
30
35
|
RenderPostComposer(req: Readonly<UIRequest>, meta: Readonly<Metadata> | undefined): Promise<UIResponse>;
|
|
36
|
+
UpdateAutomation(req: AutomationUIBuilderUpdateAutomationRequest, meta?: Metadata | undefined): Promise<AutomationUIBuilderUpdateAutomationResponse>;
|
|
31
37
|
}
|
|
32
38
|
export {};
|
|
33
39
|
//# sourceMappingURL=remote-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-app.d.ts","sourceRoot":"","sources":["../../library/src/client/rem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EAAE,QAAQ,GAAG,SAAS,GAC1B,OAAO,CAAC,wCAAwC,CAAC;IAM9C,aAAa,CACjB,GAAG,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EACnC,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,SAAS,GACnC,OAAO,CAAC,qBAAqB,CAAC;IAM3B,QAAQ,CACZ,GAAG,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EACnC,IAAI,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,SAAS,GACpC,OAAO,CAAC,qBAAqB,CAAC;IAM3B,UAAU,CACd,GAAG,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EAChC,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,SAAS,GACnC,OAAO,CAAC,kBAAkB,CAAC;IAMxB,iBAAiB,CACrB,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAC,EACxB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,SAAS,GACnC,OAAO,CAAC,UAAU,CAAC;IAMhB,kBAAkB,CACtB,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAC,EACxB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,SAAS,GACnC,OAAO,CAAC,UAAU,CAAC;IAMhB,gBAAgB,CACpB,GAAG,EAAE,0CAA0C,EAC/C,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,GAC1B,OAAO,CAAC,2CAA2C,CAAC;CAKxD"}
|
package/client/remote-app.js
CHANGED
|
@@ -9,24 +9,28 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _RemoteApp_instances, _RemoteApp_contextAction, _RemoteApp_customPost, _RemoteApp_meta, _RemoteApp_uiEventHandler, _RemoteApp_newNiceMeta;
|
|
12
|
+
var _RemoteApp_instances, _RemoteApp_automationBuilder, _RemoteApp_contextAction, _RemoteApp_customPost, _RemoteApp_meta, _RemoteApp_uiEventHandler, _RemoteApp_newNiceMeta;
|
|
13
|
+
import { AutomationUIBuilderDefinition } from '@devvit/protos';
|
|
13
14
|
import { ContextActionDefinition, CustomPostDefinition, UIEventHandlerDefinition, } from '@devvit/protos';
|
|
14
15
|
import { Metadata as NiceMeta, createChannel, createClient, FetchTransport, } from 'nice-grpc-web';
|
|
15
16
|
import { Header } from '@devvit/shared-types/Header.js';
|
|
16
17
|
export class RemoteApp {
|
|
17
18
|
static new(gatewayOrigin, meta) {
|
|
18
19
|
const channel = createChannel(gatewayOrigin, FetchTransport({ credentials: 'include' }));
|
|
20
|
+
const automationBuilder = createClient(AutomationUIBuilderDefinition, channel);
|
|
19
21
|
const contextAction = createClient(ContextActionDefinition, channel);
|
|
20
22
|
const customPost = createClient(CustomPostDefinition, channel);
|
|
21
23
|
const uiEventHandler = createClient(UIEventHandlerDefinition, channel);
|
|
22
|
-
return new RemoteApp(contextAction, customPost, uiEventHandler, meta);
|
|
24
|
+
return new RemoteApp(automationBuilder, contextAction, customPost, uiEventHandler, meta);
|
|
23
25
|
}
|
|
24
|
-
constructor(contextAction, customPost, uiEventHandler, meta) {
|
|
26
|
+
constructor(automationBuilder, contextAction, customPost, uiEventHandler, meta) {
|
|
25
27
|
_RemoteApp_instances.add(this);
|
|
28
|
+
_RemoteApp_automationBuilder.set(this, void 0);
|
|
26
29
|
_RemoteApp_contextAction.set(this, void 0);
|
|
27
30
|
_RemoteApp_customPost.set(this, void 0);
|
|
28
31
|
_RemoteApp_meta.set(this, void 0);
|
|
29
32
|
_RemoteApp_uiEventHandler.set(this, void 0);
|
|
33
|
+
__classPrivateFieldSet(this, _RemoteApp_automationBuilder, automationBuilder, "f");
|
|
30
34
|
__classPrivateFieldSet(this, _RemoteApp_contextAction, contextAction, "f");
|
|
31
35
|
__classPrivateFieldSet(this, _RemoteApp_customPost, customPost, "f");
|
|
32
36
|
__classPrivateFieldSet(this, _RemoteApp_meta, {
|
|
@@ -40,6 +44,11 @@ export class RemoteApp {
|
|
|
40
44
|
metadata: __classPrivateFieldGet(this, _RemoteApp_instances, "m", _RemoteApp_newNiceMeta).call(this, meta),
|
|
41
45
|
});
|
|
42
46
|
}
|
|
47
|
+
async GetAutomation(req, meta) {
|
|
48
|
+
return __classPrivateFieldGet(this, _RemoteApp_automationBuilder, "f").getAutomation(req, {
|
|
49
|
+
metadata: __classPrivateFieldGet(this, _RemoteApp_instances, "m", _RemoteApp_newNiceMeta).call(this, meta),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
43
52
|
async HandleUIEvent(req, meta) {
|
|
44
53
|
return __classPrivateFieldGet(this, _RemoteApp_uiEventHandler, "f").handleUIEvent(req, {
|
|
45
54
|
metadata: __classPrivateFieldGet(this, _RemoteApp_instances, "m", _RemoteApp_newNiceMeta).call(this, meta),
|
|
@@ -65,7 +74,12 @@ export class RemoteApp {
|
|
|
65
74
|
metadata: __classPrivateFieldGet(this, _RemoteApp_instances, "m", _RemoteApp_newNiceMeta).call(this, meta),
|
|
66
75
|
});
|
|
67
76
|
}
|
|
77
|
+
async UpdateAutomation(req, meta) {
|
|
78
|
+
return __classPrivateFieldGet(this, _RemoteApp_automationBuilder, "f").updateAutomation(req, {
|
|
79
|
+
metadata: __classPrivateFieldGet(this, _RemoteApp_instances, "m", _RemoteApp_newNiceMeta).call(this, meta),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
68
82
|
}
|
|
69
|
-
_RemoteApp_contextAction = new WeakMap(), _RemoteApp_customPost = new WeakMap(), _RemoteApp_meta = new WeakMap(), _RemoteApp_uiEventHandler = new WeakMap(), _RemoteApp_instances = new WeakSet(), _RemoteApp_newNiceMeta = function _RemoteApp_newNiceMeta(meta) {
|
|
83
|
+
_RemoteApp_automationBuilder = new WeakMap(), _RemoteApp_contextAction = new WeakMap(), _RemoteApp_customPost = new WeakMap(), _RemoteApp_meta = new WeakMap(), _RemoteApp_uiEventHandler = new WeakMap(), _RemoteApp_instances = new WeakSet(), _RemoteApp_newNiceMeta = function _RemoteApp_newNiceMeta(meta) {
|
|
70
84
|
return new NiceMeta(Object.entries({ ...__classPrivateFieldGet(this, _RemoteApp_meta, "f"), ...meta }).map(([key, { values }]) => [key, values.join()]));
|
|
71
85
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/ui-renderer",
|
|
3
|
-
"version": "0.10.19-next-2024-04-18-
|
|
3
|
+
"version": "0.10.19-next-2024-04-18-8f16790d3.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
},
|
|
56
56
|
"types": "./index.d.ts",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@devvit/protos": "0.10.19-next-2024-04-18-
|
|
59
|
-
"@devvit/runtime-lite": "0.10.19-next-2024-04-18-
|
|
60
|
-
"@devvit/runtimes": "0.10.19-next-2024-04-18-
|
|
61
|
-
"@devvit/shared-types": "0.10.19-next-2024-04-18-
|
|
58
|
+
"@devvit/protos": "0.10.19-next-2024-04-18-8f16790d3.0",
|
|
59
|
+
"@devvit/runtime-lite": "0.10.19-next-2024-04-18-8f16790d3.0",
|
|
60
|
+
"@devvit/runtimes": "0.10.19-next-2024-04-18-8f16790d3.0",
|
|
61
|
+
"@devvit/shared-types": "0.10.19-next-2024-04-18-8f16790d3.0",
|
|
62
62
|
"@dotlottie/player-component": "2.7.2",
|
|
63
63
|
"nice-grpc-web": "3.3.3",
|
|
64
64
|
"p-queue": "7.3.4",
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@devvit/eslint-config": "0.10.18",
|
|
88
|
-
"@devvit/public-api": "0.10.19-next-2024-04-18-
|
|
88
|
+
"@devvit/public-api": "0.10.19-next-2024-04-18-8f16790d3.0",
|
|
89
89
|
"@devvit/repo-tools": "0.10.18",
|
|
90
|
-
"@devvit/tsconfig": "0.10.19-next-2024-04-18-
|
|
90
|
+
"@devvit/tsconfig": "0.10.19-next-2024-04-18-8f16790d3.0",
|
|
91
91
|
"@lit-labs/ssr": "^2.2.3",
|
|
92
92
|
"@lit/localize": "0.11.4",
|
|
93
93
|
"@open-wc/testing-helpers": "2.3.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"directory": "dist"
|
|
121
121
|
},
|
|
122
122
|
"source": "./src/index.ts",
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "d449a5a9103bb3d92132348ff1d4e7f23821eb8e"
|
|
124
124
|
}
|