@chatbotkit/sdk 1.15.2 → 1.16.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/dist/cjs/blueprint/index.d.ts +1 -1
- package/dist/cjs/contact/index.cjs +5 -0
- package/dist/cjs/contact/index.d.ts +3 -0
- package/dist/cjs/contact/secret/index.cjs +24 -0
- package/dist/cjs/contact/secret/index.d.ts +9 -0
- package/dist/cjs/contact/secret/v1.cjs +33 -0
- package/dist/cjs/contact/secret/v1.d.ts +40 -0
- package/dist/cjs/contact/v1.cjs +11 -1
- package/dist/cjs/contact/v1.d.ts +9 -3
- package/dist/cjs/integration/discord/v1.d.ts +1 -0
- package/dist/cjs/integration/slack/v1.d.ts +1 -0
- package/dist/cjs/integration/trigger/v1.d.ts +1 -0
- package/dist/cjs/platform/ability/index.d.ts +1 -1
- package/dist/cjs/platform/model/index.d.ts +1 -1
- package/dist/cjs/platform/secret/index.d.ts +1 -1
- package/dist/cjs/secret/index.d.ts +1 -1
- package/dist/cjs/skillset/ability/index.d.ts +1 -1
- package/dist/cjs/skillset/index.d.ts +1 -1
- package/dist/esm/contact/index.d.ts +3 -0
- package/dist/esm/contact/index.js +6 -1
- package/dist/esm/contact/secret/index.d.ts +9 -0
- package/dist/esm/contact/secret/index.js +20 -0
- package/dist/esm/contact/secret/v1.d.ts +40 -0
- package/dist/esm/contact/secret/v1.js +26 -0
- package/dist/esm/contact/v1.d.ts +9 -3
- package/dist/esm/contact/v1.js +9 -0
- package/dist/esm/integration/discord/v1.d.ts +1 -0
- package/dist/esm/integration/slack/v1.d.ts +1 -0
- package/dist/esm/integration/trigger/v1.d.ts +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +51 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class BlueprintClient extends ChatBotKitClient {
|
|
2
|
-
list(request?: import('./v1.
|
|
2
|
+
list(request?: import('./v1.cjs').BlueprintListRequest): ResponsePromise<import('./v1.cjs').BlueprintListResponse, import('./v1.cjs').BlueprintListStreamType>;
|
|
3
3
|
fetch(blueprintId: string): Promise<import('./v1.cjs').BlueprintFetchResponse>;
|
|
4
4
|
create(request: import('./v1.cjs').BlueprintCreateRequest): Promise<import('./v1.cjs').BlueprintCreateResponse>;
|
|
5
5
|
update(blueprintId: string, request: import('./v1.cjs').BlueprintUpdateRequest): Promise<import('./v1.cjs').BlueprintUpdateResponse>;
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContactClient = void 0;
|
|
4
4
|
const client_js_1 = require("../client.cjs");
|
|
5
|
+
const index_js_1 = require("./secret/index.cjs");
|
|
5
6
|
const v1_js_1 = require("./v1.cjs");
|
|
6
7
|
class ContactClient extends client_js_1.ChatBotKitClient {
|
|
7
8
|
constructor(options) {
|
|
8
9
|
super(options);
|
|
10
|
+
this.secrets = new index_js_1.SecretClient(options);
|
|
9
11
|
}
|
|
10
12
|
list(request) {
|
|
11
13
|
return (0, v1_js_1.listContacts)(this, request);
|
|
@@ -22,6 +24,9 @@ class ContactClient extends client_js_1.ChatBotKitClient {
|
|
|
22
24
|
delete(contactId) {
|
|
23
25
|
return (0, v1_js_1.deleteContact)(this, contactId);
|
|
24
26
|
}
|
|
27
|
+
ensure(request) {
|
|
28
|
+
return (0, v1_js_1.ensureContact)(this, request);
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
exports.ContactClient = ContactClient;
|
|
27
32
|
exports.default = ContactClient;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export class ContactClient extends ChatBotKitClient {
|
|
2
|
+
secrets: SecretClient;
|
|
2
3
|
list(request?: import('./v1.cjs').ContactListRequest): ResponsePromise<import('./v1.cjs').ContactListResponse, import('./v1.cjs').ContactListStreamType>;
|
|
3
4
|
fetch(contactId: string): Promise<import('./v1.cjs').ContactFetchResponse>;
|
|
4
5
|
create(request: import('./v1.cjs').ContactCreateRequest): Promise<import('./v1.cjs').ContactCreateResponse>;
|
|
5
6
|
update(contactId: string, request: import('./v1.cjs').ContactUpdateRequest): Promise<import('./v1.cjs').ContactUpdateResponse>;
|
|
6
7
|
delete(contactId: string): Promise<import('./v1.cjs').ContactDeleteResponse>;
|
|
8
|
+
ensure(request: import('./v1.cjs').ContactEnsureRequest): Promise<import('./v1.cjs').ContactEnsureResponse>;
|
|
7
9
|
}
|
|
8
10
|
export default ContactClient;
|
|
9
11
|
export type ResponsePromise<T, U> = import('../client.cjs').ResponsePromise<T, U>;
|
|
10
12
|
import { ChatBotKitClient } from '../client.cjs';
|
|
13
|
+
import { SecretClient } from './secret/index.cjs';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SecretClient = void 0;
|
|
4
|
+
const client_js_1 = require("../../client.cjs");
|
|
5
|
+
const v1_js_1 = require("./v1.cjs");
|
|
6
|
+
class SecretClient extends client_js_1.ChatBotKitClient {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
}
|
|
10
|
+
list(contactId, request) {
|
|
11
|
+
return (0, v1_js_1.listSecrets)(this, contactId, request);
|
|
12
|
+
}
|
|
13
|
+
delete(contactId, secretId) {
|
|
14
|
+
return (0, v1_js_1.deleteSecret)(this, contactId, secretId);
|
|
15
|
+
}
|
|
16
|
+
verify(contactId, secretId) {
|
|
17
|
+
return (0, v1_js_1.verifySecret)(this, contactId, secretId);
|
|
18
|
+
}
|
|
19
|
+
authenticate(contactId, secretId) {
|
|
20
|
+
return (0, v1_js_1.authenticateSecret)(this, contactId, secretId);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.SecretClient = SecretClient;
|
|
24
|
+
exports.default = SecretClient;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class SecretClient extends ChatBotKitClient {
|
|
2
|
+
list(contactId: string, request?: import('./v1.cjs').SecretListRequest): ResponsePromise<import('./v1.cjs').SecretListResponse, import('./v1.cjs').SecretListStreamType>;
|
|
3
|
+
delete(contactId: string, secretId: string): Promise<import('./v1.cjs').SecretDeleteResponse>;
|
|
4
|
+
verify(contactId: string, secretId: string): Promise<import('./v1.cjs').SecretVerifyResponse>;
|
|
5
|
+
authenticate(contactId: string, secretId: string): Promise<import('./v1.cjs').SecretAuthenticateResponse>;
|
|
6
|
+
}
|
|
7
|
+
export default SecretClient;
|
|
8
|
+
export type ResponsePromise<T, U> = import('../../client.cjs').ResponsePromise<T, U>;
|
|
9
|
+
import { ChatBotKitClient } from '../../client.cjs';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.authenticateSecret = exports.verifySecret = exports.deleteSecret = exports.listSecrets = void 0;
|
|
4
|
+
function listSecrets(client, contactId, request) {
|
|
5
|
+
let url = `/api/v1/contact/${contactId}/secret/list`;
|
|
6
|
+
const response = client.clientFetch(url, { query: request });
|
|
7
|
+
return response;
|
|
8
|
+
}
|
|
9
|
+
exports.listSecrets = listSecrets;
|
|
10
|
+
async function deleteSecret(client, contactId, secretId) {
|
|
11
|
+
const url = `/api/v1/contact/${contactId}/${secretId}/delete`;
|
|
12
|
+
const response = await client.clientFetch(url, {
|
|
13
|
+
record: {},
|
|
14
|
+
});
|
|
15
|
+
return response;
|
|
16
|
+
}
|
|
17
|
+
exports.deleteSecret = deleteSecret;
|
|
18
|
+
async function verifySecret(client, contactId, secretId) {
|
|
19
|
+
const url = `/api/v1/contact/${contactId}/${secretId}/verify`;
|
|
20
|
+
const response = await client.clientFetch(url, {
|
|
21
|
+
record: {},
|
|
22
|
+
});
|
|
23
|
+
return response;
|
|
24
|
+
}
|
|
25
|
+
exports.verifySecret = verifySecret;
|
|
26
|
+
async function authenticateSecret(client, contactId, secretId) {
|
|
27
|
+
const url = `/api/v1/contact/${contactId}/${secretId}/authenticate`;
|
|
28
|
+
const response = await client.clientFetch(url, {
|
|
29
|
+
record: {},
|
|
30
|
+
});
|
|
31
|
+
return response;
|
|
32
|
+
}
|
|
33
|
+
exports.authenticateSecret = authenticateSecret;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export function listSecrets(client: ChatBotKitClient, contactId: string, request?: SecretListRequest): ResponsePromise<SecretListResponse, SecretListStreamType>;
|
|
2
|
+
export function deleteSecret(client: ChatBotKitClient, contactId: string, secretId: string): Promise<SecretDeleteResponse>;
|
|
3
|
+
export function verifySecret(client: ChatBotKitClient, contactId: string, secretId: string): Promise<SecretVerifyResponse>;
|
|
4
|
+
export function authenticateSecret(client: ChatBotKitClient, contactId: string, secretId: string): Promise<SecretAuthenticateResponse>;
|
|
5
|
+
export type ChatBotKitClient = import('../../client.cjs').ChatBotKitClient;
|
|
6
|
+
export type ResponsePromise<T, U> = import('../../client.cjs').ResponsePromise<T, U>;
|
|
7
|
+
export type SecretOptions = {
|
|
8
|
+
name?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
meta?: Record<string, any>;
|
|
12
|
+
};
|
|
13
|
+
export type SecretInstance = SecretOptions & {
|
|
14
|
+
id: string;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
updatedAt: number;
|
|
17
|
+
};
|
|
18
|
+
export type SecretListRequest = {
|
|
19
|
+
cursor?: string;
|
|
20
|
+
order?: 'desc' | 'asc';
|
|
21
|
+
take?: number;
|
|
22
|
+
meta?: Record<string, string>;
|
|
23
|
+
};
|
|
24
|
+
export type SecretListResponse = {
|
|
25
|
+
items: SecretInstance[];
|
|
26
|
+
};
|
|
27
|
+
export type SecretListStreamItemType = {
|
|
28
|
+
type: 'item';
|
|
29
|
+
data: SecretInstance;
|
|
30
|
+
};
|
|
31
|
+
export type SecretListStreamType = SecretListStreamItemType;
|
|
32
|
+
export type SecretDeleteResponse = {
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
export type SecretVerifyResponse = {
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
export type SecretAuthenticateResponse = {
|
|
39
|
+
id: string;
|
|
40
|
+
};
|
package/dist/cjs/contact/v1.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteContact = exports.updateContact = exports.createContact = exports.fetchContact = exports.listContacts = void 0;
|
|
3
|
+
exports.ensureContact = exports.deleteContact = exports.updateContact = exports.createContact = exports.fetchContact = exports.listContacts = void 0;
|
|
4
4
|
function listContacts(client, request) {
|
|
5
5
|
let url = `/api/v1/contact/list`;
|
|
6
6
|
const response = client.clientFetch(url, { query: request });
|
|
@@ -41,3 +41,13 @@ async function deleteContact(client, contactId) {
|
|
|
41
41
|
return response;
|
|
42
42
|
}
|
|
43
43
|
exports.deleteContact = deleteContact;
|
|
44
|
+
async function ensureContact(client, request) {
|
|
45
|
+
const url = `/api/v1/contact/ensure`;
|
|
46
|
+
const response = await client.clientFetch(url, {
|
|
47
|
+
record: {
|
|
48
|
+
...request,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
return response;
|
|
52
|
+
}
|
|
53
|
+
exports.ensureContact = ensureContact;
|
package/dist/cjs/contact/v1.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export function fetchContact(client: ChatBotKitClient, contactId: string): Promi
|
|
|
3
3
|
export function createContact(client: ChatBotKitClient, request: ContactCreateRequest): Promise<ContactCreateResponse>;
|
|
4
4
|
export function updateContact(client: ChatBotKitClient, contactId: string, request: ContactUpdateRequest): Promise<ContactUpdateResponse>;
|
|
5
5
|
export function deleteContact(client: ChatBotKitClient, contactId: string): Promise<ContactDeleteResponse>;
|
|
6
|
+
export function ensureContact(client: ChatBotKitClient, request: ContactEnsureRequest): Promise<ContactEnsureResponse>;
|
|
6
7
|
export type ChatBotKitClient = import('../client.cjs').ChatBotKitClient;
|
|
7
8
|
export type ResponsePromise<T, U> = import('../client.cjs').ResponsePromise<T, U>;
|
|
8
9
|
export type ContactOptions = {
|
|
@@ -11,6 +12,7 @@ export type ContactOptions = {
|
|
|
11
12
|
fingerprint?: string;
|
|
12
13
|
email?: string;
|
|
13
14
|
phone?: string;
|
|
15
|
+
nick?: string;
|
|
14
16
|
meta?: Record<string, any>;
|
|
15
17
|
};
|
|
16
18
|
export type ContactInstance = ContactOptions & {
|
|
@@ -33,9 +35,7 @@ export type ContactListStreamItemType = {
|
|
|
33
35
|
};
|
|
34
36
|
export type ContactListStreamType = ContactListStreamItemType;
|
|
35
37
|
export type ContactFetchResponse = ContactInstance & {};
|
|
36
|
-
export type ContactCreateRequest = ContactOptions & {
|
|
37
|
-
model?: import('../model/v1.cjs').Model;
|
|
38
|
-
};
|
|
38
|
+
export type ContactCreateRequest = ContactOptions & {};
|
|
39
39
|
export type ContactCreateResponse = {
|
|
40
40
|
id: string;
|
|
41
41
|
};
|
|
@@ -46,3 +46,9 @@ export type ContactUpdateResponse = {
|
|
|
46
46
|
export type ContactDeleteResponse = {
|
|
47
47
|
id: string;
|
|
48
48
|
};
|
|
49
|
+
export type ContactEnsureRequest = ContactOptions & {
|
|
50
|
+
fingerprint: string;
|
|
51
|
+
};
|
|
52
|
+
export type ContactEnsureResponse = {
|
|
53
|
+
id: string;
|
|
54
|
+
};
|
|
@@ -23,6 +23,7 @@ export type TriggerIntegrationOptions = BotRefOrConfig & {
|
|
|
23
23
|
name?: string;
|
|
24
24
|
description?: string;
|
|
25
25
|
authenticate?: boolean;
|
|
26
|
+
triggerSchedule?: "never" | "quarterhourly" | "halfhourly" | "hourly" | "daily" | "weekly" | "monthly";
|
|
26
27
|
sessionDuration?: number;
|
|
27
28
|
meta?: Record<string, any>;
|
|
28
29
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class PlatformAbilityClient extends ChatBotKitClient {
|
|
2
|
-
list(request?: import('./v1.
|
|
2
|
+
list(request?: import('./v1.cjs').PlatformAbilityListRequest): ResponsePromise<import('./v1.cjs').PlatformAbilityListResponse, import('./v1.cjs').PlatformAbilityListStreamType>;
|
|
3
3
|
}
|
|
4
4
|
export default PlatformAbilityClient;
|
|
5
5
|
export type ResponsePromise<T, U> = import('../../client.cjs').ResponsePromise<T, U>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class PlatformModelClient extends ChatBotKitClient {
|
|
2
|
-
list(request?: import('./v1.
|
|
2
|
+
list(request?: import('./v1.cjs').PlatformModelListRequest): ResponsePromise<import('./v1.cjs').PlatformModelListResponse, import('./v1.cjs').PlatformModelListStreamType>;
|
|
3
3
|
}
|
|
4
4
|
export default PlatformModelClient;
|
|
5
5
|
export type ResponsePromise<T, U> = import('../../client.cjs').ResponsePromise<T, U>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class PlatformSecretClient extends ChatBotKitClient {
|
|
2
|
-
list(request?: import('./v1.
|
|
2
|
+
list(request?: import('./v1.cjs').PlatformSecretListRequest): ResponsePromise<import('./v1.cjs').PlatformSecretListResponse, import('./v1.cjs').PlatformSecretListStreamType>;
|
|
3
3
|
}
|
|
4
4
|
export default PlatformSecretClient;
|
|
5
5
|
export type ResponsePromise<T, U> = import('../../client.cjs').ResponsePromise<T, U>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class SecretClient extends ChatBotKitClient {
|
|
2
|
-
list(request?: import('./v1.
|
|
2
|
+
list(request?: import('./v1.cjs').SecretListRequest): ResponsePromise<import('./v1.cjs').SecretListResponse, import('./v1.cjs').SecretListStreamType>;
|
|
3
3
|
fetch(secretId: string): Promise<import('./v1.cjs').SecretFetchResponse>;
|
|
4
4
|
create(request: import('./v1.cjs').SecretCreateRequest): Promise<import('./v1.cjs').SecretCreateResponse>;
|
|
5
5
|
update(secretId: string, request: import('./v1.cjs').SecretUpdateRequest): Promise<import('./v1.cjs').SecretUpdateResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class SkillsetAbilityClient extends ChatBotKitClient {
|
|
2
|
-
list(skillsetId: string, request?: import('./v1.
|
|
2
|
+
list(skillsetId: string, request?: import('./v1.cjs').SkillsetAbilityListRequest): ResponsePromise<import('./v1.cjs').SkillsetAbilityListResponse, import('./v1.cjs').SkillsetAbilityListStreamType>;
|
|
3
3
|
fetch(skillsetId: string, abilityId: string): Promise<import('./v1.cjs').SkillsetAbilityFetchResponse>;
|
|
4
4
|
create(skillsetId: string, request: import('./v1.cjs').SkillsetAbilityCreateRequest): Promise<import('./v1.cjs').SkillsetAbilityCreateResponse>;
|
|
5
5
|
update(skillsetId: string, abilityId: string, request: import('./v1.cjs').SkillsetAbilityUpdateRequest): Promise<import('./v1.cjs').SkillsetAbilityUpdateResponse>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export class SkillsetClient extends ChatBotKitClient {
|
|
2
2
|
ability: SkillsetAbilityClient;
|
|
3
|
-
list(request?: import('./v1.
|
|
3
|
+
list(request?: import('./v1.cjs').SkillsetListRequest): ResponsePromise<import('./v1.cjs').SkillsetListResponse, import('./v1.cjs').SkillsetListStreamType>;
|
|
4
4
|
fetch(skillsetId: string): Promise<import('./v1.cjs').SkillsetFetchResponse>;
|
|
5
5
|
create(request: import('./v1.cjs').SkillsetCreateRequest): Promise<import('./v1.cjs').SkillsetCreateResponse>;
|
|
6
6
|
update(skillsetId: string, request: import('./v1.cjs').SkillsetUpdateRequest): Promise<import('./v1.cjs').SkillsetUpdateResponse>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export class ContactClient extends ChatBotKitClient {
|
|
2
|
+
secrets: SecretClient;
|
|
2
3
|
list(request?: import("./v1.js").ContactListRequest | undefined): ResponsePromise<import('./v1.js').ContactListResponse, import('./v1.js').ContactListStreamType>;
|
|
3
4
|
fetch(contactId: string): Promise<import('./v1.js').ContactFetchResponse>;
|
|
4
5
|
create(request: import('./v1.js').ContactCreateRequest): Promise<import('./v1.js').ContactCreateResponse>;
|
|
5
6
|
update(contactId: string, request: import('./v1.js').ContactUpdateRequest): Promise<import('./v1.js').ContactUpdateResponse>;
|
|
6
7
|
delete(contactId: string): Promise<import('./v1.js').ContactDeleteResponse>;
|
|
8
|
+
ensure(request: import('./v1.js').ContactEnsureRequest): Promise<import('./v1.js').ContactEnsureResponse>;
|
|
7
9
|
}
|
|
8
10
|
export default ContactClient;
|
|
9
11
|
export type ResponsePromise<T, U> = import('../client.js').ResponsePromise<T, U>;
|
|
10
12
|
import { ChatBotKitClient } from '../client.js';
|
|
13
|
+
import { SecretClient } from './secret/index.js';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ChatBotKitClient } from '../client.js';
|
|
2
|
-
import {
|
|
2
|
+
import { SecretClient } from './secret/index.js';
|
|
3
|
+
import { createContact, deleteContact, ensureContact, fetchContact, listContacts, updateContact, } from './v1.js';
|
|
3
4
|
export class ContactClient extends ChatBotKitClient {
|
|
4
5
|
constructor(options) {
|
|
5
6
|
super(options);
|
|
7
|
+
this.secrets = new SecretClient(options);
|
|
6
8
|
}
|
|
7
9
|
list(request) {
|
|
8
10
|
return listContacts(this, request);
|
|
@@ -19,5 +21,8 @@ export class ContactClient extends ChatBotKitClient {
|
|
|
19
21
|
delete(contactId) {
|
|
20
22
|
return deleteContact(this, contactId);
|
|
21
23
|
}
|
|
24
|
+
ensure(request) {
|
|
25
|
+
return ensureContact(this, request);
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
export default ContactClient;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class SecretClient extends ChatBotKitClient {
|
|
2
|
+
list(contactId: string, request?: import("./v1.js").SecretListRequest | undefined): ResponsePromise<import('./v1.js').SecretListResponse, import('./v1.js').SecretListStreamType>;
|
|
3
|
+
delete(contactId: string, secretId: string): Promise<import('./v1.js').SecretDeleteResponse>;
|
|
4
|
+
verify(contactId: string, secretId: string): Promise<import('./v1.js').SecretVerifyResponse>;
|
|
5
|
+
authenticate(contactId: string, secretId: string): Promise<import('./v1.js').SecretAuthenticateResponse>;
|
|
6
|
+
}
|
|
7
|
+
export default SecretClient;
|
|
8
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
9
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
2
|
+
import { authenticateSecret, deleteSecret, listSecrets, verifySecret, } from './v1.js';
|
|
3
|
+
export class SecretClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
list(contactId, request) {
|
|
8
|
+
return listSecrets(this, contactId, request);
|
|
9
|
+
}
|
|
10
|
+
delete(contactId, secretId) {
|
|
11
|
+
return deleteSecret(this, contactId, secretId);
|
|
12
|
+
}
|
|
13
|
+
verify(contactId, secretId) {
|
|
14
|
+
return verifySecret(this, contactId, secretId);
|
|
15
|
+
}
|
|
16
|
+
authenticate(contactId, secretId) {
|
|
17
|
+
return authenticateSecret(this, contactId, secretId);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export default SecretClient;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export function listSecrets(client: ChatBotKitClient, contactId: string, request?: SecretListRequest | undefined): ResponsePromise<SecretListResponse, SecretListStreamType>;
|
|
2
|
+
export function deleteSecret(client: ChatBotKitClient, contactId: string, secretId: string): Promise<SecretDeleteResponse>;
|
|
3
|
+
export function verifySecret(client: ChatBotKitClient, contactId: string, secretId: string): Promise<SecretVerifyResponse>;
|
|
4
|
+
export function authenticateSecret(client: ChatBotKitClient, contactId: string, secretId: string): Promise<SecretAuthenticateResponse>;
|
|
5
|
+
export type ChatBotKitClient = import('../../client.js').ChatBotKitClient;
|
|
6
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
7
|
+
export type SecretOptions = {
|
|
8
|
+
name?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
meta?: Record<string, any>;
|
|
12
|
+
};
|
|
13
|
+
export type SecretInstance = SecretOptions & {
|
|
14
|
+
id: string;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
updatedAt: number;
|
|
17
|
+
};
|
|
18
|
+
export type SecretListRequest = {
|
|
19
|
+
cursor?: string;
|
|
20
|
+
order?: 'desc' | 'asc';
|
|
21
|
+
take?: number;
|
|
22
|
+
meta?: Record<string, string>;
|
|
23
|
+
};
|
|
24
|
+
export type SecretListResponse = {
|
|
25
|
+
items: SecretInstance[];
|
|
26
|
+
};
|
|
27
|
+
export type SecretListStreamItemType = {
|
|
28
|
+
type: 'item';
|
|
29
|
+
data: SecretInstance;
|
|
30
|
+
};
|
|
31
|
+
export type SecretListStreamType = SecretListStreamItemType;
|
|
32
|
+
export type SecretDeleteResponse = {
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
export type SecretVerifyResponse = {
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
export type SecretAuthenticateResponse = {
|
|
39
|
+
id: string;
|
|
40
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function listSecrets(client, contactId, request) {
|
|
2
|
+
let url = `/api/v1/contact/${contactId}/secret/list`;
|
|
3
|
+
const response = client.clientFetch(url, { query: request });
|
|
4
|
+
return response;
|
|
5
|
+
}
|
|
6
|
+
export async function deleteSecret(client, contactId, secretId) {
|
|
7
|
+
const url = `/api/v1/contact/${contactId}/${secretId}/delete`;
|
|
8
|
+
const response = await client.clientFetch(url, {
|
|
9
|
+
record: {},
|
|
10
|
+
});
|
|
11
|
+
return response;
|
|
12
|
+
}
|
|
13
|
+
export async function verifySecret(client, contactId, secretId) {
|
|
14
|
+
const url = `/api/v1/contact/${contactId}/${secretId}/verify`;
|
|
15
|
+
const response = await client.clientFetch(url, {
|
|
16
|
+
record: {},
|
|
17
|
+
});
|
|
18
|
+
return response;
|
|
19
|
+
}
|
|
20
|
+
export async function authenticateSecret(client, contactId, secretId) {
|
|
21
|
+
const url = `/api/v1/contact/${contactId}/${secretId}/authenticate`;
|
|
22
|
+
const response = await client.clientFetch(url, {
|
|
23
|
+
record: {},
|
|
24
|
+
});
|
|
25
|
+
return response;
|
|
26
|
+
}
|
package/dist/esm/contact/v1.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export function fetchContact(client: ChatBotKitClient, contactId: string): Promi
|
|
|
3
3
|
export function createContact(client: ChatBotKitClient, request: ContactCreateRequest): Promise<ContactCreateResponse>;
|
|
4
4
|
export function updateContact(client: ChatBotKitClient, contactId: string, request: ContactUpdateRequest): Promise<ContactUpdateResponse>;
|
|
5
5
|
export function deleteContact(client: ChatBotKitClient, contactId: string): Promise<ContactDeleteResponse>;
|
|
6
|
+
export function ensureContact(client: ChatBotKitClient, request: ContactEnsureRequest): Promise<ContactEnsureResponse>;
|
|
6
7
|
export type ChatBotKitClient = import('../client.js').ChatBotKitClient;
|
|
7
8
|
export type ResponsePromise<T, U> = import('../client.js').ResponsePromise<T, U>;
|
|
8
9
|
export type ContactOptions = {
|
|
@@ -11,6 +12,7 @@ export type ContactOptions = {
|
|
|
11
12
|
fingerprint?: string;
|
|
12
13
|
email?: string;
|
|
13
14
|
phone?: string;
|
|
15
|
+
nick?: string;
|
|
14
16
|
meta?: Record<string, any>;
|
|
15
17
|
};
|
|
16
18
|
export type ContactInstance = ContactOptions & {
|
|
@@ -33,9 +35,7 @@ export type ContactListStreamItemType = {
|
|
|
33
35
|
};
|
|
34
36
|
export type ContactListStreamType = ContactListStreamItemType;
|
|
35
37
|
export type ContactFetchResponse = ContactInstance & {};
|
|
36
|
-
export type ContactCreateRequest = ContactOptions & {
|
|
37
|
-
model?: import('../model/v1.js').Model;
|
|
38
|
-
};
|
|
38
|
+
export type ContactCreateRequest = ContactOptions & {};
|
|
39
39
|
export type ContactCreateResponse = {
|
|
40
40
|
id: string;
|
|
41
41
|
};
|
|
@@ -46,3 +46,9 @@ export type ContactUpdateResponse = {
|
|
|
46
46
|
export type ContactDeleteResponse = {
|
|
47
47
|
id: string;
|
|
48
48
|
};
|
|
49
|
+
export type ContactEnsureRequest = ContactOptions & {
|
|
50
|
+
fingerprint: string;
|
|
51
|
+
};
|
|
52
|
+
export type ContactEnsureResponse = {
|
|
53
|
+
id: string;
|
|
54
|
+
};
|
package/dist/esm/contact/v1.js
CHANGED
|
@@ -33,3 +33,12 @@ export async function deleteContact(client, contactId) {
|
|
|
33
33
|
});
|
|
34
34
|
return response;
|
|
35
35
|
}
|
|
36
|
+
export async function ensureContact(client, request) {
|
|
37
|
+
const url = `/api/v1/contact/ensure`;
|
|
38
|
+
const response = await client.clientFetch(url, {
|
|
39
|
+
record: {
|
|
40
|
+
...request,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return response;
|
|
44
|
+
}
|
|
@@ -23,6 +23,7 @@ export type TriggerIntegrationOptions = BotRefOrConfig & {
|
|
|
23
23
|
name?: string;
|
|
24
24
|
description?: string;
|
|
25
25
|
authenticate?: boolean;
|
|
26
|
+
triggerSchedule?: "never" | "quarterhourly" | "halfhourly" | "hourly" | "daily" | "weekly" | "monthly";
|
|
26
27
|
sessionDuration?: number;
|
|
27
28
|
meta?: Record<string, any>;
|
|
28
29
|
};
|