@voiceflow/sdk-runtime 1.4.1 → 1.5.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.5.1](https://github.com/voiceflow/adapters/compare/@voiceflow/sdk-runtime@1.5.0...@voiceflow/sdk-runtime@1.5.1) (2022-10-26)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **deps:** update dependency @voiceflow/base-types to v2.71.3 (vf-000) ([#49](https://github.com/voiceflow/adapters/issues/49)) ([5c1871b](https://github.com/voiceflow/adapters/commit/5c1871bb04c78cc042250977bda44e88d1512d8c))
11
+
12
+ # [1.5.0](https://github.com/voiceflow/adapters/compare/@voiceflow/sdk-runtime@1.4.1...@voiceflow/sdk-runtime@1.5.0) (2022-10-24)
13
+
14
+ ### Features
15
+
16
+ * create transcripts (CT-1050) ([#48](https://github.com/voiceflow/adapters/issues/48)) ([457a228](https://github.com/voiceflow/adapters/commit/457a2285328bb75d355ed8a24e746020e5538aa6))
17
+
6
18
  ## [1.4.1](https://github.com/voiceflow/adapters/compare/@voiceflow/sdk-runtime@1.4.0...@voiceflow/sdk-runtime@1.4.1) (2022-10-21)
7
19
 
8
20
  ### Bug Fixes
@@ -4,6 +4,7 @@ export declare class AuthRuntimeService extends RuntimeService {
4
4
  private readonly authorization;
5
5
  constructor(options: RuntimeOptions<AuthVerify>);
6
6
  interact(request: RuntimeInteractRequest): Promise<RuntimeInteractResponse>;
7
- getPublishing(): Promise<{}>;
7
+ getPublishing(): Promise<never>;
8
+ createTranscript(): Promise<never>;
8
9
  }
9
10
  //# sourceMappingURL=runtime.service.auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.service.auth.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAEpB,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC;IAMzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAe3E,aAAa;CAG3B"}
1
+ {"version":3,"file":"runtime.service.auth.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAEpB,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC;IAMzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAejF,aAAa;IAKb,gBAAgB;CAGxB"}
@@ -20,8 +20,12 @@ class AuthRuntimeService extends runtime_service_1.RuntimeService {
20
20
  });
21
21
  }
22
22
  // TODO: expose authenticated publishing
23
- async getPublishing() {
24
- return {};
23
+ getPublishing() {
24
+ return Promise.reject(new Error('not implemented'));
25
+ }
26
+ // TODO: expose authenticated createTranscript
27
+ createTranscript() {
28
+ return Promise.reject(new Error('not implemented'));
25
29
  }
26
30
  }
27
31
  exports.AuthRuntimeService = AuthRuntimeService;
@@ -1,3 +1,4 @@
1
+ import type { BaseModels } from '@voiceflow/base-types';
1
2
  import type { RuntimeHttpRequest, RuntimeInteractRequest, RuntimeInteractResponse, RuntimeOptions } from './runtime.interface';
2
3
  export declare abstract class RuntimeService {
3
4
  private readonly options;
@@ -6,6 +7,11 @@ export declare abstract class RuntimeService {
6
7
  abstract getPublishing(request: {
7
8
  versionID?: string;
8
9
  }): Promise<Record<string, unknown>>;
10
+ abstract createTranscript(sessionID: string, metadata: {
11
+ os?: string;
12
+ device?: string;
13
+ browser?: string;
14
+ }): Promise<BaseModels.Transcript.Model>;
9
15
  abstract interact(request: RuntimeInteractRequest): Promise<Partial<RuntimeInteractResponse> & Pick<RuntimeInteractResponse, 'trace'>>;
10
16
  protected send<T>(path: string, args?: RuntimeHttpRequest): Promise<T>;
11
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,8BAAsB,cAAc;IAGf,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;gBAEZ,OAAO,EAAE,cAAc;aAO3C,aAAa,CAAC,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;aAEhF,QAAQ,CACtB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;cAErE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,CAAC,CAAC;CAoBjF"}
1
+ {"version":3,"file":"runtime.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,8BAAsB,cAAc;IAGf,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;gBAEZ,OAAO,EAAE,cAAc;aAO3C,aAAa,CAAC,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;aAEhF,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE;QACR,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GACA,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC;aAEvB,QAAQ,CACtB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;cAErE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,CAAC,CAAC;CAoBjF"}
@@ -1,3 +1,4 @@
1
+ import type { BaseModels } from '@voiceflow/base-types';
1
2
  import type { PublicVerify, RuntimeInteractRequest, RuntimeInteractResponse, RuntimeOptions } from '../runtime/runtime.interface.js';
2
3
  import { RuntimeService } from '../runtime/runtime.service';
3
4
  export declare class PublicRuntimeService extends RuntimeService {
@@ -7,5 +8,10 @@ export declare class PublicRuntimeService extends RuntimeService {
7
8
  getPublishing(request: {
8
9
  versionID?: string;
9
10
  }): Promise<Record<string, unknown>>;
11
+ createTranscript(sessionID: string, metadata: {
12
+ os?: string;
13
+ device?: string;
14
+ browser?: string;
15
+ }): Promise<BaseModels.Transcript.Model>;
10
16
  }
11
17
  //# sourceMappingURL=runtime.service.public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.service.public.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEhB,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC;IAM3C,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAe1F,aAAa,CAAC,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAU9F"}
1
+ {"version":3,"file":"runtime.service.public.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEhB,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC;IAM3C,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAe1F,aAAa,CAAC,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAWhF,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;CAM9G"}
@@ -26,5 +26,11 @@ class PublicRuntimeService extends runtime_service_1.RuntimeService {
26
26
  },
27
27
  });
28
28
  }
29
+ async createTranscript(sessionID, metadata) {
30
+ return this.send(`public/${this.projectID}/transcripts`, {
31
+ method: 'POST',
32
+ body: { ...metadata, sessionID },
33
+ });
34
+ }
29
35
  }
30
36
  exports.PublicRuntimeService = PublicRuntimeService;
@@ -8,5 +8,6 @@ export declare class VoiceflowRuntime<T> {
8
8
  registerStep(step: TraceDeclaration<T, any>): this;
9
9
  interact(context: T, request: RuntimeInteractRequest): Promise<T>;
10
10
  getPublishing(...options: Parameters<RuntimeService['getPublishing']>): Promise<Record<string, unknown>>;
11
+ createTranscript(...options: Parameters<RuntimeService['createTranscript']>): Promise<import("@voiceflow/base-types/build/cjs/models/transcripts.js").Model>;
11
12
  }
12
13
  //# sourceMappingURL=sdk.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.service.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,qBAAa,gBAAgB,CAAC,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IAEzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;gBAErB,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAY/C,YAAY,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,EAAE,GAAG,CAAC;IAKrC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,CAAC,CAAC;IAKjE,aAAa,CAAC,GAAG,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;CAGnF"}
1
+ {"version":3,"file":"sdk.service.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,qBAAa,gBAAgB,CAAC,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IAEzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;gBAErB,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAY/C,YAAY,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,EAAE,GAAG,CAAC;IAKrC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,CAAC,CAAC;IAKjE,aAAa,CAAC,GAAG,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAIrE,gBAAgB,CAAC,GAAG,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;CAGzF"}
@@ -27,5 +27,8 @@ class VoiceflowRuntime {
27
27
  async getPublishing(...options) {
28
28
  return this.runtime.getPublishing(...options);
29
29
  }
30
+ async createTranscript(...options) {
31
+ return this.runtime.createTranscript(...options);
32
+ }
30
33
  }
31
34
  exports.VoiceflowRuntime = VoiceflowRuntime;
@@ -4,6 +4,7 @@ export declare class AuthRuntimeService extends RuntimeService {
4
4
  private readonly authorization;
5
5
  constructor(options: RuntimeOptions<AuthVerify>);
6
6
  interact(request: RuntimeInteractRequest): Promise<RuntimeInteractResponse>;
7
- getPublishing(): Promise<{}>;
7
+ getPublishing(): Promise<never>;
8
+ createTranscript(): Promise<never>;
8
9
  }
9
10
  //# sourceMappingURL=runtime.service.auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.service.auth.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAEpB,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC;IAMzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAe3E,aAAa;CAG3B"}
1
+ {"version":3,"file":"runtime.service.auth.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAEpB,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC;IAMzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAejF,aAAa;IAKb,gBAAgB;CAGxB"}
@@ -17,7 +17,11 @@ export class AuthRuntimeService extends RuntimeService {
17
17
  });
18
18
  }
19
19
  // TODO: expose authenticated publishing
20
- async getPublishing() {
21
- return {};
20
+ getPublishing() {
21
+ return Promise.reject(new Error('not implemented'));
22
+ }
23
+ // TODO: expose authenticated createTranscript
24
+ createTranscript() {
25
+ return Promise.reject(new Error('not implemented'));
22
26
  }
23
27
  }
@@ -1,3 +1,4 @@
1
+ import type { BaseModels } from '@voiceflow/base-types';
1
2
  import type { RuntimeHttpRequest, RuntimeInteractRequest, RuntimeInteractResponse, RuntimeOptions } from './runtime.interface.js';
2
3
  export declare abstract class RuntimeService {
3
4
  private readonly options;
@@ -6,6 +7,11 @@ export declare abstract class RuntimeService {
6
7
  abstract getPublishing(request: {
7
8
  versionID?: string;
8
9
  }): Promise<Record<string, unknown>>;
10
+ abstract createTranscript(sessionID: string, metadata: {
11
+ os?: string;
12
+ device?: string;
13
+ browser?: string;
14
+ }): Promise<BaseModels.Transcript.Model>;
9
15
  abstract interact(request: RuntimeInteractRequest): Promise<Partial<RuntimeInteractResponse> & Pick<RuntimeInteractResponse, 'trace'>>;
10
16
  protected send<T>(path: string, args?: RuntimeHttpRequest): Promise<T>;
11
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,8BAAsB,cAAc;IAGf,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;gBAEZ,OAAO,EAAE,cAAc;aAO3C,aAAa,CAAC,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;aAEhF,QAAQ,CACtB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
1
+ import type { BaseModels } from '@voiceflow/base-types';
1
2
  import type { PublicVerify, RuntimeInteractRequest, RuntimeInteractResponse, RuntimeOptions } from '../runtime/runtime.interface.js';
2
3
  import { RuntimeService } from '../runtime/runtime.service.js';
3
4
  export declare class PublicRuntimeService extends RuntimeService {
@@ -7,5 +8,10 @@ export declare class PublicRuntimeService extends RuntimeService {
7
8
  getPublishing(request: {
8
9
  versionID?: string;
9
10
  }): Promise<Record<string, unknown>>;
11
+ createTranscript(sessionID: string, metadata: {
12
+ os?: string;
13
+ device?: string;
14
+ browser?: string;
15
+ }): Promise<BaseModels.Transcript.Model>;
10
16
  }
11
17
  //# sourceMappingURL=runtime.service.public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.service.public.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEhB,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC;IAM3C,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAe1F,aAAa,CAAC,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAU9F"}
1
+ {"version":3,"file":"runtime.service.public.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.service.public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEhB,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC;IAM3C,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAe1F,aAAa,CAAC,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAWhF,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;CAM9G"}
@@ -23,4 +23,10 @@ export class PublicRuntimeService extends RuntimeService {
23
23
  },
24
24
  });
25
25
  }
26
+ async createTranscript(sessionID, metadata) {
27
+ return this.send(`public/${this.projectID}/transcripts`, {
28
+ method: 'POST',
29
+ body: { ...metadata, sessionID },
30
+ });
31
+ }
26
32
  }
@@ -8,5 +8,6 @@ export declare class VoiceflowRuntime<T> {
8
8
  registerStep(step: TraceDeclaration<T, any>): this;
9
9
  interact(context: T, request: RuntimeInteractRequest): Promise<T>;
10
10
  getPublishing(...options: Parameters<RuntimeService['getPublishing']>): Promise<Record<string, unknown>>;
11
+ createTranscript(...options: Parameters<RuntimeService['createTranscript']>): Promise<import("@voiceflow/base-types/build/cjs/models/transcripts.js").Model>;
11
12
  }
12
13
  //# sourceMappingURL=sdk.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.service.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.service.ts"],"names":[],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aAAa,CAAC,GAAG,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAIrE,gBAAgB,CAAC,GAAG,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;CAGzF"}
@@ -24,4 +24,7 @@ export class VoiceflowRuntime {
24
24
  async getPublishing(...options) {
25
25
  return this.runtime.getPublishing(...options);
26
26
  }
27
+ async createTranscript(...options) {
28
+ return this.runtime.createTranscript(...options);
29
+ }
27
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voiceflow/sdk-runtime",
3
- "version": "1.4.1",
3
+ "version": "1.5.1",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./build/esm/main.js",
@@ -30,7 +30,7 @@
30
30
  "extends": "@voiceflow-meta/eslint-config"
31
31
  },
32
32
  "dependencies": {
33
- "@voiceflow/base-types": "2.71.1",
33
+ "@voiceflow/base-types": "2.71.3",
34
34
  "http-errors": "2.0.0"
35
35
  },
36
36
  "devDependencies": {
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "bb9170e004b44e9af5338137056dacb22cf6cf85"
45
+ "gitHead": "659d53971b49a813644fef1888130e31fc0d0d57"
46
46
  }
@@ -30,7 +30,12 @@ export class AuthRuntimeService extends RuntimeService {
30
30
  }
31
31
 
32
32
  // TODO: expose authenticated publishing
33
- public async getPublishing() {
34
- return {};
33
+ public getPublishing() {
34
+ return Promise.reject(new Error('not implemented'));
35
+ }
36
+
37
+ // TODO: expose authenticated createTranscript
38
+ public createTranscript() {
39
+ return Promise.reject(new Error('not implemented'));
35
40
  }
36
41
  }
@@ -1,3 +1,5 @@
1
+ import type { BaseModels } from '@voiceflow/base-types';
2
+
1
3
  import type {
2
4
  PublicVerify,
3
5
  RuntimeInteractRequest,
@@ -40,4 +42,11 @@ export class PublicRuntimeService extends RuntimeService {
40
42
  },
41
43
  });
42
44
  }
45
+
46
+ public async createTranscript(sessionID: string, metadata: { os?: string; device?: string; browser?: string }) {
47
+ return this.send<BaseModels.Transcript.Model>(`public/${this.projectID}/transcripts`, {
48
+ method: 'POST',
49
+ body: { ...metadata, sessionID },
50
+ });
51
+ }
43
52
  }
@@ -1,3 +1,4 @@
1
+ import type { BaseModels } from '@voiceflow/base-types';
1
2
  import createHTTPError from 'http-errors';
2
3
 
3
4
  import type {
@@ -19,6 +20,15 @@ export abstract class RuntimeService {
19
20
 
20
21
  public abstract getPublishing(request: { versionID?: string }): Promise<Record<string, unknown>>;
21
22
 
23
+ public abstract createTranscript(
24
+ sessionID: string,
25
+ metadata: {
26
+ os?: string;
27
+ device?: string;
28
+ browser?: string;
29
+ }
30
+ ): Promise<BaseModels.Transcript.Model>;
31
+
22
32
  public abstract interact(
23
33
  request: RuntimeInteractRequest
24
34
  ): Promise<Partial<RuntimeInteractResponse> & Pick<RuntimeInteractResponse, 'trace'>>;
@@ -35,4 +35,8 @@ export class VoiceflowRuntime<T> {
35
35
  public async getPublishing(...options: Parameters<RuntimeService['getPublishing']>) {
36
36
  return this.runtime.getPublishing(...options);
37
37
  }
38
+
39
+ public async createTranscript(...options: Parameters<RuntimeService['createTranscript']>) {
40
+ return this.runtime.createTranscript(...options);
41
+ }
38
42
  }