@orq-ai/node 1.32.0-rc.5 → 1.32.0-rc.6
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/README.md +30 -0
- package/docs/sdks/prompt/README.md +6 -0
- package/docs/sdks/prompts/README.md +533 -0
- package/docs/sdks/snippets/README.md +84 -0
- package/docs/sdks/templates/README.md +80 -0
- package/funcs/promptSnippetsFindOne.d.ts +12 -0
- package/funcs/promptSnippetsFindOne.d.ts.map +1 -0
- package/funcs/promptSnippetsFindOne.js +108 -0
- package/funcs/promptSnippetsFindOne.js.map +1 -0
- package/funcs/promptTemplatesGetAll.d.ts +12 -0
- package/funcs/promptTemplatesGetAll.d.ts.map +1 -0
- package/funcs/promptTemplatesGetAll.js +108 -0
- package/funcs/promptTemplatesGetAll.js.map +1 -0
- package/funcs/promptsCreate.d.ts +12 -0
- package/funcs/promptsCreate.d.ts.map +1 -0
- package/funcs/promptsCreate.js +105 -0
- package/funcs/promptsCreate.js.map +1 -0
- package/funcs/promptsCreateVersion.d.ts +12 -0
- package/funcs/promptsCreateVersion.d.ts.map +1 -0
- package/funcs/promptsCreateVersion.js +109 -0
- package/funcs/promptsCreateVersion.js.map +1 -0
- package/funcs/promptsDelete.d.ts +12 -0
- package/funcs/promptsDelete.d.ts.map +1 -0
- package/funcs/promptsDelete.js +109 -0
- package/funcs/promptsDelete.js.map +1 -0
- package/funcs/promptsDuplicate.d.ts +12 -0
- package/funcs/promptsDuplicate.d.ts.map +1 -0
- package/funcs/promptsDuplicate.js +109 -0
- package/funcs/promptsDuplicate.js.map +1 -0
- package/funcs/promptsGetAll.d.ts +12 -0
- package/funcs/promptsGetAll.d.ts.map +1 -0
- package/funcs/promptsGetAll.js +108 -0
- package/funcs/promptsGetAll.js.map +1 -0
- package/funcs/promptsGetOne.d.ts +12 -0
- package/funcs/promptsGetOne.d.ts.map +1 -0
- package/funcs/promptsGetOne.js +109 -0
- package/funcs/promptsGetOne.js.map +1 -0
- package/funcs/promptsUpdate.d.ts +13 -0
- package/funcs/promptsUpdate.d.ts.map +1 -0
- package/funcs/promptsUpdate.js +113 -0
- package/funcs/promptsUpdate.js.map +1 -0
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/updateprompt.d.ts +36 -0
- package/models/errors/updateprompt.d.ts.map +1 -0
- package/models/errors/updateprompt.js +79 -0
- package/models/errors/updateprompt.js.map +1 -0
- package/models/operations/bulkfileupload.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createprompt.d.ts +2035 -0
- package/models/operations/createprompt.d.ts.map +1 -0
- package/models/operations/createprompt.js +1853 -0
- package/models/operations/createprompt.js.map +1 -0
- package/models/operations/createpromptversion.d.ts +2001 -0
- package/models/operations/createpromptversion.d.ts.map +1 -0
- package/models/operations/createpromptversion.js +1848 -0
- package/models/operations/createpromptversion.js.map +1 -0
- package/models/operations/deleteprompt.d.ts +32 -0
- package/models/operations/deleteprompt.d.ts.map +1 -0
- package/models/operations/deleteprompt.js +69 -0
- package/models/operations/deleteprompt.js.map +1 -0
- package/models/operations/deploymentgetconfig.d.ts +96 -96
- package/models/operations/deploymentgetconfig.d.ts.map +1 -1
- package/models/operations/deploymentgetconfig.js +136 -135
- package/models/operations/deploymentgetconfig.js.map +1 -1
- package/models/operations/deploymentinvoke.d.ts +46 -49
- package/models/operations/deploymentinvoke.d.ts.map +1 -1
- package/models/operations/deploymentinvoke.js +61 -63
- package/models/operations/deploymentinvoke.js.map +1 -1
- package/models/operations/deployments.d.ts +53 -53
- package/models/operations/deployments.d.ts.map +1 -1
- package/models/operations/deployments.js +66 -67
- package/models/operations/deployments.js.map +1 -1
- package/models/operations/duplicateprompt.d.ts +32 -0
- package/models/operations/duplicateprompt.d.ts.map +1 -0
- package/models/operations/duplicateprompt.js +69 -0
- package/models/operations/duplicateprompt.js.map +1 -0
- package/models/operations/fileupload.js +2 -2
- package/models/operations/findonepromptsnippet.d.ts +6278 -0
- package/models/operations/findonepromptsnippet.d.ts.map +1 -0
- package/models/operations/findonepromptsnippet.js +5891 -0
- package/models/operations/findonepromptsnippet.js.map +1 -0
- package/models/operations/getallprompts.d.ts +6613 -0
- package/models/operations/getallprompts.d.ts.map +1 -0
- package/models/operations/getallprompts.js +6161 -0
- package/models/operations/getallprompts.js.map +1 -0
- package/models/operations/getallprompttemplates.d.ts +6607 -0
- package/models/operations/getallprompttemplates.d.ts.map +1 -0
- package/models/operations/getallprompttemplates.js +6225 -0
- package/models/operations/getallprompttemplates.js.map +1 -0
- package/models/operations/getoneprompt.d.ts +32 -0
- package/models/operations/getoneprompt.d.ts.map +1 -0
- package/models/operations/getoneprompt.js +69 -0
- package/models/operations/getoneprompt.js.map +1 -0
- package/models/operations/index.d.ts +9 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +9 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/updateprompt.d.ts +7251 -0
- package/models/operations/updateprompt.d.ts.map +1 -0
- package/models/operations/updateprompt.js +6678 -0
- package/models/operations/updateprompt.js.map +1 -0
- package/package.json +1 -1
- package/sdk/prompt.d.ts +10 -0
- package/sdk/prompt.d.ts.map +1 -0
- package/sdk/prompt.js +21 -0
- package/sdk/prompt.js.map +1 -0
- package/sdk/prompts.d.ts +33 -0
- package/sdk/prompts.d.ts.map +1 -0
- package/sdk/prompts.js +61 -0
- package/sdk/prompts.js.map +1 -0
- package/sdk/sdk.d.ts +6 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +10 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/snippets.d.ts +9 -0
- package/sdk/snippets.d.ts.map +1 -0
- package/sdk/snippets.js +19 -0
- package/sdk/snippets.js.map +1 -0
- package/sdk/templates.d.ts +9 -0
- package/sdk/templates.d.ts.map +1 -0
- package/sdk/templates.js +19 -0
- package/sdk/templates.js.map +1 -0
- package/src/funcs/promptSnippetsFindOne.ts +128 -0
- package/src/funcs/promptTemplatesGetAll.ts +130 -0
- package/src/funcs/promptsCreate.ts +124 -0
- package/src/funcs/promptsCreateVersion.ts +129 -0
- package/src/funcs/promptsDelete.ts +128 -0
- package/src/funcs/promptsDuplicate.ts +128 -0
- package/src/funcs/promptsGetAll.ts +128 -0
- package/src/funcs/promptsGetOne.ts +128 -0
- package/src/funcs/promptsUpdate.ts +136 -0
- package/src/lib/config.ts +2 -2
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/updateprompt.ts +71 -0
- package/src/models/operations/bulkfileupload.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createprompt.ts +3455 -0
- package/src/models/operations/createpromptversion.ts +3697 -0
- package/src/models/operations/deleteprompt.ts +69 -0
- package/src/models/operations/deploymentgetconfig.ts +255 -188
- package/src/models/operations/deploymentinvoke.ts +95 -81
- package/src/models/operations/deployments.ts +101 -88
- package/src/models/operations/duplicateprompt.ts +69 -0
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/findonepromptsnippet.ts +13629 -0
- package/src/models/operations/getallprompts.ts +13390 -0
- package/src/models/operations/getallprompttemplates.ts +13690 -0
- package/src/models/operations/getoneprompt.ts +69 -0
- package/src/models/operations/index.ts +9 -0
- package/src/models/operations/updateprompt.ts +14407 -0
- package/src/sdk/prompt.ts +19 -0
- package/src/sdk/prompts.ts +114 -0
- package/src/sdk/sdk.ts +12 -0
- package/src/sdk/snippets.ts +24 -0
- package/src/sdk/templates.ts +24 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Snippets
|
|
2
|
+
(*prompt.snippets*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [findOne](#findone) - Get one prompt snippet
|
|
9
|
+
|
|
10
|
+
## findOne
|
|
11
|
+
|
|
12
|
+
Get one prompt snippet
|
|
13
|
+
|
|
14
|
+
### Example Usage
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { Orq } from "@orq-ai/node";
|
|
18
|
+
|
|
19
|
+
const orq = new Orq({
|
|
20
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
async function run() {
|
|
24
|
+
const result = await orq.prompt.snippets.findOne({
|
|
25
|
+
key: "<key>",
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Handle the result
|
|
29
|
+
console.log(result);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
run();
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Standalone function
|
|
36
|
+
|
|
37
|
+
The standalone function version of this method:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
41
|
+
import { promptSnippetsFindOne } from "@orq-ai/node/funcs/promptSnippetsFindOne.js";
|
|
42
|
+
|
|
43
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
44
|
+
// You can create one instance of it to use across an application.
|
|
45
|
+
const orq = new OrqCore({
|
|
46
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
async function run() {
|
|
50
|
+
const res = await promptSnippetsFindOne(orq, {
|
|
51
|
+
key: "<key>",
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (!res.ok) {
|
|
55
|
+
throw res.error;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const { value: result } = res;
|
|
59
|
+
|
|
60
|
+
// Handle the result
|
|
61
|
+
console.log(result);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
run();
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Parameters
|
|
68
|
+
|
|
69
|
+
| Parameter | Type | Required | Description |
|
|
70
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
71
|
+
| `request` | [operations.FindOnePromptSnippetRequest](../../models/operations/findonepromptsnippetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
72
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
73
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
74
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
75
|
+
|
|
76
|
+
### Response
|
|
77
|
+
|
|
78
|
+
**Promise\<[operations.FindOnePromptSnippetResponseBody](../../models/operations/findonepromptsnippetresponsebody.md)\>**
|
|
79
|
+
|
|
80
|
+
### Errors
|
|
81
|
+
|
|
82
|
+
| Error Type | Status Code | Content Type |
|
|
83
|
+
| --------------- | --------------- | --------------- |
|
|
84
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Templates
|
|
2
|
+
(*prompt.templates*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [getAll](#getall) - Get all prompt templates
|
|
9
|
+
|
|
10
|
+
## getAll
|
|
11
|
+
|
|
12
|
+
Get all prompt templates
|
|
13
|
+
|
|
14
|
+
### Example Usage
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { Orq } from "@orq-ai/node";
|
|
18
|
+
|
|
19
|
+
const orq = new Orq({
|
|
20
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
async function run() {
|
|
24
|
+
const result = await orq.prompt.templates.getAll();
|
|
25
|
+
|
|
26
|
+
// Handle the result
|
|
27
|
+
console.log(result);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
run();
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Standalone function
|
|
34
|
+
|
|
35
|
+
The standalone function version of this method:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
39
|
+
import { promptTemplatesGetAll } from "@orq-ai/node/funcs/promptTemplatesGetAll.js";
|
|
40
|
+
|
|
41
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
42
|
+
// You can create one instance of it to use across an application.
|
|
43
|
+
const orq = new OrqCore({
|
|
44
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
async function run() {
|
|
48
|
+
const res = await promptTemplatesGetAll(orq);
|
|
49
|
+
|
|
50
|
+
if (!res.ok) {
|
|
51
|
+
throw res.error;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const { value: result } = res;
|
|
55
|
+
|
|
56
|
+
// Handle the result
|
|
57
|
+
console.log(result);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
run();
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Parameters
|
|
64
|
+
|
|
65
|
+
| Parameter | Type | Required | Description |
|
|
66
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
67
|
+
| `request` | [operations.GetAllPromptTemplatesRequest](../../models/operations/getallprompttemplatesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
68
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
69
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
70
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
71
|
+
|
|
72
|
+
### Response
|
|
73
|
+
|
|
74
|
+
**Promise\<[operations.GetAllPromptTemplatesResponseBody](../../models/operations/getallprompttemplatesresponsebody.md)\>**
|
|
75
|
+
|
|
76
|
+
### Errors
|
|
77
|
+
|
|
78
|
+
| Error Type | Status Code | Content Type |
|
|
79
|
+
| --------------- | --------------- | --------------- |
|
|
80
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OrqCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import * as operations from "../models/operations/index.js";
|
|
7
|
+
import { Result } from "../types/fp.js";
|
|
8
|
+
/**
|
|
9
|
+
* Get one prompt snippet
|
|
10
|
+
*/
|
|
11
|
+
export declare function promptSnippetsFindOne(client: OrqCore, request: operations.FindOnePromptSnippetRequest, options?: RequestOptions): Promise<Result<operations.FindOnePromptSnippetResponseBody, APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
12
|
+
//# sourceMappingURL=promptSnippetsFindOne.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptSnippetsFindOne.d.ts","sourceRoot":"","sources":["../src/funcs/promptSnippetsFindOne.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,UAAU,CAAC,2BAA2B,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,UAAU,CAAC,gCAAgC,EACzC,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAsFA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.promptSnippetsFindOne = promptSnippetsFindOne;
|
|
40
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
41
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
42
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
43
|
+
const security_js_1 = require("../lib/security.js");
|
|
44
|
+
const url_js_1 = require("../lib/url.js");
|
|
45
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
46
|
+
/**
|
|
47
|
+
* Get one prompt snippet
|
|
48
|
+
*/
|
|
49
|
+
async function promptSnippetsFindOne(client, request, options) {
|
|
50
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.FindOnePromptSnippetRequest$outboundSchema.parse(value), "Input validation failed");
|
|
51
|
+
if (!parsed.ok) {
|
|
52
|
+
return parsed;
|
|
53
|
+
}
|
|
54
|
+
const payload = parsed.value;
|
|
55
|
+
const body = null;
|
|
56
|
+
const pathParams = {
|
|
57
|
+
key: (0, encodings_js_1.encodeSimple)("key", payload.key, {
|
|
58
|
+
explode: false,
|
|
59
|
+
charEncoding: "percent",
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
const path = (0, url_js_1.pathToFunc)("/v2/resources/prompts/snippets/{key}")(pathParams);
|
|
63
|
+
const headers = new Headers({
|
|
64
|
+
Accept: "application/json",
|
|
65
|
+
});
|
|
66
|
+
const secConfig = await (0, security_js_1.extractSecurity)(client._options.apiKey);
|
|
67
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
68
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
69
|
+
const context = {
|
|
70
|
+
operationID: "FindOnePromptSnippet",
|
|
71
|
+
oAuth2Scopes: [],
|
|
72
|
+
resolvedSecurity: requestSecurity,
|
|
73
|
+
securitySource: client._options.apiKey,
|
|
74
|
+
retryConfig: (options === null || options === void 0 ? void 0 : options.retries)
|
|
75
|
+
|| client._options.retryConfig
|
|
76
|
+
|| { strategy: "none" },
|
|
77
|
+
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
78
|
+
};
|
|
79
|
+
const requestRes = client._createRequest(context, {
|
|
80
|
+
security: requestSecurity,
|
|
81
|
+
method: "GET",
|
|
82
|
+
baseURL: options === null || options === void 0 ? void 0 : options.serverURL,
|
|
83
|
+
path: path,
|
|
84
|
+
headers: headers,
|
|
85
|
+
body: body,
|
|
86
|
+
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || 600000,
|
|
87
|
+
}, options);
|
|
88
|
+
if (!requestRes.ok) {
|
|
89
|
+
return requestRes;
|
|
90
|
+
}
|
|
91
|
+
const req = requestRes.value;
|
|
92
|
+
const doResult = await client._do(req, {
|
|
93
|
+
context,
|
|
94
|
+
errorCodes: ["400", "404", "4XX", "5XX"],
|
|
95
|
+
retryConfig: context.retryConfig,
|
|
96
|
+
retryCodes: context.retryCodes,
|
|
97
|
+
});
|
|
98
|
+
if (!doResult.ok) {
|
|
99
|
+
return doResult;
|
|
100
|
+
}
|
|
101
|
+
const response = doResult.value;
|
|
102
|
+
const [result] = await M.match(M.json(200, operations.FindOnePromptSnippetResponseBody$inboundSchema), M.fail([400, 404, "4XX", "5XX"]))(response);
|
|
103
|
+
if (!result.ok) {
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=promptSnippetsFindOne.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptSnippetsFindOne.js","sourceRoot":"","sources":["../src/funcs/promptSnippetsFindOne.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBH,sDAqGC;AA1HD,sDAAmD;AACnD,sDAAwC;AACxC,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAU3C,0EAA4D;AAG5D;;GAEG;AACI,KAAK,UAAU,qBAAqB,CACzC,MAAe,EACf,OAA+C,EAC/C,OAAwB;IAaxB,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CACR,UAAU,CAAC,0CAA0C,CAAC,KAAK,CAAC,KAAK,CAAC,EACpE,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC;IAElB,MAAM,UAAU,GAAG;QACjB,GAAG,EAAE,IAAA,2BAAY,EAAC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE;YACpC,OAAO,E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O,uBAAP,OAAO,CAAE,SAAS,KAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,IAAI,MAAM;KACrE,EAAE,OAAO,CAAC,CAAC;IACZ,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;QACnB,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;QACrC,OAAO;QACP,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;QACxC,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAU5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,8CAA8C,CAAC,EACtE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CACjC,CAAC,QAAQ,CAAC,CAAC;IACZ,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OrqCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import * as operations from "../models/operations/index.js";
|
|
7
|
+
import { Result } from "../types/fp.js";
|
|
8
|
+
/**
|
|
9
|
+
* Get all prompt templates
|
|
10
|
+
*/
|
|
11
|
+
export declare function promptTemplatesGetAll(client: OrqCore, request?: operations.GetAllPromptTemplatesRequest | undefined, options?: RequestOptions): Promise<Result<operations.GetAllPromptTemplatesResponseBody, APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
12
|
+
//# sourceMappingURL=promptTemplatesGetAll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptTemplatesGetAll.d.ts","sourceRoot":"","sources":["../src/funcs/promptTemplatesGetAll.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,UAAU,CAAC,4BAA4B,GAAG,SAAS,EAC7D,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,UAAU,CAAC,iCAAiC,EAC1C,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAwFA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.promptTemplatesGetAll = promptTemplatesGetAll;
|
|
40
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
41
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
42
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
43
|
+
const security_js_1 = require("../lib/security.js");
|
|
44
|
+
const url_js_1 = require("../lib/url.js");
|
|
45
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
46
|
+
/**
|
|
47
|
+
* Get all prompt templates
|
|
48
|
+
*/
|
|
49
|
+
async function promptTemplatesGetAll(client, request, options) {
|
|
50
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.GetAllPromptTemplatesRequest$outboundSchema.optional().parse(value), "Input validation failed");
|
|
51
|
+
if (!parsed.ok) {
|
|
52
|
+
return parsed;
|
|
53
|
+
}
|
|
54
|
+
const payload = parsed.value;
|
|
55
|
+
const body = (0, encodings_js_1.encodeJSON)("body", payload === null || payload === void 0 ? void 0 : payload.RequestBody, { explode: true });
|
|
56
|
+
const path = (0, url_js_1.pathToFunc)("/v2/resources/prompts/templates/query")();
|
|
57
|
+
const query = (0, encodings_js_1.encodeFormQuery)({
|
|
58
|
+
"limit": payload === null || payload === void 0 ? void 0 : payload.limit,
|
|
59
|
+
"page": payload === null || payload === void 0 ? void 0 : payload.page,
|
|
60
|
+
});
|
|
61
|
+
const headers = new Headers({
|
|
62
|
+
"Content-Type": "application/json",
|
|
63
|
+
Accept: "application/json",
|
|
64
|
+
});
|
|
65
|
+
const secConfig = await (0, security_js_1.extractSecurity)(client._options.apiKey);
|
|
66
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
67
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
68
|
+
const context = {
|
|
69
|
+
operationID: "GetAllPromptTemplates",
|
|
70
|
+
oAuth2Scopes: [],
|
|
71
|
+
resolvedSecurity: requestSecurity,
|
|
72
|
+
securitySource: client._options.apiKey,
|
|
73
|
+
retryConfig: (options === null || options === void 0 ? void 0 : options.retries)
|
|
74
|
+
|| client._options.retryConfig
|
|
75
|
+
|| { strategy: "none" },
|
|
76
|
+
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
77
|
+
};
|
|
78
|
+
const requestRes = client._createRequest(context, {
|
|
79
|
+
security: requestSecurity,
|
|
80
|
+
method: "POST",
|
|
81
|
+
baseURL: options === null || options === void 0 ? void 0 : options.serverURL,
|
|
82
|
+
path: path,
|
|
83
|
+
headers: headers,
|
|
84
|
+
query: query,
|
|
85
|
+
body: body,
|
|
86
|
+
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || 600000,
|
|
87
|
+
}, options);
|
|
88
|
+
if (!requestRes.ok) {
|
|
89
|
+
return requestRes;
|
|
90
|
+
}
|
|
91
|
+
const req = requestRes.value;
|
|
92
|
+
const doResult = await client._do(req, {
|
|
93
|
+
context,
|
|
94
|
+
errorCodes: ["400", "4XX", "5XX"],
|
|
95
|
+
retryConfig: context.retryConfig,
|
|
96
|
+
retryCodes: context.retryCodes,
|
|
97
|
+
});
|
|
98
|
+
if (!doResult.ok) {
|
|
99
|
+
return doResult;
|
|
100
|
+
}
|
|
101
|
+
const response = doResult.value;
|
|
102
|
+
const [result] = await M.match(M.json(200, operations.GetAllPromptTemplatesResponseBody$inboundSchema), M.fail([400, "4XX", "5XX"]))(response);
|
|
103
|
+
if (!result.ok) {
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=promptTemplatesGetAll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptTemplatesGetAll.js","sourceRoot":"","sources":["../src/funcs/promptTemplatesGetAll.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBH,sDAuGC;A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AAC,UAAU;KAC/B,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAU5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,+CAA+C,CAAC,EACvE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAC5B,CAAC,QAAQ,CAAC,CAAC;IACZ,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OrqCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import * as operations from "../models/operations/index.js";
|
|
7
|
+
import { Result } from "../types/fp.js";
|
|
8
|
+
/**
|
|
9
|
+
* Create a new prompt
|
|
10
|
+
*/
|
|
11
|
+
export declare function promptsCreate(client: OrqCore, request?: operations.CreatePromptRequestBody | undefined, options?: RequestOptions): Promise<Result<operations.CreatePromptResponseBody, APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
12
|
+
//# sourceMappingURL=promptsCreate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptsCreate.d.ts","sourceRoot":"","sources":["../src/funcs/promptsCreate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,UAAU,CAAC,uBAAuB,GAAG,SAAS,EACxD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,UAAU,CAAC,wBAAwB,EACjC,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAkFA"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.promptsCreate = promptsCreate;
|
|
40
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
41
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
42
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
43
|
+
const security_js_1 = require("../lib/security.js");
|
|
44
|
+
const url_js_1 = require("../lib/url.js");
|
|
45
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
46
|
+
/**
|
|
47
|
+
* Create a new prompt
|
|
48
|
+
*/
|
|
49
|
+
async function promptsCreate(client, request, options) {
|
|
50
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.CreatePromptRequestBody$outboundSchema.optional().parse(value), "Input validation failed");
|
|
51
|
+
if (!parsed.ok) {
|
|
52
|
+
return parsed;
|
|
53
|
+
}
|
|
54
|
+
const payload = parsed.value;
|
|
55
|
+
const body = payload === undefined
|
|
56
|
+
? null
|
|
57
|
+
: (0, encodings_js_1.encodeJSON)("body", payload, { explode: true });
|
|
58
|
+
const path = (0, url_js_1.pathToFunc)("/v2/resources/prompts")();
|
|
59
|
+
const headers = new Headers({
|
|
60
|
+
"Content-Type": "application/json",
|
|
61
|
+
Accept: "application/json",
|
|
62
|
+
});
|
|
63
|
+
const secConfig = await (0, security_js_1.extractSecurity)(client._options.apiKey);
|
|
64
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
65
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
66
|
+
const context = {
|
|
67
|
+
operationID: "CreatePrompt",
|
|
68
|
+
oAuth2Scopes: [],
|
|
69
|
+
resolvedSecurity: requestSecurity,
|
|
70
|
+
securitySource: client._options.apiKey,
|
|
71
|
+
retryConfig: (options === null || options === void 0 ? void 0 : options.retries)
|
|
72
|
+
|| client._options.retryConfig
|
|
73
|
+
|| { strategy: "none" },
|
|
74
|
+
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
75
|
+
};
|
|
76
|
+
const requestRes = client._createRequest(context, {
|
|
77
|
+
security: requestSecurity,
|
|
78
|
+
method: "POST",
|
|
79
|
+
baseURL: options === null || options === void 0 ? void 0 : options.serverURL,
|
|
80
|
+
path: path,
|
|
81
|
+
headers: headers,
|
|
82
|
+
body: body,
|
|
83
|
+
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || 600000,
|
|
84
|
+
}, options);
|
|
85
|
+
if (!requestRes.ok) {
|
|
86
|
+
return requestRes;
|
|
87
|
+
}
|
|
88
|
+
const req = requestRes.value;
|
|
89
|
+
const doResult = await client._do(req, {
|
|
90
|
+
context,
|
|
91
|
+
errorCodes: ["4XX", "5XX"],
|
|
92
|
+
retryConfig: context.retryConfig,
|
|
93
|
+
retryCodes: context.retryCodes,
|
|
94
|
+
});
|
|
95
|
+
if (!doResult.ok) {
|
|
96
|
+
return doResult;
|
|
97
|
+
}
|
|
98
|
+
const response = doResult.value;
|
|
99
|
+
const [result] = await M.match(M.json(200, operations.CreatePromptResponseBody$inboundSchema), M.fail(["4XX", "5XX"]))(response);
|
|
100
|
+
if (!result.ok) {
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=promptsCreate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptsCreate.js","sourceRoot":"","sources":["../src/funcs/promptsCreate.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBH,sCAiGC;AAtHD,sDAAiD;AACjD,sDAAwC;AACxC,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAU3C,0EAA4D;AAG5D;;GAEG;AACI,KAAK,UAAU,aAAa,CACjC,MAAe,EACf,OAAwD,EACxD,OAAwB;IAaxB,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CACR,UAAU,CAAC,sCAAsC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAC3E,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7B,MAAM,IAAI,GAAG,OAAO,KAAK,SAAS;QAChC,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,IAAA,yBAAU,EAAC,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAEnD,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,uBAAuB,CAAC,EAAE,CAAC;IAEnD,MAAM,O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AU,CAAC,EAAE,EAAE,CAAC;QACnB,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;QACrC,OAAO;QACP,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAU5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,sCAAsC,CAAC,EAC9D,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CACvB,CAAC,QAAQ,CAAC,CAAC;IACZ,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OrqCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
5
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
|
+
import * as operations from "../models/operations/index.js";
|
|
7
|
+
import { Result } from "../types/fp.js";
|
|
8
|
+
/**
|
|
9
|
+
* Create a new prompt version
|
|
10
|
+
*/
|
|
11
|
+
export declare function promptsCreateVersion(client: OrqCore, request: operations.CreatePromptVersionRequest, options?: RequestOptions): Promise<Result<operations.CreatePromptVersionResponseBody, APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
|
|
12
|
+
//# sourceMappingURL=promptsCreateVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptsCreateVersion.d.ts","sourceRoot":"","sources":["../src/funcs/promptsCreateVersion.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,UAAU,CAAC,0BAA0B,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,UAAU,CAAC,+BAA+B,EACxC,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAuFA"}
|