@otonoma/paranet-client 2.16.1 → 2.17.0-rc.12
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/dist/cjs/client.d.ts +3 -0
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/{index-Dz-_ygkd.cjs → index-eBiJ1Egw.cjs} +194 -70
- package/dist/cjs/index-eBiJ1Egw.cjs.map +1 -0
- package/dist/cjs/index.cjs +32 -4
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/pncp.d.ts +3 -0
- package/dist/cjs/pncp.d.ts.map +1 -1
- package/dist/cjs/proto/pncp.d.ts +18 -0
- package/dist/cjs/proto/pncp.d.ts.map +1 -1
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -0
- package/dist/esm/client.d.ts +3 -0
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/{index-CO5PSAqf.mjs → index-PztyZob7.mjs} +194 -70
- package/dist/esm/index-PztyZob7.mjs.map +1 -0
- package/dist/esm/index.mjs +32 -4
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/pncp.d.ts +3 -0
- package/dist/esm/pncp.d.ts.map +1 -1
- package/dist/esm/proto/pncp.d.ts +18 -0
- package/dist/esm/proto/pncp.d.ts.map +1 -1
- package/dist/index.d.cts +24 -0
- package/dist/index.d.mts +24 -0
- package/dist/pncp.d.ts +3 -0
- package/dist/pncp.d.ts.map +1 -1
- package/dist/pncp.js +2 -0
- package/dist/proto/pncp.d.ts +18 -0
- package/dist/proto/pncp.d.ts.map +1 -1
- package/dist/proto/pncp.js +24 -3
- package/package.json +1 -1
- package/dist/cjs/index-Dz-_ygkd.cjs.map +0 -1
- package/dist/esm/index-CO5PSAqf.mjs.map +0 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -3645,7 +3645,8 @@ class PncpRequest$Type extends MessageType {
|
|
|
3645
3645
|
{ no: 8, name: "key", kind: "message", T: () => Value },
|
|
3646
3646
|
{ no: 9, name: "medium_info", kind: "message", T: () => PncpRequestMediumInfo },
|
|
3647
3647
|
{ no: 10, name: "must_match", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
3648
|
-
{ no: 11, name: "use_lock", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
3648
|
+
{ no: 11, name: "use_lock", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
3649
|
+
{ no: 13, name: "partition", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
3649
3650
|
]);
|
|
3650
3651
|
}
|
|
3651
3652
|
create(value) {
|
|
@@ -3695,6 +3696,9 @@ class PncpRequest$Type extends MessageType {
|
|
|
3695
3696
|
case /* bool use_lock */ 11:
|
|
3696
3697
|
message.useLock = reader.bool();
|
|
3697
3698
|
break;
|
|
3699
|
+
case /* optional string partition */ 13:
|
|
3700
|
+
message.partition = reader.string();
|
|
3701
|
+
break;
|
|
3698
3702
|
default:
|
|
3699
3703
|
let u = options.readUnknownField;
|
|
3700
3704
|
if (u === "throw")
|
|
@@ -3740,6 +3744,9 @@ class PncpRequest$Type extends MessageType {
|
|
|
3740
3744
|
/* bool use_lock = 11; */
|
|
3741
3745
|
if (message.useLock !== false)
|
|
3742
3746
|
writer.tag(11, WireType.Varint).bool(message.useLock);
|
|
3747
|
+
/* optional string partition = 13; */
|
|
3748
|
+
if (message.partition !== undefined)
|
|
3749
|
+
writer.tag(13, WireType.LengthDelimited).string(message.partition);
|
|
3743
3750
|
let u = options.writeUnknownFields;
|
|
3744
3751
|
if (u !== false)
|
|
3745
3752
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -4134,7 +4141,8 @@ class PncpRequestCallback$Type extends MessageType {
|
|
|
4134
4141
|
{ no: 6, name: "author_id", kind: "message", T: () => EntityId },
|
|
4135
4142
|
{ no: 7, name: "target_actor_id", kind: "message", T: () => EntityId },
|
|
4136
4143
|
{ no: 8, name: "parameters", kind: "message", T: () => ParameterData },
|
|
4137
|
-
{ no: 9, name: "flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
|
|
4144
|
+
{ no: 9, name: "flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
4145
|
+
{ no: 10, name: "partition", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
4138
4146
|
]);
|
|
4139
4147
|
}
|
|
4140
4148
|
create(value) {
|
|
@@ -4177,6 +4185,9 @@ class PncpRequestCallback$Type extends MessageType {
|
|
|
4177
4185
|
case /* uint32 flags */ 9:
|
|
4178
4186
|
message.flags = reader.uint32();
|
|
4179
4187
|
break;
|
|
4188
|
+
case /* optional string partition */ 10:
|
|
4189
|
+
message.partition = reader.string();
|
|
4190
|
+
break;
|
|
4180
4191
|
default:
|
|
4181
4192
|
let u = options.readUnknownField;
|
|
4182
4193
|
if (u === "throw")
|
|
@@ -4216,6 +4227,9 @@ class PncpRequestCallback$Type extends MessageType {
|
|
|
4216
4227
|
/* uint32 flags = 9; */
|
|
4217
4228
|
if (message.flags !== 0)
|
|
4218
4229
|
writer.tag(9, WireType.Varint).uint32(message.flags);
|
|
4230
|
+
/* optional string partition = 10; */
|
|
4231
|
+
if (message.partition !== undefined)
|
|
4232
|
+
writer.tag(10, WireType.LengthDelimited).string(message.partition);
|
|
4219
4233
|
let u = options.writeUnknownFields;
|
|
4220
4234
|
if (u !== false)
|
|
4221
4235
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -4238,7 +4252,8 @@ class PncpMessageCallback$Type extends MessageType {
|
|
|
4238
4252
|
{ no: 6, name: "params", kind: "message", T: () => Value },
|
|
4239
4253
|
{ no: 7, name: "callback", kind: "message", T: () => Value },
|
|
4240
4254
|
{ no: 8, name: "medium", kind: "message", T: () => Value },
|
|
4241
|
-
{ no: 9, name: "conversation_state", kind: "enum", T: () => ["pncp.v1.ConversationState", exports.ConversationState] }
|
|
4255
|
+
{ no: 9, name: "conversation_state", kind: "enum", T: () => ["pncp.v1.ConversationState", exports.ConversationState] },
|
|
4256
|
+
{ no: 10, name: "partition", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
4242
4257
|
]);
|
|
4243
4258
|
}
|
|
4244
4259
|
create(value) {
|
|
@@ -4281,6 +4296,9 @@ class PncpMessageCallback$Type extends MessageType {
|
|
|
4281
4296
|
case /* pncp.v1.ConversationState conversation_state */ 9:
|
|
4282
4297
|
message.conversationState = reader.int32();
|
|
4283
4298
|
break;
|
|
4299
|
+
case /* optional string partition */ 10:
|
|
4300
|
+
message.partition = reader.string();
|
|
4301
|
+
break;
|
|
4284
4302
|
default:
|
|
4285
4303
|
let u = options.readUnknownField;
|
|
4286
4304
|
if (u === "throw")
|
|
@@ -4320,6 +4338,9 @@ class PncpMessageCallback$Type extends MessageType {
|
|
|
4320
4338
|
/* pncp.v1.ConversationState conversation_state = 9; */
|
|
4321
4339
|
if (message.conversationState !== 0)
|
|
4322
4340
|
writer.tag(9, WireType.Varint).int32(message.conversationState);
|
|
4341
|
+
/* optional string partition = 10; */
|
|
4342
|
+
if (message.partition !== undefined)
|
|
4343
|
+
writer.tag(10, WireType.LengthDelimited).string(message.partition);
|
|
4323
4344
|
let u = options.writeUnknownFields;
|
|
4324
4345
|
if (u !== false)
|
|
4325
4346
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -7154,7 +7175,7 @@ class HealthClient {
|
|
|
7154
7175
|
let undiciModule = null;
|
|
7155
7176
|
async function getUndici() {
|
|
7156
7177
|
if (!undiciModule) {
|
|
7157
|
-
undiciModule = await Promise.resolve().then(function () { return require('./index-
|
|
7178
|
+
undiciModule = await Promise.resolve().then(function () { return require('./index-eBiJ1Egw.cjs'); }).then(function (n) { return n.index; });
|
|
7158
7179
|
}
|
|
7159
7180
|
return undiciModule;
|
|
7160
7181
|
}
|
|
@@ -7163,6 +7184,7 @@ class PncpClient {
|
|
|
7163
7184
|
this.actorId = init.actorId;
|
|
7164
7185
|
this.endpoint = init.endpoint;
|
|
7165
7186
|
this.actorVersion = init.actorVersion;
|
|
7187
|
+
this.defaultPartition = init.defaultPartition;
|
|
7166
7188
|
var fetchFn = init.fetch;
|
|
7167
7189
|
// Note: insecure TLS bypass only works in Node.js with undici
|
|
7168
7190
|
// In browser environments, insecure mode is ignored (browsers don't allow TLS bypass)
|
|
@@ -7192,6 +7214,9 @@ class PncpClient {
|
|
|
7192
7214
|
const data = await response.response;
|
|
7193
7215
|
return data.status === HealthCheckResponse_ServingStatus.SERVING;
|
|
7194
7216
|
}
|
|
7217
|
+
setDefaultPartition(partition) {
|
|
7218
|
+
this.defaultPartition = partition;
|
|
7219
|
+
}
|
|
7195
7220
|
async pncpRequest(req) {
|
|
7196
7221
|
let version = req.actorVersion || this.actorVersion || "";
|
|
7197
7222
|
let actorId = req.actorId || this.actorId;
|
|
@@ -7215,6 +7240,7 @@ class PncpClient {
|
|
|
7215
7240
|
matchStrategy: req.matchStrategy || exports.SkillMatchStrategy.BEST,
|
|
7216
7241
|
mustMatch: req.mustMatch || true,
|
|
7217
7242
|
useLock: req.useLock || false,
|
|
7243
|
+
partition: req.partition || this.defaultPartition,
|
|
7218
7244
|
};
|
|
7219
7245
|
return await this.directPncpRequest(pncpReq);
|
|
7220
7246
|
}
|
|
@@ -7831,6 +7857,7 @@ function simplifyPncpRequestCallback(cb) {
|
|
|
7831
7857
|
skill: cb.parameters?.skill && Value.toJson(cb.parameters.skill),
|
|
7832
7858
|
medium: cb.parameters?.medium && Value.toJson(cb.parameters.medium),
|
|
7833
7859
|
},
|
|
7860
|
+
partition: cb.partition,
|
|
7834
7861
|
};
|
|
7835
7862
|
}
|
|
7836
7863
|
function simplifyPncpMessageCallback(cb) {
|
|
@@ -7845,6 +7872,7 @@ function simplifyPncpMessageCallback(cb) {
|
|
|
7845
7872
|
callback: cb.callback && Value.toJson(cb.callback),
|
|
7846
7873
|
medium: cb.medium && Value.toJson(cb.medium),
|
|
7847
7874
|
conversationState: cb.conversationState,
|
|
7875
|
+
partition: cb.partition,
|
|
7848
7876
|
};
|
|
7849
7877
|
}
|
|
7850
7878
|
function simplifyPncpMessage(msg) {
|