@pitcher/js-api 1.28.0 → 1.29.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/js-api.esm.js +69 -5
- package/js-api.esm.js.map +1 -1
- package/js-api.umd.min.js +10 -10
- package/js-api.umd.min.js.map +1 -1
- package/lib/apps/canvas-builder/composables/useCanvasTheme.d.ts +18 -18
- package/lib/apps/canvas-builder/util/canvas.util.d.ts +8 -0
- package/lib/sdk/api/HighLevelApi.d.ts +9 -3
- package/lib/sdk/api/modules/admin/types.admin.d.ts +1 -0
- package/lib/sdk/api/modules/index.d.ts +2 -1
- package/lib/sdk/api/modules/stt.d.ts +65 -0
- package/lib/sdk/api/modules/stt.spec.d.ts +1 -0
- package/lib/sdk/api/modules/tts.d.ts +41 -0
- package/lib/sdk/api/modules/tts.spec.d.ts +1 -0
- package/lib/sdk/interfaces.d.ts +26 -1
- package/lib/sdk/main.d.ts +27 -6
- package/lib/sdk/payload.types.d.ts +180 -0
- package/lib/types/canvases.d.ts +0 -3
- package/lib/types/launchDarkly.types.d.ts +1 -1
- package/lib/types/sfdc.d.ts +15 -0
- package/lib/util/soql.util.d.ts +36 -0
- package/package.json +1 -1
- package/types/openapi/index.d.ts +0 -1
- package/types/openapi/models/PatchedUserRequest.d.ts +1 -2
- package/types/openapi/models/User.d.ts +1 -2
- package/types/openapi/models/UserRequest.d.ts +1 -2
- package/lib/sdk/api/modules/languages.d.ts +0 -8
- package/types/openapi/models/LanguageEnum.d.ts +0 -12
package/js-api.esm.js
CHANGED
|
@@ -2773,10 +2773,6 @@ function isOffline() {
|
|
|
2773
2773
|
return this.API.request("is_offline");
|
|
2774
2774
|
}
|
|
2775
2775
|
|
|
2776
|
-
function getLanguages() {
|
|
2777
|
-
return this.API.request("get_languages");
|
|
2778
|
-
}
|
|
2779
|
-
|
|
2780
2776
|
function getCanvases$1(payload) {
|
|
2781
2777
|
return this.API.request("get_canvases", payload);
|
|
2782
2778
|
}
|
|
@@ -3760,6 +3756,65 @@ function assignCanvasTheme(payload) {
|
|
|
3760
3756
|
return this.API.request("assign_canvas_theme", payload);
|
|
3761
3757
|
}
|
|
3762
3758
|
|
|
3759
|
+
const STT_ERROR_CODES = [
|
|
3760
|
+
"STT_DISABLED",
|
|
3761
|
+
"STT_DEVICE_UNSUPPORTED",
|
|
3762
|
+
"STT_MODEL_NOT_READY",
|
|
3763
|
+
"STT_BUSY",
|
|
3764
|
+
"STT_MIC_PERMISSION_DENIED",
|
|
3765
|
+
"STT_NOT_RECORDING",
|
|
3766
|
+
"STT_CAPTURE_FAILED",
|
|
3767
|
+
"STT_ERROR"
|
|
3768
|
+
];
|
|
3769
|
+
function asSttUnsupportedError(error) {
|
|
3770
|
+
const marker = "requestTypeDoesNotExists";
|
|
3771
|
+
const e = error;
|
|
3772
|
+
const isUnsupported = e?.error_code === marker || e?.errorCode === marker || e?.code === marker || typeof e?.reason === "string" && e.reason.includes(marker) || typeof e?.message === "string" && e.message.includes(marker);
|
|
3773
|
+
return isUnsupported ? new Error("STT_DEVICE_UNSUPPORTED: dictation is not supported by this app version") : error;
|
|
3774
|
+
}
|
|
3775
|
+
function sttStart(payload) {
|
|
3776
|
+
return this.API.request("stt.start", payload).catch((error) => {
|
|
3777
|
+
throw asSttUnsupportedError(error);
|
|
3778
|
+
});
|
|
3779
|
+
}
|
|
3780
|
+
function sttAvailability() {
|
|
3781
|
+
return this.API.request("stt.availability");
|
|
3782
|
+
}
|
|
3783
|
+
function sttWarmup() {
|
|
3784
|
+
return this.API.request("stt.warmup");
|
|
3785
|
+
}
|
|
3786
|
+
function sttStop(payload) {
|
|
3787
|
+
return this.API.request("stt.stop", payload).catch((error) => {
|
|
3788
|
+
throw asSttUnsupportedError(error);
|
|
3789
|
+
});
|
|
3790
|
+
}
|
|
3791
|
+
function sttErrorCode(error) {
|
|
3792
|
+
const e = error;
|
|
3793
|
+
const direct = e?.code ?? e?.error_code ?? e?.errorCode;
|
|
3794
|
+
if (typeof direct === "string" && STT_ERROR_CODES.includes(direct)) {
|
|
3795
|
+
return direct;
|
|
3796
|
+
}
|
|
3797
|
+
const text = typeof e?.reason === "string" ? e.reason : typeof e?.message === "string" ? e.message : "";
|
|
3798
|
+
return STT_ERROR_CODES.find((code) => text.includes(code));
|
|
3799
|
+
}
|
|
3800
|
+
|
|
3801
|
+
const TTS_ERROR_CODES = ["TTS_EMPTY_TEXT", "TTS_VOICE_UNAVAILABLE", "TTS_ERROR"];
|
|
3802
|
+
function ttsSpeak(payload) {
|
|
3803
|
+
return this.API.request("tts.speak", payload);
|
|
3804
|
+
}
|
|
3805
|
+
function ttsStop() {
|
|
3806
|
+
return this.API.request("tts.stop");
|
|
3807
|
+
}
|
|
3808
|
+
function ttsErrorCode(error) {
|
|
3809
|
+
const e = error;
|
|
3810
|
+
const direct = e?.code ?? e?.error_code ?? e?.errorCode;
|
|
3811
|
+
if (typeof direct === "string" && TTS_ERROR_CODES.includes(direct)) {
|
|
3812
|
+
return direct;
|
|
3813
|
+
}
|
|
3814
|
+
const text = typeof e?.reason === "string" ? e.reason : typeof e?.message === "string" ? e.message : "";
|
|
3815
|
+
return TTS_ERROR_CODES.find((code) => text.includes(code));
|
|
3816
|
+
}
|
|
3817
|
+
|
|
3763
3818
|
const modules = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
3764
3819
|
__proto__: null,
|
|
3765
3820
|
aiComplete,
|
|
@@ -3805,7 +3860,6 @@ const modules = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
3805
3860
|
getFolder,
|
|
3806
3861
|
getFolders,
|
|
3807
3862
|
getInstanceMetadataTemplates: getInstanceMetadataTemplates$1,
|
|
3808
|
-
getLanguages,
|
|
3809
3863
|
getSectionsByIds,
|
|
3810
3864
|
getThemes,
|
|
3811
3865
|
getUsers: getUsers$1,
|
|
@@ -3827,10 +3881,18 @@ const modules = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
3827
3881
|
shareCanvas,
|
|
3828
3882
|
showPeerSession,
|
|
3829
3883
|
showSyncbox,
|
|
3884
|
+
sttAvailability,
|
|
3885
|
+
sttErrorCode,
|
|
3886
|
+
sttStart,
|
|
3887
|
+
sttStop,
|
|
3888
|
+
sttWarmup,
|
|
3830
3889
|
submitUserFeedback,
|
|
3831
3890
|
toast: toast$2,
|
|
3832
3891
|
track,
|
|
3833
3892
|
triggerNonFilesSync,
|
|
3893
|
+
ttsErrorCode,
|
|
3894
|
+
ttsSpeak,
|
|
3895
|
+
ttsStop,
|
|
3834
3896
|
unassignCanvasTheme,
|
|
3835
3897
|
updateCanvas: updateCanvas$2,
|
|
3836
3898
|
updateCanvasIndicators,
|
|
@@ -3947,6 +4009,8 @@ var PitcherEventName = /* @__PURE__ */ ((PitcherEventName2) => {
|
|
|
3947
4009
|
PitcherEventName2["SYNC_BADGE_VALUE_REPORTED"] = "sync_badge_value_reported";
|
|
3948
4010
|
PitcherEventName2["SYNC_BOX_RESOLVE_ERROR_TAPPED"] = "sync_box_resolve_error_tapped";
|
|
3949
4011
|
PitcherEventName2["PEER_CONNECTIVITY_EVENT"] = "peer_connectivity_event";
|
|
4012
|
+
PitcherEventName2["STT_PARTIAL"] = "stt.partial";
|
|
4013
|
+
PitcherEventName2["STT_INTERRUPTED"] = "stt.interrupted";
|
|
3950
4014
|
return PitcherEventName2;
|
|
3951
4015
|
})(PitcherEventName || {});
|
|
3952
4016
|
var PitcherBroadcastedEventName = /* @__PURE__ */ ((PitcherBroadcastedEventName2) => {
|