@voiceflow/api-sdk 1.39.0 → 1.41.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/build/client.d.ts +1 -1
- package/build/client.js +3 -3
- package/build/client.js.map +1 -1
- package/build/index.d.ts +6 -8
- package/build/index.js +5 -14
- package/build/index.js.map +1 -1
- package/build/models/diagram.d.ts +10 -0
- package/build/models/diagram.js +10 -1
- package/build/models/diagram.js.map +1 -1
- package/build/models/version.d.ts +66 -0
- package/build/models/version.js +20 -1
- package/build/models/version.js.map +1 -1
- package/build/publicclient.d.ts +5 -3
- package/build/publicclient.js +2 -2
- package/build/publicclient.js.map +1 -1
- package/build/resources/analytics.d.ts +10 -2
- package/build/resources/analytics.js +37 -5
- package/build/resources/analytics.js.map +1 -1
- package/build/resources/fetcher.d.ts +12 -5
- package/build/resources/fetcher.js +3 -2
- package/build/resources/fetcher.js.map +1 -1
- package/build/resources/user.js +2 -7
- package/build/resources/user.js.map +1 -1
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +14 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/struct.d.ts +4 -0
- package/build/{utils.js → utils/struct.js} +2 -6
- package/build/utils/struct.js.map +1 -0
- package/package.json +3 -4
- package/build/utils.d.ts +0 -5
- package/build/utils.js.map +0 -1
package/build/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ClientOptions, PublicClient } from "./publicclient";
|
|
|
2
2
|
import { User } from "./resources";
|
|
3
3
|
export declare class Client extends PublicClient {
|
|
4
4
|
user: User;
|
|
5
|
-
constructor(
|
|
5
|
+
constructor(options: Omit<ClientOptions, 'authorization'> & {
|
|
6
6
|
authorization: string;
|
|
7
7
|
});
|
|
8
8
|
}
|
package/build/client.js
CHANGED
|
@@ -4,9 +4,9 @@ exports.Client = void 0;
|
|
|
4
4
|
const publicclient_1 = require("./publicclient");
|
|
5
5
|
const resources_1 = require("./resources");
|
|
6
6
|
class Client extends publicclient_1.PublicClient {
|
|
7
|
-
constructor(
|
|
8
|
-
super(
|
|
9
|
-
this.user = new resources_1.User(authorization);
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
this.user = new resources_1.User(options.authorization);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.Client = Client;
|
package/build/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,iDAA6D;AAC7D,2CAAmC;AAEnC,MAAa,MAAO,SAAQ,2BAAY;IAGtC,YAAY,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,iDAA6D;AAC7D,2CAAmC;AAEnC,MAAa,MAAO,SAAQ,2BAAY;IAGtC,YAAY,OAAyE;QACnF,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,IAAI,gBAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC9C,CAAC;CACF;AARD,wBAQC"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as s from 'superstruct';
|
|
2
2
|
import { Client } from "./client";
|
|
3
|
-
import
|
|
4
|
-
import { PublicClient } from "./publicclient";
|
|
3
|
+
import { ClientOptions, PublicClient } from "./publicclient";
|
|
5
4
|
export { Client } from "./client";
|
|
6
5
|
export * from "./models";
|
|
7
6
|
export { PublicClient } from "./publicclient";
|
|
@@ -13,10 +12,9 @@ export declare const SParams: s.Struct<{
|
|
|
13
12
|
clientKey: s.Struct<string, any>;
|
|
14
13
|
apiEndpoint: s.Struct<string, any>;
|
|
15
14
|
}>;
|
|
16
|
-
export declare type Options =
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export declare type Params = s.StructType<typeof SParams> & Options;
|
|
15
|
+
export declare type Options = Pick<ClientOptions, 'options' | 'analyticsEncryption'>;
|
|
16
|
+
export interface Params extends s.StructType<typeof SParams>, Options {
|
|
17
|
+
}
|
|
20
18
|
export declare const SGenerateClientParams: s.Struct<{
|
|
21
19
|
authorization: string;
|
|
22
20
|
}, any>;
|
|
@@ -24,7 +22,7 @@ declare class ApiSDK {
|
|
|
24
22
|
private clientKey;
|
|
25
23
|
private apiEndpoint;
|
|
26
24
|
constructor({ clientKey, apiEndpoint }: Params);
|
|
27
|
-
generatePublicClient(
|
|
28
|
-
generateClient(
|
|
25
|
+
generatePublicClient(options?: Options): PublicClient;
|
|
26
|
+
generateClient(options: s.StructType<typeof SGenerateClientParams> & Options): Client;
|
|
29
27
|
}
|
|
30
28
|
export default ApiSDK;
|
package/build/index.js
CHANGED
|
@@ -40,21 +40,12 @@ class ApiSDK {
|
|
|
40
40
|
this.clientKey = clientKey;
|
|
41
41
|
this.apiEndpoint = apiEndpoint;
|
|
42
42
|
}
|
|
43
|
-
generatePublicClient(
|
|
44
|
-
return new publicclient_1.PublicClient({
|
|
45
|
-
options,
|
|
46
|
-
clientKey: this.clientKey,
|
|
47
|
-
apiEndpoint: this.apiEndpoint,
|
|
48
|
-
});
|
|
43
|
+
generatePublicClient(options = {}) {
|
|
44
|
+
return new publicclient_1.PublicClient(Object.assign(Object.assign({}, options), { clientKey: this.clientKey, apiEndpoint: this.apiEndpoint }));
|
|
49
45
|
}
|
|
50
|
-
generateClient(
|
|
51
|
-
s.assert({ authorization }, exports.SGenerateClientParams);
|
|
52
|
-
return new client_1.Client({
|
|
53
|
-
clientKey: this.clientKey,
|
|
54
|
-
options,
|
|
55
|
-
apiEndpoint: this.apiEndpoint,
|
|
56
|
-
authorization,
|
|
57
|
-
});
|
|
46
|
+
generateClient(options) {
|
|
47
|
+
s.assert({ authorization: options.authorization }, exports.SGenerateClientParams);
|
|
48
|
+
return new client_1.Client(Object.assign(Object.assign({}, options), { clientKey: this.clientKey, apiEndpoint: this.apiEndpoint }));
|
|
58
49
|
}
|
|
59
50
|
}
|
|
60
51
|
exports.default = ApiSDK;
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,qCAAkC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,qCAAkC;AAClC,iDAA6D;AAG7D,2CAAyB;AAIZ,QAAA,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAMU,QAAA,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC1C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,MAAM;IAKV,YAAY,EAAE,SAAS,EAAE,WAAW,EAAU;QAC5C,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,eAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAEM,oBAAoB,CAAC,UAAmB,EAAE;QAC/C,OAAO,IAAI,2BAAY,iCAClB,OAAO,KACV,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,WAAW,EAAE,IAAI,CAAC,WAAW,IAC7B,CAAC;IACL,CAAC;IAEM,cAAc,CAAC,OAA6D;QACjF,CAAC,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,EAAE,6BAAqB,CAAC,CAAC;QAE1E,OAAO,IAAI,eAAM,iCACZ,OAAO,KACV,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,WAAW,EAAE,IAAI,CAAC,WAAW,IAC7B,CAAC;IACL,CAAC;CACF;AAED,kBAAe,MAAM,CAAC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import * as s from 'superstruct';
|
|
2
2
|
import { BaseDiagramNode, NodeID } from './shared';
|
|
3
|
+
export declare enum DiagramType {
|
|
4
|
+
TOPIC = "TOPIC",
|
|
5
|
+
GROUP = "GROUP",
|
|
6
|
+
COMPONENT = "COMPONENT"
|
|
7
|
+
}
|
|
8
|
+
export declare const SDiagramType: s.Struct<DiagramType, any>;
|
|
3
9
|
export declare const SDiagram: s.Struct<{
|
|
4
10
|
name: string;
|
|
5
11
|
_id: string;
|
|
@@ -17,9 +23,12 @@ export declare const SDiagram: s.Struct<{
|
|
|
17
23
|
}>;
|
|
18
24
|
children: string[];
|
|
19
25
|
modified: number;
|
|
26
|
+
type?: DiagramType | undefined;
|
|
27
|
+
intentStepIDs?: string[] | undefined;
|
|
20
28
|
}, {
|
|
21
29
|
_id: s.Struct<string, any>;
|
|
22
30
|
name: s.Struct<string, any>;
|
|
31
|
+
type: s.Struct<DiagramType | undefined, any>;
|
|
23
32
|
versionID: s.Struct<string, any>;
|
|
24
33
|
creatorID: s.Struct<number, any>;
|
|
25
34
|
variables: s.Struct<string[], s.Struct<string, any>>;
|
|
@@ -32,6 +41,7 @@ export declare const SDiagram: s.Struct<{
|
|
|
32
41
|
nodeID: string;
|
|
33
42
|
coords?: [number, number] | undefined;
|
|
34
43
|
}>, any>;
|
|
44
|
+
intentStepIDs: s.Struct<string[] | undefined, any>;
|
|
35
45
|
children: s.Struct<string[], s.Struct<string, any>>;
|
|
36
46
|
modified: s.Struct<number, any>;
|
|
37
47
|
}>;
|
package/build/models/diagram.js
CHANGED
|
@@ -19,12 +19,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.SDiagram = void 0;
|
|
22
|
+
exports.SDiagram = exports.SDiagramType = exports.DiagramType = void 0;
|
|
23
23
|
const s = __importStar(require("superstruct"));
|
|
24
24
|
const shared_1 = require("./shared");
|
|
25
|
+
var DiagramType;
|
|
26
|
+
(function (DiagramType) {
|
|
27
|
+
DiagramType["TOPIC"] = "TOPIC";
|
|
28
|
+
DiagramType["GROUP"] = "GROUP";
|
|
29
|
+
DiagramType["COMPONENT"] = "COMPONENT";
|
|
30
|
+
})(DiagramType = exports.DiagramType || (exports.DiagramType = {}));
|
|
31
|
+
exports.SDiagramType = s.enums(Object.values(DiagramType));
|
|
25
32
|
exports.SDiagram = s.object({
|
|
26
33
|
_id: shared_1.SDiagramID,
|
|
27
34
|
name: shared_1.SName,
|
|
35
|
+
type: s.optional(exports.SDiagramType),
|
|
28
36
|
versionID: shared_1.SVersionID,
|
|
29
37
|
creatorID: shared_1.SCreatorID,
|
|
30
38
|
variables: s.array(shared_1.SVariable),
|
|
@@ -32,6 +40,7 @@ exports.SDiagram = s.object({
|
|
|
32
40
|
offsetY: s.number(),
|
|
33
41
|
zoom: s.number(),
|
|
34
42
|
nodes: s.record(shared_1.SNodeID, shared_1.SDiagramNode),
|
|
43
|
+
intentStepIDs: s.optional(s.array(s.string())),
|
|
35
44
|
children: s.array(shared_1.SDiagramID),
|
|
36
45
|
modified: shared_1.STimestamp,
|
|
37
46
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagram.js","sourceRoot":"","sources":["../../src/models/diagram.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,qCAA4I;
|
|
1
|
+
{"version":3,"file":"diagram.js","sourceRoot":"","sources":["../../src/models/diagram.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,qCAA4I;AAE5I,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,sCAAuB,CAAA;AACzB,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AAEY,QAAA,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;AAEnD,QAAA,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,GAAG,EAAE,mBAAU;IAEf,IAAI,EAAE,cAAK;IACX,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,oBAAY,CAAC;IAC9B,SAAS,EAAE,mBAAU;IACrB,SAAS,EAAE,mBAAU;IACrB,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAS,CAAC;IAE7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,gBAAO,EAAE,qBAAY,CAAC;IACtC,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAE9C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAU,CAAC;IAE7B,QAAQ,EAAE,mBAAU;CACrB,CAAC,CAAC"}
|
|
@@ -393,6 +393,40 @@ export interface VersionPrototype<C extends BaseCommand = BaseCommand, L extends
|
|
|
393
393
|
data: VersionPrototypeData<L>;
|
|
394
394
|
context: VersionPrototypeContext<C>;
|
|
395
395
|
}
|
|
396
|
+
export declare enum VersionFolderItemType {
|
|
397
|
+
FOLDER = "FOLDER",
|
|
398
|
+
DIAGRAM = "DIAGRAM"
|
|
399
|
+
}
|
|
400
|
+
export declare const sVersionFolderItemType: s.Struct<VersionFolderItemType, any>;
|
|
401
|
+
export declare const sVersionFolderItem: s.Struct<{
|
|
402
|
+
type: VersionFolderItemType;
|
|
403
|
+
sourceID: string;
|
|
404
|
+
}, {
|
|
405
|
+
type: s.Struct<VersionFolderItemType, any>;
|
|
406
|
+
sourceID: s.Struct<string, any>;
|
|
407
|
+
}>;
|
|
408
|
+
export interface VersionFolderItem extends s.StructType<typeof sVersionFolderItem> {
|
|
409
|
+
}
|
|
410
|
+
export declare const sVersionFolder: s.Struct<{
|
|
411
|
+
id: string;
|
|
412
|
+
name: string;
|
|
413
|
+
items: {
|
|
414
|
+
type: VersionFolderItemType;
|
|
415
|
+
sourceID: string;
|
|
416
|
+
}[];
|
|
417
|
+
}, {
|
|
418
|
+
id: s.Struct<string, any>;
|
|
419
|
+
name: s.Struct<string, any>;
|
|
420
|
+
items: s.Struct<{
|
|
421
|
+
type: VersionFolderItemType;
|
|
422
|
+
sourceID: string;
|
|
423
|
+
}[], s.Struct<{
|
|
424
|
+
type: VersionFolderItemType;
|
|
425
|
+
sourceID: string;
|
|
426
|
+
}, any>>;
|
|
427
|
+
}>;
|
|
428
|
+
export interface VersionFolder extends s.StructType<typeof sVersionFolder> {
|
|
429
|
+
}
|
|
396
430
|
export declare const SVersion: s.Struct<{
|
|
397
431
|
name: string;
|
|
398
432
|
_id: string;
|
|
@@ -504,11 +538,39 @@ export declare const SVersion: s.Struct<{
|
|
|
504
538
|
variables?: Record<string, unknown> | undefined;
|
|
505
539
|
};
|
|
506
540
|
} | undefined;
|
|
541
|
+
topics?: {
|
|
542
|
+
type: VersionFolderItemType;
|
|
543
|
+
sourceID: string;
|
|
544
|
+
}[] | undefined;
|
|
545
|
+
folders?: Record<string, {
|
|
546
|
+
id: string;
|
|
547
|
+
name: string;
|
|
548
|
+
items: {
|
|
549
|
+
type: VersionFolderItemType;
|
|
550
|
+
sourceID: string;
|
|
551
|
+
}[];
|
|
552
|
+
}> | undefined;
|
|
553
|
+
components?: {
|
|
554
|
+
type: VersionFolderItemType;
|
|
555
|
+
sourceID: string;
|
|
556
|
+
}[] | undefined;
|
|
507
557
|
}, {
|
|
508
558
|
_id: s.Struct<string, any>;
|
|
509
559
|
creatorID: s.Struct<number, any>;
|
|
510
560
|
projectID: s.Struct<string, any>;
|
|
511
561
|
name: s.Struct<string, any>;
|
|
562
|
+
topics: s.Struct<{
|
|
563
|
+
type: VersionFolderItemType;
|
|
564
|
+
sourceID: string;
|
|
565
|
+
}[] | undefined, any>;
|
|
566
|
+
folders: s.Struct<Record<string, {
|
|
567
|
+
id: string;
|
|
568
|
+
name: string;
|
|
569
|
+
items: {
|
|
570
|
+
type: VersionFolderItemType;
|
|
571
|
+
sourceID: string;
|
|
572
|
+
}[];
|
|
573
|
+
}> | undefined, any>;
|
|
512
574
|
variables: s.Struct<string[], s.Struct<string, any>>;
|
|
513
575
|
prototype: s.Struct<{
|
|
514
576
|
data: {
|
|
@@ -576,6 +638,10 @@ export declare const SVersion: s.Struct<{
|
|
|
576
638
|
variables?: Record<string, unknown> | undefined;
|
|
577
639
|
};
|
|
578
640
|
} | undefined, any>;
|
|
641
|
+
components: s.Struct<{
|
|
642
|
+
type: VersionFolderItemType;
|
|
643
|
+
sourceID: string;
|
|
644
|
+
}[] | undefined, any>;
|
|
579
645
|
platformData: s.Struct<Record<string, any> & {
|
|
580
646
|
slots: {
|
|
581
647
|
key: string;
|
package/build/models/version.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-empty-interface */
|
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
4
|
if (k2 === undefined) k2 = k;
|
|
4
5
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -19,7 +20,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
20
|
return result;
|
|
20
21
|
};
|
|
21
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.SVersion = exports.SVersionPrototype = exports.SVersionPrototypeSettings = exports.SVersionPrototypeData = exports.SVersionPrototypeContext = exports.SVersionPrototypeStackFrame = exports.SVersionPlatformData = exports.SVersionPlatformDataPublishing = exports.SVersionPlatformDataSettings = void 0;
|
|
23
|
+
exports.SVersion = exports.sVersionFolder = exports.sVersionFolderItem = exports.sVersionFolderItemType = exports.VersionFolderItemType = exports.SVersionPrototype = exports.SVersionPrototypeSettings = exports.SVersionPrototypeData = exports.SVersionPrototypeContext = exports.SVersionPrototypeStackFrame = exports.SVersionPlatformData = exports.SVersionPlatformDataPublishing = exports.SVersionPlatformDataSettings = void 0;
|
|
23
24
|
const s = __importStar(require("superstruct"));
|
|
24
25
|
const utils_1 = require("../utils");
|
|
25
26
|
const shared_1 = require("./shared");
|
|
@@ -65,13 +66,31 @@ exports.SVersionPrototype = s.object({
|
|
|
65
66
|
platform: shared_1.SPlatform,
|
|
66
67
|
settings: exports.SVersionPrototypeSettings,
|
|
67
68
|
});
|
|
69
|
+
var VersionFolderItemType;
|
|
70
|
+
(function (VersionFolderItemType) {
|
|
71
|
+
VersionFolderItemType["FOLDER"] = "FOLDER";
|
|
72
|
+
VersionFolderItemType["DIAGRAM"] = "DIAGRAM";
|
|
73
|
+
})(VersionFolderItemType = exports.VersionFolderItemType || (exports.VersionFolderItemType = {}));
|
|
74
|
+
exports.sVersionFolderItemType = s.enums(Object.values(VersionFolderItemType));
|
|
75
|
+
exports.sVersionFolderItem = s.object({
|
|
76
|
+
type: exports.sVersionFolderItemType,
|
|
77
|
+
sourceID: s.string(),
|
|
78
|
+
});
|
|
79
|
+
exports.sVersionFolder = s.object({
|
|
80
|
+
id: s.string(),
|
|
81
|
+
name: s.string(),
|
|
82
|
+
items: s.array(exports.sVersionFolderItem),
|
|
83
|
+
});
|
|
68
84
|
exports.SVersion = s.object({
|
|
69
85
|
_id: shared_1.SVersionID,
|
|
70
86
|
creatorID: shared_1.SCreatorID,
|
|
71
87
|
projectID: shared_1.SProjectID,
|
|
72
88
|
name: shared_1.SName,
|
|
89
|
+
topics: s.optional(s.array(exports.sVersionFolderItem)),
|
|
90
|
+
folders: s.optional(s.record(s.string(), exports.sVersionFolder)),
|
|
73
91
|
variables: s.array(shared_1.SVariable),
|
|
74
92
|
prototype: s.optional(exports.SVersionPrototype),
|
|
93
|
+
components: s.optional(s.array(exports.sVersionFolderItem)),
|
|
75
94
|
platformData: exports.SVersionPlatformData,
|
|
76
95
|
rootDiagramID: shared_1.SDiagramID,
|
|
77
96
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/models/version.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/models/version.ts"],"names":[],"mappings":";AAAA,0DAA0D;;;;;;;;;;;;;;;;;;;;;;AAE1D,+CAAiC;AAGjC,oCAAwC;AAExC,qCAakB;AAEL,QAAA,4BAA4B,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAE1C,QAAA,8BAA8B,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAEzD,+EAA+E;AAClE,QAAA,oBAAoB,GAAG,qBAAa,CAAC;IAChD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAK,CAAC;IACrB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAO,CAAC;IACzB,QAAQ,EAAE,oCAA4B;IACtC,UAAU,EAAE,sCAA8B;CAC3C,CAAC,CAAC;AAYU,QAAA,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IAErB,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAQ,CAAC,CAAC;IACvC,SAAS,E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EAAE,4BAAoB;IAClC,aAAa,EAAE,mBAAU;CAC1B,CAAC,CAAC"}
|
package/build/publicclient.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { Crypto } from '@voiceflow/common';
|
|
1
2
|
import Fetch, { FetchConfig } from "./fetch";
|
|
2
3
|
import { Analytics, APIKey, Diagram, Program, Project, PrototypeProgram, Version } from "./resources";
|
|
3
|
-
export
|
|
4
|
+
export interface ClientOptions {
|
|
4
5
|
options?: FetchConfig;
|
|
5
6
|
clientKey: string;
|
|
6
7
|
apiEndpoint: string;
|
|
7
8
|
authorization?: string;
|
|
8
|
-
|
|
9
|
+
analyticsEncryption?: Crypto.Synchronous;
|
|
10
|
+
}
|
|
9
11
|
export declare class PublicClient {
|
|
10
12
|
fetch: Fetch;
|
|
11
13
|
project: Project;
|
|
@@ -15,5 +17,5 @@ export declare class PublicClient {
|
|
|
15
17
|
analytics: Analytics;
|
|
16
18
|
apiKey: APIKey;
|
|
17
19
|
prototypeProgram: PrototypeProgram;
|
|
18
|
-
constructor({ clientKey, apiEndpoint, authorization, options }: ClientOptions);
|
|
20
|
+
constructor({ clientKey, apiEndpoint, authorization, options, analyticsEncryption }: ClientOptions);
|
|
19
21
|
}
|
package/build/publicclient.js
CHANGED
|
@@ -7,14 +7,14 @@ exports.PublicClient = void 0;
|
|
|
7
7
|
const fetch_1 = __importDefault(require("./fetch"));
|
|
8
8
|
const resources_1 = require("./resources");
|
|
9
9
|
class PublicClient {
|
|
10
|
-
constructor({ clientKey, apiEndpoint, authorization, options }) {
|
|
10
|
+
constructor({ clientKey, apiEndpoint, authorization, options, analyticsEncryption }) {
|
|
11
11
|
this.fetch = new fetch_1.default({ clientKey, apiEndpoint, authorization, options });
|
|
12
12
|
this.apiKey = new resources_1.APIKey(this.fetch);
|
|
13
13
|
this.project = new resources_1.Project(this.fetch);
|
|
14
14
|
this.version = new resources_1.Version(this.fetch);
|
|
15
15
|
this.program = new resources_1.Program(this.fetch);
|
|
16
16
|
this.diagram = new resources_1.Diagram(this.fetch);
|
|
17
|
-
this.analytics = new resources_1.Analytics(this.fetch);
|
|
17
|
+
this.analytics = new resources_1.Analytics(this.fetch, { encryption: analyticsEncryption });
|
|
18
18
|
this.prototypeProgram = new resources_1.PrototypeProgram(this.fetch);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publicclient.js","sourceRoot":"","sources":["../src/publicclient.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"publicclient.js","sourceRoot":"","sources":["../src/publicclient.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA6C;AAC7C,2CAAsG;AAUtG,MAAa,YAAY;IAiBvB,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAiB;QAChG,IAAI,CAAC,KAAK,GAAG,IAAI,eAAK,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;QAE3E,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,IAAI,mBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,mBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,mBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,mBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAChF,IAAI,CAAC,gBAAgB,GAAG,IAAI,4BAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3D,CAAC;CACF;AA5BD,oCA4BC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Crypto } from '@voiceflow/common';
|
|
1
2
|
import type Fetch from "../fetch";
|
|
2
3
|
import Fetcher from './fetcher';
|
|
3
4
|
interface HashOptions<K> {
|
|
@@ -11,8 +12,15 @@ interface TrackOptions<P extends Record<string, any>, K extends keyof P> extends
|
|
|
11
12
|
interface IdentifyOptions<T extends Record<string, any>, K extends keyof T> extends HashOptions<K> {
|
|
12
13
|
traits: T;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
interface AnalyticsOptions {
|
|
16
|
+
encryption?: Crypto.Synchronous;
|
|
17
|
+
}
|
|
18
|
+
declare class Analytics extends Fetcher<Analytics, AnalyticsOptions> {
|
|
19
|
+
private encryption?;
|
|
20
|
+
constructor(fetch: Fetch, options?: AnalyticsOptions);
|
|
21
|
+
private get shouldEncrypt();
|
|
22
|
+
private encryptedPayload;
|
|
23
|
+
protected _getEndpoint(): string;
|
|
16
24
|
track<P extends Record<string, any>, K extends keyof P>(event: string, { envIDs, hashed, teamhashed, properties }?: TrackOptions<P, K>): Promise<void>;
|
|
17
25
|
identify<T extends Record<string, any>, K extends keyof T>({ envIDs, traits, hashed, teamhashed, }: IdentifyOptions<T, K>): Promise<void>;
|
|
18
26
|
identifyWorkspace<T extends {
|
|
@@ -5,18 +5,50 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const fetcher_1 = __importDefault(require("./fetcher"));
|
|
7
7
|
const ENDPOINT = 'analytics';
|
|
8
|
+
const ENCRYPTED_ENDPOINT = 'vf-ping';
|
|
8
9
|
class Analytics extends fetcher_1.default {
|
|
9
|
-
constructor(fetch) {
|
|
10
|
-
super({ fetch, clazz: Analytics, endpoint: ENDPOINT });
|
|
10
|
+
constructor(fetch, options = {}) {
|
|
11
|
+
super({ fetch, clazz: Analytics, endpoint: ENDPOINT, clazzOptions: options });
|
|
12
|
+
this.encryption = options.encryption;
|
|
13
|
+
}
|
|
14
|
+
get shouldEncrypt() {
|
|
15
|
+
return !!this.encryption;
|
|
16
|
+
}
|
|
17
|
+
encryptedPayload(data) {
|
|
18
|
+
if (!this.encryption) {
|
|
19
|
+
throw new Error('Encryption should be provided!');
|
|
20
|
+
}
|
|
21
|
+
return { message: this.encryption.encryptJSON(data) };
|
|
22
|
+
}
|
|
23
|
+
_getEndpoint() {
|
|
24
|
+
return this.shouldEncrypt ? ENCRYPTED_ENDPOINT : ENDPOINT;
|
|
11
25
|
}
|
|
12
26
|
async track(event, { envIDs, hashed, teamhashed, properties = {} } = {}) {
|
|
13
|
-
|
|
27
|
+
const payload = { event, envIDs, hashed, teamhashed, properties };
|
|
28
|
+
if (this.shouldEncrypt) {
|
|
29
|
+
await this.fetch.post(`${this._getEndpoint()}`, this.encryptedPayload(payload));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
await this.fetch.post(`${this._getEndpoint()}/track`, payload);
|
|
33
|
+
}
|
|
14
34
|
}
|
|
15
35
|
async identify({ envIDs, traits, hashed, teamhashed, }) {
|
|
16
|
-
|
|
36
|
+
const payload = { traits, envIDs, hashed, teamhashed };
|
|
37
|
+
if (this.shouldEncrypt) {
|
|
38
|
+
await this.fetch.post(`${this._getEndpoint()}/user`, this.encryptedPayload(payload));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
await this.fetch.post(`${this._getEndpoint()}/identify`, payload);
|
|
42
|
+
}
|
|
17
43
|
}
|
|
18
44
|
async identifyWorkspace(id, properties) {
|
|
19
|
-
|
|
45
|
+
const payload = Object.assign(Object.assign({}, properties), { id });
|
|
46
|
+
if (this.shouldEncrypt) {
|
|
47
|
+
await this.fetch.post(`${this._getEndpoint()}/workspace`, this.encryptedPayload(payload));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
await this.fetch.post(`${this._getEndpoint()}/workspace/identify`, payload);
|
|
51
|
+
}
|
|
20
52
|
}
|
|
21
53
|
}
|
|
22
54
|
exports.default = Analytics;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/resources/analytics.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/resources/analytics.ts"],"names":[],"mappings":";;;;;AAIA,wDAAgC;AAEhC,MAAM,QAAQ,GAAG,WAAW,CAAC;AAC7B,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAoBrC,MAAM,SAAU,SAAQ,iBAAoC;IAG1D,YAAY,KAAY,EAAE,UAA4B,EAAE;QACtD,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;QAE9E,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACvC,CAAC;IAED,IAAY,aAAa;QACvB,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAEO,gBAAgB,CAAC,IAA6B;QACpD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;SACnD;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;IACxD,CAAC;IAES,YAAY;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC5D,CAAC;IAEM,KAAK,CAAC,KAAK,CAChB,KAAa,EACb,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,EAAO,KAAyB,EAAE;QAE7E,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,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;SAC7E;IACH,CAAC;CACF;AAED,kBAAe,SAAS,CAAC"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import type Fetch from "../fetch";
|
|
2
|
-
|
|
2
|
+
declare type Clazz<Client, Options = undefined> = Options extends undefined ? new (fetch: Fetch) => Client : new (fetch: Fetch, options: Options) => Client;
|
|
3
|
+
interface BaseFetcherOptions<Client, Options = undefined> {
|
|
3
4
|
fetch: Fetch;
|
|
4
|
-
clazz:
|
|
5
|
+
clazz: Clazz<Client, Options>;
|
|
5
6
|
endpoint: string;
|
|
6
7
|
}
|
|
7
|
-
declare
|
|
8
|
+
export declare type FetcherOptions<Client, Options = undefined> = Options extends undefined ? BaseFetcherOptions<Client> & {
|
|
9
|
+
clazzOptions?: never;
|
|
10
|
+
} : BaseFetcherOptions<Client, Options> & {
|
|
11
|
+
clazzOptions: Options;
|
|
12
|
+
};
|
|
13
|
+
declare class Fetcher<Client, Options = undefined> {
|
|
8
14
|
private readonly clazz;
|
|
9
15
|
private endpoint;
|
|
16
|
+
private clazzOptions;
|
|
10
17
|
protected readonly fetch: Fetch;
|
|
11
|
-
constructor({ fetch, clazz, endpoint }: FetcherOptions<
|
|
18
|
+
constructor({ fetch, clazz, endpoint, clazzOptions }: FetcherOptions<Client, Options>);
|
|
12
19
|
protected _getEndpoint(): string;
|
|
13
|
-
options(options: Parameters<Fetch['initWithOptions']>[0]):
|
|
20
|
+
options(options: Parameters<Fetch['initWithOptions']>[0]): Client;
|
|
14
21
|
}
|
|
15
22
|
export default Fetcher;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class Fetcher {
|
|
4
|
-
constructor({ fetch, clazz, endpoint }) {
|
|
4
|
+
constructor({ fetch, clazz, endpoint, clazzOptions }) {
|
|
5
5
|
this.fetch = fetch;
|
|
6
6
|
this.clazz = clazz;
|
|
7
7
|
this.endpoint = endpoint;
|
|
8
|
+
this.clazzOptions = clazzOptions;
|
|
8
9
|
}
|
|
9
10
|
_getEndpoint() {
|
|
10
11
|
return this.endpoint;
|
|
11
12
|
}
|
|
12
13
|
options(options) {
|
|
13
14
|
const { clazz: Clazz } = this;
|
|
14
|
-
return new Clazz(this.fetch.initWithOptions(options));
|
|
15
|
+
return new Clazz(this.fetch.initWithOptions(options), this.clazzOptions);
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
exports.default = Fetcher;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetcher.js","sourceRoot":"","sources":["../../src/resources/fetcher.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"fetcher.js","sourceRoot":"","sources":["../../src/resources/fetcher.ts"],"names":[],"mappings":";;AAcA,MAAM,OAAO;IASX,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAmC;QACnF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,YAAuB,CAAC;IAC9C,CAAC;IAES,YAAY;QACpB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEM,OAAO,CAAC,OAAgD;QAC7D,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAE9B,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3E,CAAC;CACF;AAED,kBAAe,OAAO,CAAC"}
|
package/build/resources/user.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.parseJWT = void 0;
|
|
7
|
-
const
|
|
8
|
-
const utils_1 = require("../utils");
|
|
4
|
+
const common_1 = require("@voiceflow/common");
|
|
9
5
|
const parseJWT = (token) => {
|
|
10
|
-
var _a;
|
|
11
6
|
const base64Url = token.split('.')[1];
|
|
12
7
|
if (!base64Url) {
|
|
13
8
|
throw new RangeError('Invalid JWT');
|
|
14
9
|
}
|
|
15
10
|
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
|
16
|
-
const jsonPayload = decodeURIComponent(
|
|
11
|
+
const jsonPayload = decodeURIComponent(common_1.Crypto.Base64.decode(base64)
|
|
17
12
|
.split('')
|
|
18
13
|
.map((c) => `%${`00${c.charCodeAt(0).toString(16)}`.slice(-2)}`)
|
|
19
14
|
.join(''));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/resources/user.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/resources/user.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAIpC,MAAM,QAAQ,GAAG,CAAI,KAAa,EAAK,EAAE;IAC9C,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtC,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC;KACrC;IAED,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC/D,MAAM,WAAW,GAAG,kBAAkB,CACpC,eAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;SACzB,KAAK,CAAC,EAAE,CAAC;SACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/D,IAAI,CAAC,EAAE,CAAC,CACZ,CAAC;IAEF,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC,CAAC;AAhBW,QAAA,QAAQ,YAgBnB;AASF,MAAM,IAAI;IAOR,YAAY,aAAqB;QAN1B,cAAS,GAAc,CAAC,CAAC;QAEzB,SAAI,GAAG,EAAE,CAAC;QAEV,UAAK,GAAG,EAAE,CAAC;QAGhB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;YACjC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,gBAAQ,CAAY,aAAa,CAAC,CAAC;YAE/D,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;SACpB;IACH,CAAC;IAED,kDAAkD;IAClD,QAAQ,CAAC,aAAqB;QAC5B,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;CACF;AAED,kBAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './struct';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./struct"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as s from 'superstruct';
|
|
2
|
+
import type { BaseSchema, PutPostStruct, SchemeType } from "../types";
|
|
3
|
+
export declare const dynamicObject: <S extends BaseSchema>(schema: S) => s.Struct<Record<string, any> & import("../types").Flatten<{ [K_1 in import("@/types").RequiredKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]: { [K in keyof S]: s.StructType<S[K]>; }[K_1]; } & { [K_2 in import("@/types").OptionalKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]?: { [K in keyof S]: s.StructType<S[K]>; }[K_2] | undefined; }>, S>;
|
|
4
|
+
export declare const createPutAndPostStruct: <S extends BaseSchema, K_3 extends keyof import("../types").Flatten<{ [K_1 in import("@/types").RequiredKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]: { [K in keyof S]: s.StructType<S[K]>; }[K_1]; } & { [K_2 in import("@/types").OptionalKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]?: { [K in keyof S]: s.StructType<S[K]>; }[K_2] | undefined; }>, E extends keyof import("../types").Flatten<{ [K_1 in import("@/types").RequiredKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]: { [K in keyof S]: s.StructType<S[K]>; }[K_1]; } & { [K_2 in import("@/types").OptionalKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]?: { [K in keyof S]: s.StructType<S[K]>; }[K_2] | undefined; }> = never>(schema: S, idKey: K_3, excludedKeys: E[], isDynamic?: boolean | undefined) => PutPostStruct<S, K_3, E>;
|
|
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
22
|
+
exports.createPutAndPostStruct = exports.dynamicObject = void 0;
|
|
23
23
|
const s = __importStar(require("superstruct"));
|
|
24
24
|
const dynamicObject = (schema) => {
|
|
25
25
|
const Struct = s.object(schema);
|
|
@@ -49,8 +49,4 @@ const createPutAndPostStruct = (schema, idKey, excludedKeys, isDynamic) => {
|
|
|
49
49
|
: s.object(Object.assign(Object.assign({}, createScheme), { [idKey]: s.optional(schema[idKey]) }));
|
|
50
50
|
};
|
|
51
51
|
exports.createPutAndPostStruct = createPutAndPostStruct;
|
|
52
|
-
|
|
53
|
-
return typeof window === 'undefined' ? null : window;
|
|
54
|
-
};
|
|
55
|
-
exports.getWindow = getWindow;
|
|
56
|
-
//# sourceMappingURL=utils.js.map
|
|
52
|
+
//# sourceMappingURL=struct.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../src/utils/struct.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAI1B,MAAM,aAAa,GAAG,CAAuB,MAAS,EAAoD,EAAE;IACjH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEhC,MAAM,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG;QAC/C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAE1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;YAC9C,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;SAClB;aAAM;YACL,gDAAgD;YAChD,KAAK,MAAM,GAAG,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-sdk",
|
|
3
3
|
"description": "wrapper for creator-api",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.41.0",
|
|
5
5
|
"author": "Voiceflow",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/voiceflow/libs/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@
|
|
11
|
-
"atob": "^2.1.2",
|
|
10
|
+
"@voiceflow/common": "6.8.1",
|
|
12
11
|
"axios": "^0.21.1",
|
|
13
12
|
"superstruct": "^0.10.12"
|
|
14
13
|
},
|
|
@@ -57,5 +56,5 @@
|
|
|
57
56
|
"test:unit": "NODE_ENV=test nyc --report-dir=nyc_coverage_unit ts-mocha --paths --config ./config/tests/.mocharc.json 'tests/**/*.unit.ts'"
|
|
58
57
|
},
|
|
59
58
|
"types": "build/index.d.ts",
|
|
60
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "da583a5ff29f7020ab6bbbfcde6b3a6b6839aadb"
|
|
61
60
|
}
|
package/build/utils.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as s from 'superstruct';
|
|
2
|
-
import type { BaseSchema, PutPostStruct, SchemeType } from "./types";
|
|
3
|
-
export declare const dynamicObject: <S extends BaseSchema>(schema: S) => s.Struct<Record<string, any> & import("./types").Flatten<{ [K_1 in import("@/types").RequiredKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]: { [K in keyof S]: s.StructType<S[K]>; }[K_1]; } & { [K_2 in import("@/types").OptionalKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]?: { [K in keyof S]: s.StructType<S[K]>; }[K_2] | undefined; }>, S>;
|
|
4
|
-
export declare const createPutAndPostStruct: <S extends BaseSchema, K_3 extends keyof import("./types").Flatten<{ [K_1 in import("@/types").RequiredKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]: { [K in keyof S]: s.StructType<S[K]>; }[K_1]; } & { [K_2 in import("@/types").OptionalKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]?: { [K in keyof S]: s.StructType<S[K]>; }[K_2] | undefined; }>, E extends keyof import("./types").Flatten<{ [K_1 in import("@/types").RequiredKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]: { [K in keyof S]: s.StructType<S[K]>; }[K_1]; } & { [K_2 in import("@/types").OptionalKeys<{ [K in keyof S]: s.StructType<S[K]>; }>]?: { [K in keyof S]: s.StructType<S[K]>; }[K_2] | undefined; }> = never>(schema: S, idKey: K_3, excludedKeys: E[], isDynamic?: boolean | undefined) => PutPostStruct<S, K_3, E>;
|
|
5
|
-
export declare const getWindow: () => (Window & typeof globalThis) | null;
|
package/build/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAI1B,MAAM,aAAa,GAAG,CAAuB,MAAS,EAAoD,EAAE;IACjH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEhC,MAAM,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG;QAC/C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAE1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;YAC9C,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;SAClB;aAAM;YACL,gDAAgD;YAChD,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;gBACxB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,GAAiC,CAAC,CAAC;gBAC/D,MAAM,CAAC,GAAG,KAAK,CAAC,GAAyB,CAAC,CAAC;gBAE3C,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CA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