@otonoma/paranet-client 2.11.0-rc.18

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 (75) hide show
  1. package/README.md +2 -0
  2. package/dist/client.d.ts +168 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +497 -0
  5. package/dist/graphql.d.ts +8 -0
  6. package/dist/graphql.d.ts.map +1 -0
  7. package/dist/graphql.js +113 -0
  8. package/dist/index.d.ts +12 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +11 -0
  11. package/dist/pncp.d.ts +129 -0
  12. package/dist/pncp.d.ts.map +1 -0
  13. package/dist/pncp.js +100 -0
  14. package/dist/proto/broker.grpc.client.d.ts +154 -0
  15. package/dist/proto/broker.grpc.client.d.ts.map +1 -0
  16. package/dist/proto/broker.grpc.client.js +102 -0
  17. package/dist/proto/broker.grpc.d.ts +6 -0
  18. package/dist/proto/broker.grpc.d.ts.map +1 -0
  19. package/dist/proto/broker.grpc.js +32 -0
  20. package/dist/proto/broker_api.d.ts +324 -0
  21. package/dist/proto/broker_api.d.ts.map +1 -0
  22. package/dist/proto/broker_api.js +566 -0
  23. package/dist/proto/google/protobuf/descriptor.d.ts +2492 -0
  24. package/dist/proto/google/protobuf/descriptor.d.ts.map +1 -0
  25. package/dist/proto/google/protobuf/descriptor.js +3250 -0
  26. package/dist/proto/google/protobuf/timestamp.d.ts +157 -0
  27. package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -0
  28. package/dist/proto/google/protobuf/timestamp.js +132 -0
  29. package/dist/proto/grpc/health/v1/health.client.d.ts +79 -0
  30. package/dist/proto/grpc/health/v1/health.client.d.ts.map +1 -0
  31. package/dist/proto/grpc/health/v1/health.client.js +46 -0
  32. package/dist/proto/grpc/health/v1/health.d.ts +74 -0
  33. package/dist/proto/grpc/health/v1/health.d.ts.map +1 -0
  34. package/dist/proto/grpc/health/v1/health.js +152 -0
  35. package/dist/proto/identifiers.d.ts +82 -0
  36. package/dist/proto/identifiers.d.ts.map +1 -0
  37. package/dist/proto/identifiers.js +132 -0
  38. package/dist/proto/mediums.d.ts +71 -0
  39. package/dist/proto/mediums.d.ts.map +1 -0
  40. package/dist/proto/mediums.js +120 -0
  41. package/dist/proto/observation.d.ts +287 -0
  42. package/dist/proto/observation.d.ts.map +1 -0
  43. package/dist/proto/observation.js +443 -0
  44. package/dist/proto/otonoma/common/value.d.ts +127 -0
  45. package/dist/proto/otonoma/common/value.d.ts.map +1 -0
  46. package/dist/proto/otonoma/common/value.js +248 -0
  47. package/dist/proto/pncp.d.ts +607 -0
  48. package/dist/proto/pncp.d.ts.map +1 -0
  49. package/dist/proto/pncp.js +936 -0
  50. package/dist/schema/paranet.d.ts +245 -0
  51. package/dist/schema/paranet.d.ts.map +1 -0
  52. package/dist/schema/paranet.js +7 -0
  53. package/dist/util.d.ts +5 -0
  54. package/dist/util.d.ts.map +1 -0
  55. package/dist/util.js +120 -0
  56. package/package.json +39 -0
  57. package/src/client.ts +677 -0
  58. package/src/graphql.ts +103 -0
  59. package/src/index.ts +14 -0
  60. package/src/pncp.ts +236 -0
  61. package/src/proto/broker.grpc.client.ts +193 -0
  62. package/src/proto/broker.grpc.ts +32 -0
  63. package/src/proto/broker_api.ts +778 -0
  64. package/src/proto/google/protobuf/descriptor.ts +4860 -0
  65. package/src/proto/google/protobuf/timestamp.ts +288 -0
  66. package/src/proto/grpc/health/v1/health.client.ts +106 -0
  67. package/src/proto/grpc/health/v1/health.ts +174 -0
  68. package/src/proto/identifiers.ts +176 -0
  69. package/src/proto/mediums.ts +168 -0
  70. package/src/proto/observation.ts +636 -0
  71. package/src/proto/otonoma/common/value.ts +334 -0
  72. package/src/proto/pncp.ts +1333 -0
  73. package/src/schema/paranet.ts +257 -0
  74. package/src/util.ts +129 -0
  75. package/tsconfig.json +27 -0
@@ -0,0 +1,113 @@
1
+ import * as proto from "./proto/pncp";
2
+ import { ConversationMembership } from "./proto/identifiers";
3
+ export function gqlSimplifyPncpPacket(req) {
4
+ switch (req.type) {
5
+ case "request": return { type: "request", body: gqlSimplifyPncpRequest(req.body) };
6
+ case "message": return { type: "message", body: gqlSimplifyPncpMessage(req.body) };
7
+ }
8
+ }
9
+ // Provide conversions from graphql returned objects into the equivalent pncp objects.
10
+ export function gqlSimplifyPncpRequest(req) {
11
+ return {
12
+ body: {
13
+ subject: req.body.subject,
14
+ action: req.body.action,
15
+ body: req.body.body,
16
+ },
17
+ key: req.key,
18
+ author: req.author,
19
+ callback: req.callback,
20
+ parentId: req.parentId ? req.parentId : undefined,
21
+ mediumInfo: req.mediumInfo ? { id: req.mediumInfo.id, userInfo: req.mediumInfo.userInfo } : undefined,
22
+ versionReq: req.versionReq ? req.versionReq : undefined,
23
+ matchStrategy: req.matchStrategy ? simplifyMatchStrategy(req.matchStrategy) : proto.SkillMatchStrategy.BEST,
24
+ };
25
+ }
26
+ function simplifyMatchStrategy(matchStrategy) {
27
+ switch (matchStrategy) {
28
+ case "BEST": return proto.SkillMatchStrategy.BEST;
29
+ case "FIRST": return proto.SkillMatchStrategy.FIRST;
30
+ case "STRICT": return proto.SkillMatchStrategy.STRICT;
31
+ }
32
+ }
33
+ export function gqlSimplifyPncpMessage(req) {
34
+ let body;
35
+ let b = req.message.body;
36
+ switch (req.message.type) {
37
+ case "response":
38
+ body = { type: proto.PncpMessageKind.PNCP_RESPONSE, value: { data: b.data } };
39
+ break;
40
+ case "error":
41
+ body = { type: proto.PncpMessageKind.PNCP_ERROR, value: { data: b.data } };
42
+ break;
43
+ case "status":
44
+ body = { type: proto.PncpMessageKind.PNCP_STATUS, value: { data: b.data } };
45
+ break;
46
+ case "cancel":
47
+ body = { type: proto.PncpMessageKind.PNCP_CANCEL, value: { data: b.data } };
48
+ break;
49
+ case "answer":
50
+ body = { type: proto.PncpMessageKind.PNCP_ANSWER, value: { data: b.data, reply_to: b.replyTo } };
51
+ break;
52
+ case "question":
53
+ body = { type: proto.PncpMessageKind.PNCP_QUESTION, value: { data: b.data, id: b.id, callback: b.callback } };
54
+ break;
55
+ }
56
+ return {
57
+ id: splitConversationId(req.id),
58
+ body,
59
+ };
60
+ }
61
+ export function splitConversationId(convId) {
62
+ let [id, tag] = convId.split('@');
63
+ let membership = ConversationMembership.REQUESTER;
64
+ switch (tag) {
65
+ case "requester":
66
+ membership = ConversationMembership.REQUESTER;
67
+ break;
68
+ case "fulfiller":
69
+ membership = ConversationMembership.FULFILLER;
70
+ break;
71
+ case "observer":
72
+ membership = ConversationMembership.OBSERVER;
73
+ break;
74
+ default: throw new Error("Unexpected conversation tag: " + tag);
75
+ }
76
+ return { id, membership };
77
+ }
78
+ /*
79
+ // Simple constructors for a graphql client to the service to auto manage login and such.
80
+
81
+ // import { HttpLink, ApolloLink, ApolloClient, gql } from "@apollo/client";
82
+ // import { setContext } from "@apollo/client/link/context";
83
+ // import { PncpClient } from "./client";
84
+
85
+ // Creates an `ApolloLink` which can connect to the paranet with appropriate authentication.
86
+ // export function createParanetApolloLink(cl: PncpClient): ApolloLink {
87
+ // const paranetServiceLink = new HttpLink({
88
+ // uri: `${cl.serviceEndpoint()}/graphql`,
89
+ // });
90
+ //
91
+ // const authLink = setContext(async (_, { headers }) => {
92
+ // if (!cl.hasTokens()) {
93
+ // return {
94
+ // headers,
95
+ // };
96
+ // }
97
+ // if (!cl.isTokenValid()) {
98
+ // console.log("GQL LINK: ATTEMPTING TOKEN REFRESH");
99
+ // await cl.refreshAuth();
100
+ // }
101
+ // let { token } = cl.getTokens();
102
+ // return {
103
+ // headers: {
104
+ // ...headers,
105
+ // Authorization: token ? `Bearer ${token}` : "",
106
+ // },
107
+ // };
108
+ // });
109
+ //
110
+ // return authLink.concat(paranetServiceLink);
111
+ // }
112
+
113
+ */
@@ -0,0 +1,12 @@
1
+ export * from "./client";
2
+ export * from "./graphql";
3
+ export * from './proto/pncp';
4
+ export * from './proto/otonoma/common/value';
5
+ export * from './proto/google/protobuf/timestamp';
6
+ export * from './proto/identifiers';
7
+ export * from './proto/mediums';
8
+ export * from './proto/broker_api';
9
+ export * from './proto/observation';
10
+ export * from './util';
11
+ export * from './pncp';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAE1B,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,QAAQ,CAAC;AAEvB,cAAc,QAAQ,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ export * from "./client";
2
+ export * from "./graphql";
3
+ export * from './proto/pncp';
4
+ export * from './proto/otonoma/common/value';
5
+ export * from './proto/google/protobuf/timestamp';
6
+ export * from './proto/identifiers';
7
+ export * from './proto/mediums';
8
+ export * from './proto/broker_api';
9
+ export * from './proto/observation';
10
+ export * from './util';
11
+ export * from './pncp';
package/dist/pncp.d.ts ADDED
@@ -0,0 +1,129 @@
1
+ import { ConversationId, EntityId } from "./proto/identifiers";
2
+ import { ObservationCallback } from "./proto/observation";
3
+ import { ConversationState, PncpCallback, PncpMessage, PncpMessageCallback, PncpMessageKind, PncpRequestCallback, SkillMatchStrategy } from "./proto/pncp";
4
+ export interface SkillRequest {
5
+ actorVersion?: string;
6
+ subject: string;
7
+ action: string;
8
+ body: any;
9
+ versionReq?: string;
10
+ callback?: any;
11
+ parentConversationId?: ConversationId;
12
+ targetId?: string;
13
+ matchStrategy?: SkillMatchStrategy;
14
+ mustMatch?: boolean;
15
+ useLock?: boolean;
16
+ allowOpenMatch?: boolean;
17
+ }
18
+ export type PncpPacketObject = {
19
+ type: "request";
20
+ body: PncpRequestObject;
21
+ } | {
22
+ type: "message";
23
+ body: PncpMessageObject;
24
+ };
25
+ export type PncpRequestObject = {
26
+ body: PncpSkillMessageObject;
27
+ callback?: any;
28
+ parentId?: string;
29
+ author: string;
30
+ matchStrategy: SkillMatchStrategy;
31
+ versionReq?: string;
32
+ targetActorId?: string;
33
+ key?: any;
34
+ targetInstanceId?: string;
35
+ mediumInfo?: PncpRequestMediumInfoObject;
36
+ };
37
+ export type PncpRequestMediumInfoObject = {
38
+ id: string;
39
+ userInfo: any;
40
+ };
41
+ export type PncpSkillMessageObject = {
42
+ subject: string;
43
+ action: string;
44
+ body: any;
45
+ };
46
+ export interface MessageRequest {
47
+ conversation: string;
48
+ message: PncpMessageBody;
49
+ }
50
+ export interface PncpDataMessage {
51
+ data: any;
52
+ }
53
+ export interface PncpQuestionMessage {
54
+ id: string;
55
+ data: any;
56
+ callback?: any;
57
+ }
58
+ export interface PncpAnswerMessage {
59
+ reply_to: string;
60
+ data: any;
61
+ }
62
+ export type PncpMessageBody = {
63
+ type: typeof PncpMessageKind.PNCP_RESPONSE;
64
+ value: PncpDataMessage;
65
+ } | {
66
+ type: typeof PncpMessageKind.PNCP_STATUS;
67
+ value: PncpDataMessage;
68
+ } | {
69
+ type: typeof PncpMessageKind.PNCP_CANCEL;
70
+ value: PncpDataMessage;
71
+ } | {
72
+ type: typeof PncpMessageKind.PNCP_ERROR;
73
+ value: PncpDataMessage;
74
+ } | {
75
+ type: typeof PncpMessageKind.PNCP_QUESTION;
76
+ value: PncpQuestionMessage;
77
+ } | {
78
+ type: typeof PncpMessageKind.PNCP_ANSWER;
79
+ value: PncpAnswerMessage;
80
+ };
81
+ export type PncpCallbackObject = PncpRequestCallbackObject | PncpMessageCallbackObject;
82
+ export type PncpRequestCallbackObject = {
83
+ type: "skill";
84
+ id: ConversationId;
85
+ messageId: string;
86
+ parentId?: ConversationId;
87
+ body: PncpSkillMessageObject;
88
+ timeCreated: Date;
89
+ authorId: EntityId;
90
+ targetActorId: EntityId;
91
+ parameters: {
92
+ provider?: any;
93
+ skill?: any;
94
+ medium?: any;
95
+ };
96
+ };
97
+ export type PncpMessageCallbackObject = {
98
+ type: "message";
99
+ id: ConversationId;
100
+ messageId: string;
101
+ timeCreated: Date;
102
+ key?: any;
103
+ message: PncpMessageObject;
104
+ params?: any;
105
+ callback?: any;
106
+ medium?: any;
107
+ conversationState: ConversationState;
108
+ };
109
+ export type PncpMessageObject = {
110
+ id: ConversationId;
111
+ body: PncpMessageBody;
112
+ };
113
+ export declare function simplifyPncpCallback(cb: PncpCallback): PncpCallbackObject;
114
+ export declare function simplifyPncpRequestCallback(cb: PncpRequestCallback): PncpRequestCallbackObject;
115
+ export declare function simplifyPncpMessageCallback(cb: PncpMessageCallback): PncpMessageCallbackObject;
116
+ export declare function simplifyPncpMessage(msg: PncpMessage): PncpMessageObject;
117
+ export type ObservationCallbackObject = {
118
+ subject: string;
119
+ action: string;
120
+ requester: EntityId;
121
+ fulfiller: EntityId;
122
+ message: PncpCallbackObject;
123
+ id: ConversationId;
124
+ callback?: any;
125
+ prevMid?: string;
126
+ skillId: EntityId;
127
+ };
128
+ export declare function simplifyObservationCallback(cb: ObservationCallback): ObservationCallbackObject;
129
+ //# sourceMappingURL=pncp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pncp.d.ts","sourceRoot":"","sources":["../src/pncp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAG3J,MAAM,WAAW,YAAY;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IAC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AmB,GAAG,yBAAyB,CAY9F"}
package/dist/pncp.js ADDED
@@ -0,0 +1,100 @@
1
+ import { Timestamp } from "./proto/google/protobuf/timestamp";
2
+ import { Value } from "./proto/otonoma/common/value";
3
+ import { PncpMessageKind } from "./proto/pncp";
4
+ export function simplifyPncpCallback(cb) {
5
+ switch (cb.body.oneofKind) {
6
+ case "skill": return simplifyPncpRequestCallback(cb.body.skill);
7
+ case "message": return simplifyPncpMessageCallback(cb.body.message);
8
+ default: throw Error("Unreachable");
9
+ }
10
+ }
11
+ export function simplifyPncpRequestCallback(cb) {
12
+ return {
13
+ type: "skill",
14
+ id: cb.id,
15
+ messageId: cb.messageId,
16
+ parentId: cb.parentId,
17
+ body: {
18
+ subject: cb.body.subject,
19
+ action: cb.body.action,
20
+ body: Value.toJson(cb.body.body),
21
+ },
22
+ authorId: cb.authorId,
23
+ timeCreated: Timestamp.toDate(cb.timeCreated),
24
+ targetActorId: cb.targetActorId,
25
+ parameters: {
26
+ provider: cb.parameters?.provider && Value.toJson(cb.parameters.provider),
27
+ skill: cb.parameters?.skill && Value.toJson(cb.parameters.skill),
28
+ medium: cb.parameters?.medium && Value.toJson(cb.parameters.medium),
29
+ },
30
+ };
31
+ }
32
+ export function simplifyPncpMessageCallback(cb) {
33
+ return {
34
+ type: "message",
35
+ id: cb.id,
36
+ messageId: cb.messageId,
37
+ timeCreated: Timestamp.toDate(cb.timeCreated),
38
+ key: cb.key && Value.toJson(cb.key),
39
+ message: simplifyPncpMessage(cb.message),
40
+ params: cb.params && Value.toJson(cb.params),
41
+ callback: cb.callback && Value.toJson(cb.callback),
42
+ medium: cb.medium && Value.toJson(cb.medium),
43
+ conversationState: cb.conversationState,
44
+ };
45
+ }
46
+ export function simplifyPncpMessage(msg) {
47
+ let body;
48
+ switch (msg.kind) {
49
+ case PncpMessageKind.PNCP_CANCEL:
50
+ case PncpMessageKind.PNCP_STATUS:
51
+ case PncpMessageKind.PNCP_ERROR:
52
+ case PncpMessageKind.PNCP_RESPONSE: {
53
+ body = {
54
+ type: msg.kind, value: { data: Value.toJson(msg.body) }
55
+ };
56
+ break;
57
+ }
58
+ case PncpMessageKind.PNCP_QUESTION: {
59
+ let extra = msg.extra;
60
+ if (extra.oneofKind != "question")
61
+ throw Error("Invalid PNCP");
62
+ body = {
63
+ type: msg.kind,
64
+ value: {
65
+ data: Value.toJson(msg.body),
66
+ id: extra.question.id,
67
+ callback: extra.question.callback && Value.toJson(extra.question.callback)
68
+ }
69
+ };
70
+ break;
71
+ }
72
+ case PncpMessageKind.PNCP_ANSWER: {
73
+ let extra = msg.extra;
74
+ if (extra.oneofKind != "answer")
75
+ throw Error("Invalid PNCP");
76
+ body = {
77
+ type: msg.kind,
78
+ value: {
79
+ data: Value.toJson(msg.body),
80
+ reply_to: extra.answer.replyTo,
81
+ },
82
+ };
83
+ break;
84
+ }
85
+ }
86
+ return { id: msg.id, body };
87
+ }
88
+ export function simplifyObservationCallback(cb) {
89
+ return {
90
+ subject: cb.subject,
91
+ action: cb.action,
92
+ requester: cb.requester,
93
+ fulfiller: cb.fulfiller,
94
+ message: simplifyPncpCallback(cb.message),
95
+ id: cb.id,
96
+ callback: cb.callback && Value.toJson(cb.callback),
97
+ prevMid: cb.prevMid,
98
+ skillId: cb.skillId,
99
+ };
100
+ }
@@ -0,0 +1,154 @@
1
+ import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
2
+ import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
3
+ import type { PncpMediumMessage } from "./mediums";
4
+ import type { RefreshTokenRequest } from "./broker_api";
5
+ import type { LoginResponse } from "./broker_api";
6
+ import type { LoginRequest } from "./broker_api";
7
+ import type { CrossDomainStreamMessage } from "./broker_api";
8
+ import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc";
9
+ import type { CrossDomainResponse } from "./broker_api";
10
+ import type { CrossDomainMessage } from "./broker_api";
11
+ import type { ObservationMessageWrapper } from "./observation";
12
+ import type { ObservationRequest } from "./observation";
13
+ import type { PncpCallback } from "./pncp";
14
+ import type { PncpCallbackRequest } from "./broker_api";
15
+ import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
16
+ import type { PncpMessage } from "./pncp";
17
+ import type { MessageResponse } from "./broker_api";
18
+ import type { PncpRequest } from "./pncp";
19
+ import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
20
+ import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
21
+ /**
22
+ * @generated from protobuf service pncp.v1.Broker
23
+ */
24
+ export interface IBrokerClient {
25
+ /**
26
+ * A skill request initiates a conversation between the requesting actor and the corresponding matched
27
+ * actor. Any further messages within the conversation are sent via PncpMessage.
28
+ * Messages are forwarded to actors depending on the actor configuration, but the majority of actors
29
+ * will receive their messages as a callback on `PncpCallbackStream`.
30
+ *
31
+ * @generated from protobuf rpc: SkillRequest(pncp.v1.PncpRequest) returns (pncp.v1.MessageResponse);
32
+ */
33
+ skillRequest(input: PncpRequest, options?: RpcOptions): UnaryCall<PncpRequest, MessageResponse>;
34
+ /**
35
+ * Follow up messages within a conversation are sent with via this endpoint.
36
+ *
37
+ * @generated from protobuf rpc: PncpMessageRequest(pncp.v1.PncpMessage) returns (pncp.v1.MessageResponse);
38
+ */
39
+ pncpMessageRequest(input: PncpMessage, options?: RpcOptions): UnaryCall<PncpMessage, MessageResponse>;
40
+ /**
41
+ * The callback stream for an actor to receive all Pncp type messages. This includes skill requests
42
+ * and all additional Pncp messages sent in the conversation thread.
43
+ *
44
+ * @generated from protobuf rpc: PncpCallbackStream(pncp.v1.PncpCallbackRequest) returns (stream pncp.v1.PncpCallback);
45
+ */
46
+ pncpCallbackStream(input: PncpCallbackRequest, options?: RpcOptions): ServerStreamingCall<PncpCallbackRequest, PncpCallback>;
47
+ /**
48
+ * Creates a new observation stream.
49
+ *
50
+ * @generated from protobuf rpc: CreateObserverStream(pncp.v1.ObservationRequest) returns (stream pncp.v1.ObservationMessageWrapper);
51
+ */
52
+ createObserverStream(input: ObservationRequest, options?: RpcOptions): ServerStreamingCall<ObservationRequest, ObservationMessageWrapper>;
53
+ /**
54
+ * A direct cross domain request, posted from one node to another. The other node is often expected to post
55
+ * the results back.
56
+ *
57
+ * @generated from protobuf rpc: CrossDomainRequest(pncp.v1.CrossDomainMessage) returns (pncp.v1.CrossDomainResponse);
58
+ */
59
+ crossDomainRequest(input: CrossDomainMessage, options?: RpcOptions): UnaryCall<CrossDomainMessage, CrossDomainResponse>;
60
+ /**
61
+ * Inverted API for an edge node to connect to another node. It creates this stream so that the node it
62
+ * connects to can stream messages back to the edge node. The edge node is then required to stream
63
+ * `MessageResponse` to each incoming message back to the connected node.
64
+ *
65
+ * @generated from protobuf rpc: CrossDomainStream(stream pncp.v1.CrossDomainResponse) returns (stream pncp.v1.CrossDomainStreamMessage);
66
+ */
67
+ crossDomainStream(options?: RpcOptions): DuplexStreamingCall<CrossDomainResponse, CrossDomainStreamMessage>;
68
+ /**
69
+ * @generated from protobuf rpc: Login(pncp.v1.LoginRequest) returns (pncp.v1.LoginResponse);
70
+ */
71
+ login(input: LoginRequest, options?: RpcOptions): UnaryCall<LoginRequest, LoginResponse>;
72
+ /**
73
+ * @generated from protobuf rpc: RefreshToken(pncp.v1.RefreshTokenRequest) returns (pncp.v1.LoginResponse);
74
+ */
75
+ refreshToken(input: RefreshTokenRequest, options?: RpcOptions): UnaryCall<RefreshTokenRequest, LoginResponse>;
76
+ /**
77
+ * A PNCP message received from a medium. Note, that we are likely to rework mediums.
78
+ * Given currently limitations with mediums this route is left unauthenticated.
79
+ *
80
+ * @generated from protobuf rpc: PncpMediumMessageRequest(pncp.v1.PncpMediumMessage) returns (pncp.v1.MessageResponse);
81
+ */
82
+ pncpMediumMessageRequest(input: PncpMediumMessage, options?: RpcOptions): UnaryCall<PncpMediumMessage, MessageResponse>;
83
+ }
84
+ /**
85
+ * @generated from protobuf service pncp.v1.Broker
86
+ */
87
+ export declare class BrokerClient implements IBrokerClient, ServiceInfo {
88
+ private readonly _transport;
89
+ typeName: string;
90
+ methods: import("@protobuf-ts/runtime-rpc").MethodInfo<any, any>[];
91
+ options: {
92
+ [extensionName: string]: import("@protobuf-ts/runtime").JsonValue;
93
+ };
94
+ constructor(_transport: RpcTransport);
95
+ /**
96
+ * A skill request initiates a conversation between the requesting actor and the corresponding matched
97
+ * actor. Any further messages within the conversation are sent via PncpMessage.
98
+ * Messages are forwarded to actors depending on the actor configuration, but the majority of actors
99
+ * will receive their messages as a callback on `PncpCallbackStream`.
100
+ *
101
+ * @generated from protobuf rpc: SkillRequest(pncp.v1.PncpRequest) returns (pncp.v1.MessageResponse);
102
+ */
103
+ skillRequest(input: PncpRequest, options?: RpcOptions): UnaryCall<PncpRequest, MessageResponse>;
104
+ /**
105
+ * Follow up messages within a conversation are sent with via this endpoint.
106
+ *
107
+ * @generated from protobuf rpc: PncpMessageRequest(pncp.v1.PncpMessage) returns (pncp.v1.MessageResponse);
108
+ */
109
+ pncpMessageRequest(input: PncpMessage, options?: RpcOptions): UnaryCall<PncpMessage, MessageResponse>;
110
+ /**
111
+ * The callback stream for an actor to receive all Pncp type messages. This includes skill requests
112
+ * and all additional Pncp messages sent in the conversation thread.
113
+ *
114
+ * @generated from protobuf rpc: PncpCallbackStream(pncp.v1.PncpCallbackRequest) returns (stream pncp.v1.PncpCallback);
115
+ */
116
+ pncpCallbackStream(input: PncpCallbackRequest, options?: RpcOptions): ServerStreamingCall<PncpCallbackRequest, PncpCallback>;
117
+ /**
118
+ * Creates a new observation stream.
119
+ *
120
+ * @generated from protobuf rpc: CreateObserverStream(pncp.v1.ObservationRequest) returns (stream pncp.v1.ObservationMessageWrapper);
121
+ */
122
+ createObserverStream(input: ObservationRequest, options?: RpcOptions): ServerStreamingCall<ObservationRequest, ObservationMessageWrapper>;
123
+ /**
124
+ * A direct cross domain request, posted from one node to another. The other node is often expected to post
125
+ * the results back.
126
+ *
127
+ * @generated from protobuf rpc: CrossDomainRequest(pncp.v1.CrossDomainMessage) returns (pncp.v1.CrossDomainResponse);
128
+ */
129
+ crossDomainRequest(input: CrossDomainMessage, options?: RpcOptions): UnaryCall<CrossDomainMessage, CrossDomainResponse>;
130
+ /**
131
+ * Inverted API for an edge node to connect to another node. It creates this stream so that the node it
132
+ * connects to can stream messages back to the edge node. The edge node is then required to stream
133
+ * `MessageResponse` to each incoming message back to the connected node.
134
+ *
135
+ * @generated from protobuf rpc: CrossDomainStream(stream pncp.v1.CrossDomainResponse) returns (stream pncp.v1.CrossDomainStreamMessage);
136
+ */
137
+ crossDomainStream(options?: RpcOptions): DuplexStreamingCall<CrossDomainResponse, CrossDomainStreamMessage>;
138
+ /**
139
+ * @generated from protobuf rpc: Login(pncp.v1.LoginRequest) returns (pncp.v1.LoginResponse);
140
+ */
141
+ login(input: LoginRequest, options?: RpcOptions): UnaryCall<LoginRequest, LoginResponse>;
142
+ /**
143
+ * @generated from protobuf rpc: RefreshToken(pncp.v1.RefreshTokenRequest) returns (pncp.v1.LoginResponse);
144
+ */
145
+ refreshToken(input: RefreshTokenRequest, options?: RpcOptions): UnaryCall<RefreshTokenRequest, LoginResponse>;
146
+ /**
147
+ * A PNCP message received from a medium. Note, that we are likely to rework mediums.
148
+ * Given currently limitations with mediums this route is left unauthenticated.
149
+ *
150
+ * @generated from protobuf rpc: PncpMediumMessageRequest(pncp.v1.PncpMediumMessage) returns (pncp.v1.MessageResponse);
151
+ */
152
+ pncpMediumMessageRequest(input: PncpMediumMessage, options?: RpcOptions): UnaryCall<PncpMediumMessage, MessageResponse>;
153
+ }
154
+ //# sourceMappingURL=broker.grpc.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broker.grpc.client.d.ts","sourceRoot":"","sources":["../../src/proto/broker.grpc.client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,O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U,GAAG,SAAS,CAAC,WAAW,EAAE,eAAe,CAAC;IAI/F;;;;OAIG;IACH,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,WAAW,EAAE,eAAe,CAAC;IAIrG;;;;;OAKG;IACH,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,mBAAmB,CAAC,mBAAmB,EAAE,YAAY,CAAC;IAI5H;;;;OAIG;IACH,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,mBAAmB,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;IAIzI;;;;;OAKG;IACH,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;IAIvH;;;;;;OAMG;IACH,iBAAiB,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,mBAAmB,CAAC,mBAAmB,EAAE,wBAAwB,CAAC;IAI3G;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,YAAY,EAAE,aAAa,CAAC;IAIxF;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,mBAAmB,EAAE,aAAa,CAAC;IAI7G;;;;;OAKG;IACH,wBAAwB,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,iBAAiB,EAAE,eAAe,CAAC;CAI1H"}
@@ -0,0 +1,102 @@
1
+ import { Broker } from "./broker.grpc";
2
+ import { stackIntercept } from "@protobuf-ts/runtime-rpc";
3
+ // NOTE (JAB, 2024-06-11): Some protobuf compilers (notably, protoc) don't like it when your rpc and
4
+ // messages have the same name. We ran into this with rpc PncpMessageRequest being originally named
5
+ // PncpMessage. This produces a cryptic error message like:
6
+ // broker.grpc.proto:22:19: "PncpMessage" is not a message type.
7
+ /**
8
+ * @generated from protobuf service pncp.v1.Broker
9
+ */
10
+ export class BrokerClient {
11
+ constructor(_transport) {
12
+ this._transport = _transport;
13
+ this.typeName = Broker.typeName;
14
+ this.methods = Broker.methods;
15
+ this.options = Broker.options;
16
+ }
17
+ /**
18
+ * A skill request initiates a conversation between the requesting actor and the corresponding matched
19
+ * actor. Any further messages within the conversation are sent via PncpMessage.
20
+ * Messages are forwarded to actors depending on the actor configuration, but the majority of actors
21
+ * will receive their messages as a callback on `PncpCallbackStream`.
22
+ *
23
+ * @generated from protobuf rpc: SkillRequest(pncp.v1.PncpRequest) returns (pncp.v1.MessageResponse);
24
+ */
25
+ skillRequest(input, options) {
26
+ const method = this.methods[0], opt = this._transport.mergeOptions(options);
27
+ return stackIntercept("unary", this._transport, method, opt, input);
28
+ }
29
+ /**
30
+ * Follow up messages within a conversation are sent with via this endpoint.
31
+ *
32
+ * @generated from protobuf rpc: PncpMessageRequest(pncp.v1.PncpMessage) returns (pncp.v1.MessageResponse);
33
+ */
34
+ pncpMessageRequest(input, options) {
35
+ const method = this.methods[1], opt = this._transport.mergeOptions(options);
36
+ return stackIntercept("unary", this._transport, method, opt, input);
37
+ }
38
+ /**
39
+ * The callback stream for an actor to receive all Pncp type messages. This includes skill requests
40
+ * and all additional Pncp messages sent in the conversation thread.
41
+ *
42
+ * @generated from protobuf rpc: PncpCallbackStream(pncp.v1.PncpCallbackRequest) returns (stream pncp.v1.PncpCallback);
43
+ */
44
+ pncpCallbackStream(input, options) {
45
+ const method = this.methods[2], opt = this._transport.mergeOptions(options);
46
+ return stackIntercept("serverStreaming", this._transport, method, opt, input);
47
+ }
48
+ /**
49
+ * Creates a new observation stream.
50
+ *
51
+ * @generated from protobuf rpc: CreateObserverStream(pncp.v1.ObservationRequest) returns (stream pncp.v1.ObservationMessageWrapper);
52
+ */
53
+ createObserverStream(input, options) {
54
+ const method = this.methods[3], opt = this._transport.mergeOptions(options);
55
+ return stackIntercept("serverStreaming", this._transport, method, opt, input);
56
+ }
57
+ /**
58
+ * A direct cross domain request, posted from one node to another. The other node is often expected to post
59
+ * the results back.
60
+ *
61
+ * @generated from protobuf rpc: CrossDomainRequest(pncp.v1.CrossDomainMessage) returns (pncp.v1.CrossDomainResponse);
62
+ */
63
+ crossDomainRequest(input, options) {
64
+ const method = this.methods[4], opt = this._transport.mergeOptions(options);
65
+ return stackIntercept("unary", this._transport, method, opt, input);
66
+ }
67
+ /**
68
+ * Inverted API for an edge node to connect to another node. It creates this stream so that the node it
69
+ * connects to can stream messages back to the edge node. The edge node is then required to stream
70
+ * `MessageResponse` to each incoming message back to the connected node.
71
+ *
72
+ * @generated from protobuf rpc: CrossDomainStream(stream pncp.v1.CrossDomainResponse) returns (stream pncp.v1.CrossDomainStreamMessage);
73
+ */
74
+ crossDomainStream(options) {
75
+ const method = this.methods[5], opt = this._transport.mergeOptions(options);
76
+ return stackIntercept("duplex", this._transport, method, opt);
77
+ }
78
+ /**
79
+ * @generated from protobuf rpc: Login(pncp.v1.LoginRequest) returns (pncp.v1.LoginResponse);
80
+ */
81
+ login(input, options) {
82
+ const method = this.methods[6], opt = this._transport.mergeOptions(options);
83
+ return stackIntercept("unary", this._transport, method, opt, input);
84
+ }
85
+ /**
86
+ * @generated from protobuf rpc: RefreshToken(pncp.v1.RefreshTokenRequest) returns (pncp.v1.LoginResponse);
87
+ */
88
+ refreshToken(input, options) {
89
+ const method = this.methods[7], opt = this._transport.mergeOptions(options);
90
+ return stackIntercept("unary", this._transport, method, opt, input);
91
+ }
92
+ /**
93
+ * A PNCP message received from a medium. Note, that we are likely to rework mediums.
94
+ * Given currently limitations with mediums this route is left unauthenticated.
95
+ *
96
+ * @generated from protobuf rpc: PncpMediumMessageRequest(pncp.v1.PncpMediumMessage) returns (pncp.v1.MessageResponse);
97
+ */
98
+ pncpMediumMessageRequest(input, options) {
99
+ const method = this.methods[8], opt = this._transport.mergeOptions(options);
100
+ return stackIntercept("unary", this._transport, method, opt, input);
101
+ }
102
+ }
@@ -0,0 +1,6 @@
1
+ import { ServiceType } from "@protobuf-ts/runtime-rpc";
2
+ /**
3
+ * @generated ServiceType for protobuf service pncp.v1.Broker
4
+ */
5
+ export declare const Broker: ServiceType;
6
+ //# sourceMappingURL=broker.grpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broker.grpc.d.ts","sourceRoot":"","sources":["../../src/proto/broker.grpc.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD;;GAEG;AACH,eAAO,MAAM,MAAM,aAUjB,CAAC"}