@lorikeetai/node-sdk 0.13.2 → 0.14.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/CHANGELOG.md +40 -0
- package/README.md +17 -32
- package/core.d.ts +7 -4
- package/core.d.ts.map +1 -1
- package/core.js +16 -9
- package/core.js.map +1 -1
- package/core.mjs +16 -9
- package/core.mjs.map +1 -1
- package/index.d.mts +21 -3
- package/index.d.ts +21 -3
- package/index.d.ts.map +1 -1
- package/index.js +35 -7
- package/index.js.map +1 -1
- package/index.mjs +36 -8
- package/index.mjs.map +1 -1
- package/internal/qs/formats.d.ts +6 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +11 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +8 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +279 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +276 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.ts +14 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +229 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/package.json +1 -5
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/conversation/chat.d.ts +19 -164
- package/resources/conversation/chat.d.ts.map +1 -1
- package/resources/conversation/chat.js.map +1 -1
- package/resources/conversation/chat.mjs.map +1 -1
- package/resources/conversation/conversation.d.ts +116 -0
- package/resources/conversation/conversation.d.ts.map +1 -1
- package/resources/conversation/conversation.js +36 -0
- package/resources/conversation/conversation.js.map +1 -1
- package/resources/conversation/conversation.mjs +36 -0
- package/resources/conversation/conversation.mjs.map +1 -1
- package/resources/conversation/email.d.ts +19 -164
- package/resources/conversation/email.d.ts.map +1 -1
- package/resources/conversation/email.js.map +1 -1
- package/resources/conversation/email.mjs.map +1 -1
- package/resources/conversation/index.d.ts +1 -1
- package/resources/conversation/index.d.ts.map +1 -1
- package/resources/conversation/index.js.map +1 -1
- package/resources/conversation/index.mjs +1 -1
- package/resources/conversation/index.mjs.map +1 -1
- package/resources/customer/customer.d.ts +296 -0
- package/resources/customer/customer.d.ts.map +1 -0
- package/resources/customer/customer.js +79 -0
- package/resources/customer/customer.js.map +1 -0
- package/resources/customer/customer.mjs +52 -0
- package/resources/customer/customer.mjs.map +1 -0
- package/resources/customer/index.d.ts +3 -0
- package/resources/customer/index.d.ts.map +1 -0
- package/resources/customer/index.js +9 -0
- package/resources/customer/index.js.map +1 -0
- package/resources/customer/index.mjs +4 -0
- package/resources/customer/index.mjs.map +1 -0
- package/resources/customer/profile.d.ts +71 -0
- package/resources/customer/profile.d.ts.map +1 -0
- package/resources/customer/profile.js +21 -0
- package/resources/customer/profile.js.map +1 -0
- package/resources/customer/profile.mjs +17 -0
- package/resources/customer/profile.mjs.map +1 -0
- package/resources/customer.d.ts +1 -291
- package/resources/customer.d.ts.map +1 -1
- package/resources/customer.js +15 -45
- package/resources/customer.js.map +1 -1
- package/resources/customer.mjs +1 -43
- package/resources/customer.mjs.map +1 -1
- package/resources/file.d.ts +7 -0
- package/resources/file.d.ts.map +1 -0
- package/resources/file.js +21 -0
- package/resources/file.js.map +1 -0
- package/resources/file.mjs +17 -0
- package/resources/file.mjs.map +1 -0
- package/resources/index.d.ts +6 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +10 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +6 -2
- package/resources/index.mjs.map +1 -1
- package/resources/ingest.d.ts +2 -0
- package/resources/ingest.d.ts.map +1 -1
- package/resources/ingest.js +9 -0
- package/resources/ingest.js.map +1 -1
- package/resources/ingest.mjs +9 -0
- package/resources/ingest.mjs.map +1 -1
- package/resources/oauth/authorization.d.ts +6 -0
- package/resources/oauth/authorization.d.ts.map +1 -0
- package/resources/oauth/authorization.js +15 -0
- package/resources/oauth/authorization.js.map +1 -0
- package/resources/oauth/authorization.mjs +11 -0
- package/resources/oauth/authorization.mjs.map +1 -0
- package/resources/oauth/index.d.ts +3 -0
- package/resources/oauth/index.d.ts.map +1 -0
- package/resources/oauth/index.js +9 -0
- package/resources/oauth/index.js.map +1 -0
- package/resources/oauth/index.mjs +4 -0
- package/resources/oauth/index.mjs.map +1 -0
- package/resources/oauth/oauth.d.ts +24 -0
- package/resources/oauth/oauth.d.ts.map +1 -0
- package/resources/oauth/oauth.js +65 -0
- package/resources/oauth/oauth.js.map +1 -0
- package/resources/oauth/oauth.mjs +38 -0
- package/resources/oauth/oauth.mjs.map +1 -0
- package/resources/oauth.d.ts +2 -0
- package/resources/oauth.d.ts.map +1 -0
- package/resources/oauth.js +19 -0
- package/resources/oauth.js.map +1 -0
- package/resources/oauth.mjs +3 -0
- package/resources/oauth.mjs.map +1 -0
- package/resources/suggestion.d.ts +7 -0
- package/resources/suggestion.d.ts.map +1 -0
- package/resources/suggestion.js +21 -0
- package/resources/suggestion.js.map +1 -0
- package/resources/suggestion.mjs +17 -0
- package/resources/suggestion.mjs.map +1 -0
- package/resources/ticket.d.ts +14 -0
- package/resources/ticket.d.ts.map +1 -0
- package/resources/ticket.js +16 -0
- package/resources/ticket.js.map +1 -0
- package/resources/ticket.mjs +12 -0
- package/resources/ticket.mjs.map +1 -0
- package/resources/top-level.d.ts +2 -0
- package/resources/top-level.d.ts.map +1 -0
- package/resources/top-level.js +4 -0
- package/resources/top-level.js.map +1 -0
- package/resources/top-level.mjs +3 -0
- package/resources/top-level.mjs.map +1 -0
- package/resources/webhooks.d.ts +6 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +15 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +11 -0
- package/resources/webhooks.mjs.map +1 -0
- package/resources/workflow.d.ts +1 -0
- package/resources/workflow.d.ts.map +1 -1
- package/resources/workflow.js +3 -0
- package/resources/workflow.js.map +1 -1
- package/resources/workflow.mjs +3 -0
- package/resources/workflow.mjs.map +1 -1
- package/src/core.ts +17 -8
- package/src/index.ts +77 -10
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +9 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +388 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/resource.ts +1 -1
- package/src/resources/conversation/chat.ts +21 -217
- package/src/resources/conversation/conversation.ts +175 -0
- package/src/resources/conversation/email.ts +21 -217
- package/src/resources/conversation/index.ts +10 -1
- package/src/resources/customer/customer.ts +386 -0
- package/src/resources/customer/index.ts +13 -0
- package/src/resources/customer/profile.ts +89 -0
- package/src/resources/customer.ts +1 -372
- package/src/resources/file.ts +20 -0
- package/src/resources/index.ts +15 -2
- package/src/resources/ingest.ts +17 -0
- package/src/resources/oauth/authorization.ts +13 -0
- package/src/resources/oauth/index.ts +4 -0
- package/src/resources/oauth/oauth.ts +63 -0
- package/src/resources/oauth.ts +3 -0
- package/src/resources/suggestion.ts +20 -0
- package/src/resources/ticket.ts +30 -0
- package/src/resources/top-level.ts +3 -0
- package/src/resources/webhooks.ts +13 -0
- package/src/resources/workflow.ts +4 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Ticket = void 0;
|
|
5
|
+
const resource_1 = require("../resource.js");
|
|
6
|
+
class Ticket extends resource_1.APIResource {
|
|
7
|
+
retrieveSse(ticketId, query, options) {
|
|
8
|
+
return this._client.get(`/v1/ticket/sse/${ticketId}`, {
|
|
9
|
+
query,
|
|
10
|
+
...options,
|
|
11
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Ticket = Ticket;
|
|
16
|
+
//# sourceMappingURL=ticket.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticket.js","sourceRoot":"","sources":["../src/resources/ticket.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,MAAO,SAAQ,sBAAW;IACrC,WAAW,CACT,QAAgB,EAChB,KAA8B,EAC9B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,QAAQ,EAAE,EAAE;YACpD,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAZD,wBAYC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../resource.mjs";
|
|
3
|
+
export class Ticket extends APIResource {
|
|
4
|
+
retrieveSse(ticketId, query, options) {
|
|
5
|
+
return this._client.get(`/v1/ticket/sse/${ticketId}`, {
|
|
6
|
+
query,
|
|
7
|
+
...options,
|
|
8
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ticket.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticket.mjs","sourceRoot":"","sources":["../src/resources/ticket.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC,WAAW,CACT,QAAgB,EAChB,KAA8B,EAC9B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,QAAQ,EAAE,EAAE;YACpD,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top-level.d.ts","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top-level.js","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":";AAAA,sFAAsF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top-level.mjs","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,QAAS,SAAQ,WAAW;IACvC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;CAMjE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Webhooks = void 0;
|
|
5
|
+
const resource_1 = require("../resource.js");
|
|
6
|
+
class Webhooks extends resource_1.APIResource {
|
|
7
|
+
createLori(options) {
|
|
8
|
+
return this._client.post('/webhooks/lori', {
|
|
9
|
+
...options,
|
|
10
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.Webhooks = Webhooks;
|
|
15
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,QAAS,SAAQ,sBAAW;IACvC,UAAU,CAAC,OAA6B;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzC,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAPD,4BAOC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../resource.mjs";
|
|
3
|
+
export class Webhooks extends APIResource {
|
|
4
|
+
createLori(options) {
|
|
5
|
+
return this._client.post('/webhooks/lori', {
|
|
6
|
+
...options,
|
|
7
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=webhooks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.mjs","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC,UAAU,CAAC,OAA6B;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzC,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/resources/workflow.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { APIResource } from "../resource.js";
|
|
2
2
|
import * as Core from "../core.js";
|
|
3
3
|
export declare class Workflow extends APIResource {
|
|
4
|
+
retrieve(options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
4
5
|
update(options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
5
6
|
get(id: string, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/resources/workflow.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,QAAS,SAAQ,WAAW;IACvC,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAI5D,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;CAMtE"}
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/resources/workflow.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,QAAS,SAAQ,WAAW;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAI9D,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAI5D,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;CAMtE"}
|
package/resources/workflow.js
CHANGED
|
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.Workflow = void 0;
|
|
5
5
|
const resource_1 = require("../resource.js");
|
|
6
6
|
class Workflow extends resource_1.APIResource {
|
|
7
|
+
retrieve(options) {
|
|
8
|
+
return this._client.get('/v1/workflow', { ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
9
|
+
}
|
|
7
10
|
update(options) {
|
|
8
11
|
return this._client.post('/v1/workflow', { ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
9
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/resources/workflow.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,QAAS,SAAQ,sBAAW;IACvC,MAAM,CAAC,OAA6B;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE;YAC5C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/resources/workflow.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,QAAS,SAAQ,sBAAW;IACvC,QAAQ,CAAC,OAA6B;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED,MAAM,CAAC,OAA6B;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE;YAC5C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAfD,4BAeC"}
|
package/resources/workflow.mjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../resource.mjs";
|
|
3
3
|
export class Workflow extends APIResource {
|
|
4
|
+
retrieve(options) {
|
|
5
|
+
return this._client.get('/v1/workflow', { ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
6
|
+
}
|
|
4
7
|
update(options) {
|
|
5
8
|
return this._client.post('/v1/workflow', { ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
6
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.mjs","sourceRoot":"","sources":["../src/resources/workflow.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC,MAAM,CAAC,OAA6B;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE;YAC5C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"workflow.mjs","sourceRoot":"","sources":["../src/resources/workflow.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC,QAAQ,CAAC,OAA6B;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED,MAAM,CAAC,OAA6B;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE;YAC5C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/src/core.ts
CHANGED
|
@@ -170,6 +170,7 @@ export class APIPromise<T> extends Promise<T> {
|
|
|
170
170
|
|
|
171
171
|
export abstract class APIClient {
|
|
172
172
|
baseURL: string;
|
|
173
|
+
#baseURLOverridden: boolean;
|
|
173
174
|
maxRetries: number;
|
|
174
175
|
timeout: number;
|
|
175
176
|
httpAgent: Agent | undefined;
|
|
@@ -179,18 +180,21 @@ export abstract class APIClient {
|
|
|
179
180
|
|
|
180
181
|
constructor({
|
|
181
182
|
baseURL,
|
|
183
|
+
baseURLOverridden,
|
|
182
184
|
maxRetries = 2,
|
|
183
185
|
timeout = 60000, // 1 minute
|
|
184
186
|
httpAgent,
|
|
185
187
|
fetch: overriddenFetch,
|
|
186
188
|
}: {
|
|
187
189
|
baseURL: string;
|
|
190
|
+
baseURLOverridden: boolean;
|
|
188
191
|
maxRetries?: number | undefined;
|
|
189
192
|
timeout: number | undefined;
|
|
190
193
|
httpAgent: Agent | undefined;
|
|
191
194
|
fetch: Fetch | undefined;
|
|
192
195
|
}) {
|
|
193
196
|
this.baseURL = baseURL;
|
|
197
|
+
this.#baseURLOverridden = baseURLOverridden;
|
|
194
198
|
this.maxRetries = validatePositiveInteger('maxRetries', maxRetries);
|
|
195
199
|
this.timeout = validatePositiveInteger('timeout', timeout);
|
|
196
200
|
this.httpAgent = httpAgent;
|
|
@@ -213,7 +217,7 @@ export abstract class APIClient {
|
|
|
213
217
|
protected defaultHeaders(opts: FinalRequestOptions): Headers {
|
|
214
218
|
return {
|
|
215
219
|
Accept: 'application/json',
|
|
216
|
-
'Content-Type': 'application/json',
|
|
220
|
+
...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }),
|
|
217
221
|
'User-Agent': this.getUserAgent(),
|
|
218
222
|
...getPlatformHeaders(),
|
|
219
223
|
...this.authHeaders(opts),
|
|
@@ -295,12 +299,12 @@ export abstract class APIClient {
|
|
|
295
299
|
return null;
|
|
296
300
|
}
|
|
297
301
|
|
|
298
|
-
buildRequest<Req>(
|
|
302
|
+
async buildRequest<Req>(
|
|
299
303
|
inputOptions: FinalRequestOptions<Req>,
|
|
300
304
|
{ retryCount = 0 }: { retryCount?: number } = {},
|
|
301
|
-
): { req: RequestInit; url: string; timeout: number } {
|
|
305
|
+
): Promise<{ req: RequestInit; url: string; timeout: number }> {
|
|
302
306
|
const options = { ...inputOptions };
|
|
303
|
-
const { method, path, query, headers: headers = {} } = options;
|
|
307
|
+
const { method, path, query, defaultBaseURL, headers: headers = {} } = options;
|
|
304
308
|
|
|
305
309
|
const body =
|
|
306
310
|
ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ?
|
|
@@ -310,7 +314,7 @@ export abstract class APIClient {
|
|
|
310
314
|
: null;
|
|
311
315
|
const contentLength = this.calculateContentLength(body);
|
|
312
316
|
|
|
313
|
-
const url = this.buildURL(path!, query);
|
|
317
|
+
const url = this.buildURL(path!, query, defaultBaseURL);
|
|
314
318
|
if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
|
|
315
319
|
options.timeout = options.timeout ?? this.timeout;
|
|
316
320
|
const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url);
|
|
@@ -446,7 +450,9 @@ export abstract class APIClient {
|
|
|
446
450
|
|
|
447
451
|
await this.prepareOptions(options);
|
|
448
452
|
|
|
449
|
-
const { req, url, timeout } = this.buildRequest(options, {
|
|
453
|
+
const { req, url, timeout } = await this.buildRequest(options, {
|
|
454
|
+
retryCount: maxRetries - retriesRemaining,
|
|
455
|
+
});
|
|
450
456
|
|
|
451
457
|
await this.prepareRequest(req, { url, options });
|
|
452
458
|
|
|
@@ -503,11 +509,12 @@ export abstract class APIClient {
|
|
|
503
509
|
return new PagePromise<PageClass, Item>(this, request, Page);
|
|
504
510
|
}
|
|
505
511
|
|
|
506
|
-
buildURL<Req>(path: string, query: Req | null | undefined): string {
|
|
512
|
+
buildURL<Req>(path: string, query: Req | null | undefined, defaultBaseURL?: string | undefined): string {
|
|
513
|
+
const baseURL = (!this.#baseURLOverridden && defaultBaseURL) || this.baseURL;
|
|
507
514
|
const url =
|
|
508
515
|
isAbsoluteURL(path) ?
|
|
509
516
|
new URL(path)
|
|
510
|
-
: new URL(
|
|
517
|
+
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
511
518
|
|
|
512
519
|
const defaultQuery = this.defaultQuery();
|
|
513
520
|
if (!isEmptyObj(defaultQuery)) {
|
|
@@ -792,6 +799,7 @@ export type RequestOptions<
|
|
|
792
799
|
query?: Req | undefined;
|
|
793
800
|
body?: Req | null | undefined;
|
|
794
801
|
headers?: Headers | undefined;
|
|
802
|
+
defaultBaseURL?: string | undefined;
|
|
795
803
|
|
|
796
804
|
maxRetries?: number;
|
|
797
805
|
stream?: boolean | undefined;
|
|
@@ -813,6 +821,7 @@ const requestOptionsKeys: KeysEnum<RequestOptions> = {
|
|
|
813
821
|
query: true,
|
|
814
822
|
body: true,
|
|
815
823
|
headers: true,
|
|
824
|
+
defaultBaseURL: true,
|
|
816
825
|
|
|
817
826
|
maxRetries: true,
|
|
818
827
|
stream: true,
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,22 @@ import * as Core from './core';
|
|
|
5
5
|
import * as Errors from './error';
|
|
6
6
|
import * as Uploads from './uploads';
|
|
7
7
|
import * as API from './resources/index';
|
|
8
|
+
import { File } from './resources/file';
|
|
9
|
+
import { Ingest, IngestTestParams } from './resources/ingest';
|
|
10
|
+
import { Suggestion } from './resources/suggestion';
|
|
11
|
+
import { Webhooks } from './resources/webhooks';
|
|
12
|
+
import { Workflow } from './resources/workflow';
|
|
13
|
+
import {
|
|
14
|
+
AttachmentDto,
|
|
15
|
+
Conversation,
|
|
16
|
+
ConversationCreateParams,
|
|
17
|
+
ConversationCreateResponse,
|
|
18
|
+
ConversationRetrieveTranscriptParams,
|
|
19
|
+
ConversationRetrieveTranscriptResponse,
|
|
20
|
+
TicketEvent,
|
|
21
|
+
TicketMessageDto,
|
|
22
|
+
} from './resources/conversation/conversation';
|
|
23
|
+
import { generateSignature } from './lib/generate-signature';
|
|
8
24
|
import {
|
|
9
25
|
Customer,
|
|
10
26
|
CustomerCreateParams,
|
|
@@ -14,11 +30,8 @@ import {
|
|
|
14
30
|
CustomerTokenResponse,
|
|
15
31
|
CustomerUpdateParams,
|
|
16
32
|
CustomerUpdateResponse,
|
|
17
|
-
} from './resources/customer';
|
|
18
|
-
import {
|
|
19
|
-
import { Workflow } from './resources/workflow';
|
|
20
|
-
import { Conversation } from './resources/conversation/conversation';
|
|
21
|
-
import { generateSignature } from './lib/generate-signature';
|
|
33
|
+
} from './resources/customer/customer';
|
|
34
|
+
import { OAuth, OAuthAuthorizeParams, OAuthCallbackParams } from './resources/oauth/oauth';
|
|
22
35
|
|
|
23
36
|
export interface ClientOptions {
|
|
24
37
|
/**
|
|
@@ -44,6 +57,8 @@ export interface ClientOptions {
|
|
|
44
57
|
*
|
|
45
58
|
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
46
59
|
* much longer than this timeout before the promise succeeds or fails.
|
|
60
|
+
*
|
|
61
|
+
* @unit milliseconds
|
|
47
62
|
*/
|
|
48
63
|
timeout?: number | undefined;
|
|
49
64
|
|
|
@@ -136,6 +151,7 @@ export class Lorikeet extends Core.APIClient {
|
|
|
136
151
|
|
|
137
152
|
super({
|
|
138
153
|
baseURL: options.baseURL!,
|
|
154
|
+
baseURLOverridden: baseURL ? baseURL !== 'https://api.lorikeetcx.ai' : false,
|
|
139
155
|
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
140
156
|
httpAgent: options.httpAgent,
|
|
141
157
|
maxRetries: options.maxRetries,
|
|
@@ -152,6 +168,21 @@ export class Lorikeet extends Core.APIClient {
|
|
|
152
168
|
customer: API.Customer = new API.Customer(this);
|
|
153
169
|
workflow: API.Workflow = new API.Workflow(this);
|
|
154
170
|
ingest: API.Ingest = new API.Ingest(this);
|
|
171
|
+
file: API.File = new API.File(this);
|
|
172
|
+
suggestion: API.Suggestion = new API.Suggestion(this);
|
|
173
|
+
oauth: API.OAuth = new API.OAuth(this);
|
|
174
|
+
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Check whether the base URL is set to its default.
|
|
178
|
+
*/
|
|
179
|
+
#baseURLOverridden(): boolean {
|
|
180
|
+
return this.baseURL !== 'https://api.lorikeetcx.ai';
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
retrieve(options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
184
|
+
return this.get('/', { ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
185
|
+
}
|
|
155
186
|
|
|
156
187
|
protected override defaultQuery(): Core.DefaultQuery | undefined {
|
|
157
188
|
return this._options.defaultQuery;
|
|
@@ -165,7 +196,17 @@ export class Lorikeet extends Core.APIClient {
|
|
|
165
196
|
}
|
|
166
197
|
|
|
167
198
|
protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers {
|
|
168
|
-
|
|
199
|
+
return {
|
|
200
|
+
...this.lorikeetClientIdAuth(opts),
|
|
201
|
+
...this.lorikeetSignatureAuthV1Auth(opts),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
protected lorikeetClientIdAuth(opts: Core.FinalRequestOptions): Core.Headers {
|
|
206
|
+
return { authorization: `Bearer ${this.clientId}` };
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
protected lorikeetSignatureAuthV1Auth(opts: Core.FinalRequestOptions): Core.Headers {
|
|
169
210
|
const signature = generateSignature(
|
|
170
211
|
opts.body ?
|
|
171
212
|
typeof opts.body === 'string' ?
|
|
@@ -175,10 +216,11 @@ export class Lorikeet extends Core.APIClient {
|
|
|
175
216
|
this.clientSecret,
|
|
176
217
|
);
|
|
177
218
|
return {
|
|
178
|
-
// backwards compatibility
|
|
179
|
-
'x-optech-webhook-signature': signature,
|
|
180
219
|
'x-lorikeet-signature': signature,
|
|
181
|
-
|
|
220
|
+
/**
|
|
221
|
+
* @deprecated Use x-lorikeet-signature instead
|
|
222
|
+
*/
|
|
223
|
+
'x-optech-webhook-signature': signature,
|
|
182
224
|
};
|
|
183
225
|
}
|
|
184
226
|
|
|
@@ -207,10 +249,23 @@ Lorikeet.Conversation = Conversation;
|
|
|
207
249
|
Lorikeet.Customer = Customer;
|
|
208
250
|
Lorikeet.Workflow = Workflow;
|
|
209
251
|
Lorikeet.Ingest = Ingest;
|
|
252
|
+
Lorikeet.File = File;
|
|
253
|
+
Lorikeet.Suggestion = Suggestion;
|
|
254
|
+
Lorikeet.OAuth = OAuth;
|
|
255
|
+
Lorikeet.Webhooks = Webhooks;
|
|
210
256
|
export declare namespace Lorikeet {
|
|
211
257
|
export type RequestOptions = Core.RequestOptions;
|
|
212
258
|
|
|
213
|
-
export {
|
|
259
|
+
export {
|
|
260
|
+
Conversation as Conversation,
|
|
261
|
+
type AttachmentDto as AttachmentDto,
|
|
262
|
+
type TicketEvent as TicketEvent,
|
|
263
|
+
type TicketMessageDto as TicketMessageDto,
|
|
264
|
+
type ConversationCreateResponse as ConversationCreateResponse,
|
|
265
|
+
type ConversationRetrieveTranscriptResponse as ConversationRetrieveTranscriptResponse,
|
|
266
|
+
type ConversationCreateParams as ConversationCreateParams,
|
|
267
|
+
type ConversationRetrieveTranscriptParams as ConversationRetrieveTranscriptParams,
|
|
268
|
+
};
|
|
214
269
|
|
|
215
270
|
export {
|
|
216
271
|
Customer as Customer,
|
|
@@ -226,6 +281,18 @@ export declare namespace Lorikeet {
|
|
|
226
281
|
export { Workflow as Workflow };
|
|
227
282
|
|
|
228
283
|
export { Ingest as Ingest, type IngestTestParams as IngestTestParams };
|
|
284
|
+
|
|
285
|
+
export { File as File };
|
|
286
|
+
|
|
287
|
+
export { Suggestion as Suggestion };
|
|
288
|
+
|
|
289
|
+
export {
|
|
290
|
+
OAuth as OAuth,
|
|
291
|
+
type OAuthAuthorizeParams as OAuthAuthorizeParams,
|
|
292
|
+
type OAuthCallbackParams as OAuthCallbackParams,
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export { Webhooks as Webhooks };
|
|
229
296
|
}
|
|
230
297
|
|
|
231
298
|
export { toFile, fileFromPath } from './uploads';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
10
|
+
|
|
11
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
12
|
+
|
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Format } from './types';
|
|
2
|
+
|
|
3
|
+
export const default_format: Format = 'RFC3986';
|
|
4
|
+
export const formatters: Record<Format, (str: PropertyKey) => string> = {
|
|
5
|
+
RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'),
|
|
6
|
+
RFC3986: (v: PropertyKey) => String(v),
|
|
7
|
+
};
|
|
8
|
+
export const RFC1738 = 'RFC1738';
|
|
9
|
+
export const RFC3986 = 'RFC3986';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default_format, formatters, RFC1738, RFC3986 } from './formats';
|
|
2
|
+
|
|
3
|
+
const formats = {
|
|
4
|
+
formatters,
|
|
5
|
+
RFC1738,
|
|
6
|
+
RFC3986,
|
|
7
|
+
default: default_format,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { stringify } from './stringify';
|
|
11
|
+
export { formats };
|
|
12
|
+
|
|
13
|
+
export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types';
|