@orq-ai/node 3.1.0-rc.64 → 3.1.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.
Files changed (145) hide show
  1. package/docs/sdks/promptsnippets/README.md +2 -48
  2. package/jsr.json +1 -1
  3. package/lib/config.d.ts +2 -2
  4. package/lib/config.js +2 -2
  5. package/lib/config.js.map +1 -1
  6. package/models/operations/createcontact.js +2 -2
  7. package/models/operations/createpromptsnippet.js +2 -2
  8. package/models/operations/fileget.js +2 -2
  9. package/models/operations/filelist.js +2 -2
  10. package/models/operations/fileupload.js +2 -2
  11. package/models/operations/findonebykeypromptsnippet.js +2 -2
  12. package/models/operations/findonepromptsnippet.js +2 -2
  13. package/models/operations/getallpromptsnippets.js +2 -2
  14. package/models/operations/updatepromptsnippet.js +2 -2
  15. package/package.json +2 -3
  16. package/packages/orq-rc/FUNCTIONS.md +106 -0
  17. package/packages/orq-rc/README.md +559 -0
  18. package/packages/orq-rc/RUNTIMES.md +48 -0
  19. package/packages/orq-rc/docs/sdks/contacts/README.md +84 -0
  20. package/packages/orq-rc/docs/sdks/deployments/README.md +316 -0
  21. package/packages/orq-rc/docs/sdks/feedback/README.md +92 -0
  22. package/packages/orq-rc/docs/sdks/files/README.md +305 -0
  23. package/packages/orq-rc/docs/sdks/metrics/README.md +86 -0
  24. package/packages/orq-rc/docs/sdks/orq/README.md +10 -0
  25. package/packages/orq-rc/docs/sdks/prompts/README.md +608 -0
  26. package/packages/orq-rc/docs/sdks/promptsnippets/README.md +534 -0
  27. package/packages/orq-rc/docs/sdks/remoteconfig/README.md +80 -0
  28. package/packages/orq-rc/jsr.json +28 -0
  29. package/packages/orq-rc/package-lock.json +1861 -0
  30. package/packages/orq-rc/package.json +31 -0
  31. package/packages/orq-rc/src/core.ts +13 -0
  32. package/packages/orq-rc/src/funcs/contactsCreate.ts +126 -0
  33. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +134 -0
  34. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +142 -0
  35. package/packages/orq-rc/src/funcs/deploymentsList.ts +141 -0
  36. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +134 -0
  37. package/packages/orq-rc/src/funcs/deploymentsStream.ts +150 -0
  38. package/packages/orq-rc/src/funcs/feedbackCreate.ts +126 -0
  39. package/packages/orq-rc/src/funcs/filesDelete.ts +130 -0
  40. package/packages/orq-rc/src/funcs/filesGet.ts +129 -0
  41. package/packages/orq-rc/src/funcs/filesList.ts +131 -0
  42. package/packages/orq-rc/src/funcs/filesUpload.ts +149 -0
  43. package/packages/orq-rc/src/funcs/promptSnippetsCreate.ts +128 -0
  44. package/packages/orq-rc/src/funcs/promptSnippetsDelete.ts +131 -0
  45. package/packages/orq-rc/src/funcs/promptSnippetsGet.ts +130 -0
  46. package/packages/orq-rc/src/funcs/promptSnippetsGetByKey.ts +132 -0
  47. package/packages/orq-rc/src/funcs/promptSnippetsList.ts +132 -0
  48. package/packages/orq-rc/src/funcs/promptSnippetsUpdate.ts +139 -0
  49. package/packages/orq-rc/src/funcs/promptsCreate.ts +126 -0
  50. package/packages/orq-rc/src/funcs/promptsDelete.ts +130 -0
  51. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +146 -0
  52. package/packages/orq-rc/src/funcs/promptsList.ts +133 -0
  53. package/packages/orq-rc/src/funcs/promptsListVersions.ts +139 -0
  54. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +132 -0
  55. package/packages/orq-rc/src/funcs/promptsUpdate.ts +138 -0
  56. package/packages/orq-rc/src/funcs/remoteconfigGetConfig.ts +127 -0
  57. package/packages/orq-rc/src/hooks/global.ts +44 -0
  58. package/packages/orq-rc/src/hooks/hooks.ts +132 -0
  59. package/packages/orq-rc/src/hooks/index.ts +6 -0
  60. package/packages/orq-rc/src/hooks/registration.ts +15 -0
  61. package/packages/orq-rc/src/hooks/types.ts +109 -0
  62. package/packages/orq-rc/src/index.ts +7 -0
  63. package/packages/orq-rc/src/lib/base64.ts +37 -0
  64. package/packages/orq-rc/src/lib/config.ts +70 -0
  65. package/packages/orq-rc/src/lib/dlv.ts +53 -0
  66. package/packages/orq-rc/src/lib/encodings.ts +483 -0
  67. package/packages/orq-rc/src/lib/env.ts +73 -0
  68. package/packages/orq-rc/src/lib/event-streams.ts +264 -0
  69. package/packages/orq-rc/src/lib/files.ts +40 -0
  70. package/packages/orq-rc/src/lib/http.ts +323 -0
  71. package/packages/orq-rc/src/lib/is-plain-object.ts +43 -0
  72. package/packages/orq-rc/src/lib/logger.ts +9 -0
  73. package/packages/orq-rc/src/lib/matchers.ts +325 -0
  74. package/packages/orq-rc/src/lib/primitives.ts +136 -0
  75. package/packages/orq-rc/src/lib/retries.ts +218 -0
  76. package/packages/orq-rc/src/lib/schemas.ts +91 -0
  77. package/packages/orq-rc/src/lib/sdks.ts +400 -0
  78. package/packages/orq-rc/src/lib/security.ts +254 -0
  79. package/packages/orq-rc/src/lib/url.ts +33 -0
  80. package/packages/orq-rc/src/models/components/deployments.ts +1666 -0
  81. package/packages/orq-rc/src/models/components/index.ts +6 -0
  82. package/packages/orq-rc/src/models/components/security.ts +71 -0
  83. package/packages/orq-rc/src/models/errors/apierror.ts +27 -0
  84. package/packages/orq-rc/src/models/errors/getpromptversion.ts +71 -0
  85. package/packages/orq-rc/src/models/errors/honoapierror.ts +82 -0
  86. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +62 -0
  87. package/packages/orq-rc/src/models/errors/index.ts +11 -0
  88. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +97 -0
  89. package/packages/orq-rc/src/models/errors/updateprompt.ts +71 -0
  90. package/packages/orq-rc/src/models/errors/updatepromptsnippet.ts +71 -0
  91. package/packages/orq-rc/src/models/operations/createcontact.ts +256 -0
  92. package/packages/orq-rc/src/models/operations/createfeedback.ts +286 -0
  93. package/packages/orq-rc/src/models/operations/createprompt.ts +3819 -0
  94. package/packages/orq-rc/src/models/operations/createpromptsnippet.ts +6239 -0
  95. package/packages/orq-rc/src/models/operations/deleteprompt.ts +69 -0
  96. package/packages/orq-rc/src/models/operations/deletepromptsnippet.ts +69 -0
  97. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +1790 -0
  98. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +3527 -0
  99. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +1144 -0
  100. package/packages/orq-rc/src/models/operations/deployments.ts +2148 -0
  101. package/packages/orq-rc/src/models/operations/deploymentstream.ts +3062 -0
  102. package/packages/orq-rc/src/models/operations/filedelete.ts +78 -0
  103. package/packages/orq-rc/src/models/operations/fileget.ts +222 -0
  104. package/packages/orq-rc/src/models/operations/filelist.ts +321 -0
  105. package/packages/orq-rc/src/models/operations/fileupload.ts +322 -0
  106. package/packages/orq-rc/src/models/operations/findonebykeypromptsnippet.ts +4483 -0
  107. package/packages/orq-rc/src/models/operations/findonepromptsnippet.ts +4343 -0
  108. package/packages/orq-rc/src/models/operations/getallprompts.ts +2116 -0
  109. package/packages/orq-rc/src/models/operations/getallpromptsnippets.ts +4472 -0
  110. package/packages/orq-rc/src/models/operations/getoneprompt.ts +1982 -0
  111. package/packages/orq-rc/src/models/operations/getpromptversion.ts +2012 -0
  112. package/packages/orq-rc/src/models/operations/index.ts +29 -0
  113. package/packages/orq-rc/src/models/operations/listpromptversions.ts +2146 -0
  114. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +190 -0
  115. package/packages/orq-rc/src/models/operations/updateprompt.ts +3917 -0
  116. package/packages/orq-rc/src/models/operations/updatepromptsnippet.ts +6544 -0
  117. package/packages/orq-rc/src/sdk/contacts.ts +27 -0
  118. package/packages/orq-rc/src/sdk/deployments.ts +89 -0
  119. package/packages/orq-rc/src/sdk/feedback.ts +27 -0
  120. package/packages/orq-rc/src/sdk/files.ts +72 -0
  121. package/packages/orq-rc/src/sdk/index.ts +5 -0
  122. package/packages/orq-rc/src/sdk/metrics.ts +27 -0
  123. package/packages/orq-rc/src/sdk/prompts.ts +126 -0
  124. package/packages/orq-rc/src/sdk/promptsnippets.ts +99 -0
  125. package/packages/orq-rc/src/sdk/remoteconfig.ts +24 -0
  126. package/packages/orq-rc/src/sdk/sdk.ts +49 -0
  127. package/packages/orq-rc/src/types/blobs.ts +31 -0
  128. package/packages/orq-rc/src/types/constdatetime.ts +15 -0
  129. package/packages/orq-rc/src/types/enums.ts +16 -0
  130. package/packages/orq-rc/src/types/fp.ts +50 -0
  131. package/packages/orq-rc/src/types/index.ts +11 -0
  132. package/packages/orq-rc/src/types/operations.ts +105 -0
  133. package/packages/orq-rc/src/types/rfcdate.ts +54 -0
  134. package/packages/orq-rc/src/types/streams.ts +21 -0
  135. package/packages/orq-rc/tsconfig.json +41 -0
  136. package/src/lib/config.ts +2 -2
  137. package/src/models/operations/createcontact.ts +2 -2
  138. package/src/models/operations/createpromptsnippet.ts +2 -2
  139. package/src/models/operations/fileget.ts +2 -2
  140. package/src/models/operations/filelist.ts +2 -2
  141. package/src/models/operations/fileupload.ts +2 -2
  142. package/src/models/operations/findonebykeypromptsnippet.ts +2 -2
  143. package/src/models/operations/findonepromptsnippet.ts +2 -2
  144. package/src/models/operations/getallpromptsnippets.ts +2 -2
  145. package/src/models/operations/updatepromptsnippet.ts +2 -2
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { contactsCreate } from "../funcs/contactsCreate.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as operations from "../models/operations/index.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+
10
+ export class Contacts extends ClientSDK {
11
+ /**
12
+ * Update user information
13
+ *
14
+ * @remarks
15
+ * Update or add user information to workspace
16
+ */
17
+ async create(
18
+ request: operations.CreateContactRequestBody,
19
+ options?: RequestOptions,
20
+ ): Promise<operations.CreateContactResponseBody> {
21
+ return unwrapAsync(contactsCreate(
22
+ this,
23
+ request,
24
+ options,
25
+ ));
26
+ }
27
+ }
@@ -0,0 +1,89 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { deploymentsGetConfig } from "../funcs/deploymentsGetConfig.js";
6
+ import { deploymentsInvoke } from "../funcs/deploymentsInvoke.js";
7
+ import { deploymentsList } from "../funcs/deploymentsList.js";
8
+ import { deploymentsStream } from "../funcs/deploymentsStream.js";
9
+ import { EventStream } from "../lib/event-streams.js";
10
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
11
+ import * as components from "../models/components/index.js";
12
+ import * as operations from "../models/operations/index.js";
13
+ import { unwrapAsync } from "../types/fp.js";
14
+ import { Metrics } from "./metrics.js";
15
+
16
+ export class Deployments extends ClientSDK {
17
+ private _metrics?: Metrics;
18
+ get metrics(): Metrics {
19
+ return (this._metrics ??= new Metrics(this._options));
20
+ }
21
+
22
+ /**
23
+ * List all deployments
24
+ *
25
+ * @remarks
26
+ * Returns a list of your deployments. The deployments are returned sorted by creation date, with the most recent deployments appearing first.
27
+ */
28
+ async list(
29
+ request?: operations.DeploymentsRequest | undefined,
30
+ options?: RequestOptions,
31
+ ): Promise<operations.DeploymentsResponseBody> {
32
+ return unwrapAsync(deploymentsList(
33
+ this,
34
+ request,
35
+ options,
36
+ ));
37
+ }
38
+
39
+ /**
40
+ * Get config
41
+ *
42
+ * @remarks
43
+ * Retrieve the deployment configuration
44
+ */
45
+ async getConfig(
46
+ request: operations.DeploymentGetConfigRequestBody,
47
+ options?: RequestOptions,
48
+ ): Promise<operations.DeploymentGetConfigResponseBody | undefined> {
49
+ return unwrapAsync(deploymentsGetConfig(
50
+ this,
51
+ request,
52
+ options,
53
+ ));
54
+ }
55
+
56
+ /**
57
+ * Invoke
58
+ *
59
+ * @remarks
60
+ * Invoke a deployment with a given payload
61
+ */
62
+ async invoke(
63
+ request: components.Deployments,
64
+ options?: RequestOptions,
65
+ ): Promise<operations.DeploymentInvokeResponseBody | undefined> {
66
+ return unwrapAsync(deploymentsInvoke(
67
+ this,
68
+ request,
69
+ options,
70
+ ));
71
+ }
72
+
73
+ /**
74
+ * Stream
75
+ *
76
+ * @remarks
77
+ * Stream deployment generation. Only supported for completions and chat completions.
78
+ */
79
+ async stream(
80
+ request: operations.DeploymentStreamRequestBody,
81
+ options?: RequestOptions,
82
+ ): Promise<EventStream<operations.DeploymentStreamResponseBody>> {
83
+ return unwrapAsync(deploymentsStream(
84
+ this,
85
+ request,
86
+ options,
87
+ ));
88
+ }
89
+ }
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { feedbackCreate } from "../funcs/feedbackCreate.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as operations from "../models/operations/index.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+
10
+ export class Feedback extends ClientSDK {
11
+ /**
12
+ * Submit feedback
13
+ *
14
+ * @remarks
15
+ * Submit feedback for the LLM transaction via the API
16
+ */
17
+ async create(
18
+ request: operations.CreateFeedbackRequestBody,
19
+ options?: RequestOptions,
20
+ ): Promise<operations.CreateFeedbackResponseBody> {
21
+ return unwrapAsync(feedbackCreate(
22
+ this,
23
+ request,
24
+ options,
25
+ ));
26
+ }
27
+ }
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { filesDelete } from "../funcs/filesDelete.js";
6
+ import { filesGet } from "../funcs/filesGet.js";
7
+ import { filesList } from "../funcs/filesList.js";
8
+ import { filesUpload } from "../funcs/filesUpload.js";
9
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
10
+ import * as operations from "../models/operations/index.js";
11
+ import { unwrapAsync } from "../types/fp.js";
12
+
13
+ export class Files extends ClientSDK {
14
+ /**
15
+ * Upload file
16
+ *
17
+ * @remarks
18
+ * Files are used to upload documents that can be used with features like [Deployments](https://docs.orq.ai/reference/post_v2-deployments-get-config).
19
+ */
20
+ async upload(
21
+ request?: operations.FileUploadRequestBody | undefined,
22
+ options?: RequestOptions,
23
+ ): Promise<operations.FileUploadResponseBody> {
24
+ return unwrapAsync(filesUpload(
25
+ this,
26
+ request,
27
+ options,
28
+ ));
29
+ }
30
+
31
+ /**
32
+ * List all files
33
+ */
34
+ async list(
35
+ request?: operations.FileListRequest | undefined,
36
+ options?: RequestOptions,
37
+ ): Promise<operations.FileListResponseBody> {
38
+ return unwrapAsync(filesList(
39
+ this,
40
+ request,
41
+ options,
42
+ ));
43
+ }
44
+
45
+ /**
46
+ * Get file by ID
47
+ */
48
+ async get(
49
+ request: operations.FileGetRequest,
50
+ options?: RequestOptions,
51
+ ): Promise<operations.FileGetResponseBody> {
52
+ return unwrapAsync(filesGet(
53
+ this,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ /**
60
+ * Delete file
61
+ */
62
+ async delete(
63
+ request: operations.FileDeleteRequest,
64
+ options?: RequestOptions,
65
+ ): Promise<void> {
66
+ return unwrapAsync(filesDelete(
67
+ this,
68
+ request,
69
+ options,
70
+ ));
71
+ }
72
+ }
@@ -0,0 +1,5 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ export * from "./sdk.js";
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { deploymentsMetricsCreate } from "../funcs/deploymentsMetricsCreate.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as operations from "../models/operations/index.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+
10
+ export class Metrics extends ClientSDK {
11
+ /**
12
+ * Add metrics
13
+ *
14
+ * @remarks
15
+ * Add metrics to a deployment
16
+ */
17
+ async create(
18
+ request: operations.DeploymentCreateMetricRequest,
19
+ options?: RequestOptions,
20
+ ): Promise<operations.DeploymentCreateMetricResponseBody> {
21
+ return unwrapAsync(deploymentsMetricsCreate(
22
+ this,
23
+ request,
24
+ options,
25
+ ));
26
+ }
27
+ }
@@ -0,0 +1,126 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { promptsCreate } from "../funcs/promptsCreate.js";
6
+ import { promptsDelete } from "../funcs/promptsDelete.js";
7
+ import { promptsGetVersion } from "../funcs/promptsGetVersion.js";
8
+ import { promptsList } from "../funcs/promptsList.js";
9
+ import { promptsListVersions } from "../funcs/promptsListVersions.js";
10
+ import { promptsRetrieve } from "../funcs/promptsRetrieve.js";
11
+ import { promptsUpdate } from "../funcs/promptsUpdate.js";
12
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
13
+ import * as operations from "../models/operations/index.js";
14
+ import { unwrapAsync } from "../types/fp.js";
15
+
16
+ export class Prompts extends ClientSDK {
17
+ /**
18
+ * List all prompts
19
+ *
20
+ * @remarks
21
+ * Returns a list of your prompts. The prompts are returned sorted by creation date, with the most recent prompts appearing first
22
+ */
23
+ async list(
24
+ request?: operations.GetAllPromptsRequest | undefined,
25
+ options?: RequestOptions,
26
+ ): Promise<operations.GetAllPromptsResponseBody> {
27
+ return unwrapAsync(promptsList(
28
+ this,
29
+ request,
30
+ options,
31
+ ));
32
+ }
33
+
34
+ /**
35
+ * Create a prompt
36
+ */
37
+ async create(
38
+ request?: operations.CreatePromptRequestBody | undefined,
39
+ options?: RequestOptions,
40
+ ): Promise<operations.CreatePromptResponseBody> {
41
+ return unwrapAsync(promptsCreate(
42
+ this,
43
+ request,
44
+ options,
45
+ ));
46
+ }
47
+
48
+ /**
49
+ * Retrieve a prompt
50
+ *
51
+ * @remarks
52
+ * Retrieves a prompt object
53
+ */
54
+ async retrieve(
55
+ request: operations.GetOnePromptRequest,
56
+ options?: RequestOptions,
57
+ ): Promise<operations.GetOnePromptResponseBody> {
58
+ return unwrapAsync(promptsRetrieve(
59
+ this,
60
+ request,
61
+ options,
62
+ ));
63
+ }
64
+
65
+ /**
66
+ * Update a prompt
67
+ */
68
+ async update(
69
+ request: operations.UpdatePromptRequest,
70
+ options?: RequestOptions,
71
+ ): Promise<operations.UpdatePromptResponseBody> {
72
+ return unwrapAsync(promptsUpdate(
73
+ this,
74
+ request,
75
+ options,
76
+ ));
77
+ }
78
+
79
+ /**
80
+ * Delete a prompt
81
+ */
82
+ async delete(
83
+ request: operations.DeletePromptRequest,
84
+ options?: RequestOptions,
85
+ ): Promise<void> {
86
+ return unwrapAsync(promptsDelete(
87
+ this,
88
+ request,
89
+ options,
90
+ ));
91
+ }
92
+
93
+ /**
94
+ * List all prompt versions
95
+ *
96
+ * @remarks
97
+ * Returns a list of your prompt versions. The prompt versions are returned sorted by creation date, with the most recent prompt versions appearing first
98
+ */
99
+ async listVersions(
100
+ request: operations.ListPromptVersionsRequest,
101
+ options?: RequestOptions,
102
+ ): Promise<operations.ListPromptVersionsResponseBody> {
103
+ return unwrapAsync(promptsListVersions(
104
+ this,
105
+ request,
106
+ options,
107
+ ));
108
+ }
109
+
110
+ /**
111
+ * Retrieve a prompt version
112
+ *
113
+ * @remarks
114
+ * Retrieves a specific version of a prompt by its ID and version ID.
115
+ */
116
+ async getVersion(
117
+ request: operations.GetPromptVersionRequest,
118
+ options?: RequestOptions,
119
+ ): Promise<operations.GetPromptVersionResponseBody> {
120
+ return unwrapAsync(promptsGetVersion(
121
+ this,
122
+ request,
123
+ options,
124
+ ));
125
+ }
126
+ }
@@ -0,0 +1,99 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { promptSnippetsCreate } from "../funcs/promptSnippetsCreate.js";
6
+ import { promptSnippetsDelete } from "../funcs/promptSnippetsDelete.js";
7
+ import { promptSnippetsGet } from "../funcs/promptSnippetsGet.js";
8
+ import { promptSnippetsGetByKey } from "../funcs/promptSnippetsGetByKey.js";
9
+ import { promptSnippetsList } from "../funcs/promptSnippetsList.js";
10
+ import { promptSnippetsUpdate } from "../funcs/promptSnippetsUpdate.js";
11
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
12
+ import * as operations from "../models/operations/index.js";
13
+ import { unwrapAsync } from "../types/fp.js";
14
+
15
+ export class PromptSnippets extends ClientSDK {
16
+ /**
17
+ * List all prompts snippets
18
+ */
19
+ async list(
20
+ request?: operations.GetAllPromptSnippetsRequest | undefined,
21
+ options?: RequestOptions,
22
+ ): Promise<operations.GetAllPromptSnippetsResponseBody> {
23
+ return unwrapAsync(promptSnippetsList(
24
+ this,
25
+ request,
26
+ options,
27
+ ));
28
+ }
29
+
30
+ /**
31
+ * Create a prompt snippet
32
+ */
33
+ async create(
34
+ request?: operations.CreatePromptSnippetRequestBody | undefined,
35
+ options?: RequestOptions,
36
+ ): Promise<operations.CreatePromptSnippetResponseBody> {
37
+ return unwrapAsync(promptSnippetsCreate(
38
+ this,
39
+ request,
40
+ options,
41
+ ));
42
+ }
43
+
44
+ /**
45
+ * Update a prompt snippet
46
+ */
47
+ async update(
48
+ request: operations.UpdatePromptSnippetRequest,
49
+ options?: RequestOptions,
50
+ ): Promise<operations.UpdatePromptSnippetResponseBody> {
51
+ return unwrapAsync(promptSnippetsUpdate(
52
+ this,
53
+ request,
54
+ options,
55
+ ));
56
+ }
57
+
58
+ /**
59
+ * Delete a prompt snippet
60
+ */
61
+ async delete(
62
+ request: operations.DeletePromptSnippetRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<void> {
65
+ return unwrapAsync(promptSnippetsDelete(
66
+ this,
67
+ request,
68
+ options,
69
+ ));
70
+ }
71
+
72
+ /**
73
+ * Retrieve a prompt snippet
74
+ */
75
+ async get(
76
+ request: operations.FindOnePromptSnippetRequest,
77
+ options?: RequestOptions,
78
+ ): Promise<operations.FindOnePromptSnippetResponseBody> {
79
+ return unwrapAsync(promptSnippetsGet(
80
+ this,
81
+ request,
82
+ options,
83
+ ));
84
+ }
85
+
86
+ /**
87
+ * Retrieve a prompt snippet by key
88
+ */
89
+ async getByKey(
90
+ request: operations.FindOneByKeyPromptSnippetRequest,
91
+ options?: RequestOptions,
92
+ ): Promise<operations.FindOneByKeyPromptSnippetResponseBody> {
93
+ return unwrapAsync(promptSnippetsGetByKey(
94
+ this,
95
+ request,
96
+ options,
97
+ ));
98
+ }
99
+ }
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { remoteconfigGetConfig } from "../funcs/remoteconfigGetConfig.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as operations from "../models/operations/index.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+
10
+ export class Remoteconfig extends ClientSDK {
11
+ /**
12
+ * Get Configurations
13
+ */
14
+ async getConfig(
15
+ request?: operations.RemoteConfigsGetConfigRequestBody | undefined,
16
+ options?: RequestOptions,
17
+ ): Promise<operations.RemoteConfigsGetConfigResponseBody> {
18
+ return unwrapAsync(remoteconfigGetConfig(
19
+ this,
20
+ request,
21
+ options,
22
+ ));
23
+ }
24
+ }
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { ClientSDK } from "../lib/sdks.js";
6
+ import { Contacts } from "./contacts.js";
7
+ import { Deployments } from "./deployments.js";
8
+ import { Feedback } from "./feedback.js";
9
+ import { Files } from "./files.js";
10
+ import { Prompts } from "./prompts.js";
11
+ import { PromptSnippets } from "./promptsnippets.js";
12
+ import { Remoteconfig } from "./remoteconfig.js";
13
+
14
+ export class Orq extends ClientSDK {
15
+ private _contacts?: Contacts;
16
+ get contacts(): Contacts {
17
+ return (this._contacts ??= new Contacts(this._options));
18
+ }
19
+
20
+ private _feedback?: Feedback;
21
+ get feedback(): Feedback {
22
+ return (this._feedback ??= new Feedback(this._options));
23
+ }
24
+
25
+ private _deployments?: Deployments;
26
+ get deployments(): Deployments {
27
+ return (this._deployments ??= new Deployments(this._options));
28
+ }
29
+
30
+ private _files?: Files;
31
+ get files(): Files {
32
+ return (this._files ??= new Files(this._options));
33
+ }
34
+
35
+ private _promptSnippets?: PromptSnippets;
36
+ get promptSnippets(): PromptSnippets {
37
+ return (this._promptSnippets ??= new PromptSnippets(this._options));
38
+ }
39
+
40
+ private _prompts?: Prompts;
41
+ get prompts(): Prompts {
42
+ return (this._prompts ??= new Prompts(this._options));
43
+ }
44
+
45
+ private _remoteconfig?: Remoteconfig;
46
+ get remoteconfig(): Remoteconfig {
47
+ return (this._remoteconfig ??= new Remoteconfig(this._options));
48
+ }
49
+ }
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ export const blobLikeSchema: z.ZodType<Blob, z.ZodTypeDef, Blob> =
8
+ z.custom<Blob>(isBlobLike, {
9
+ message: "expected a Blob, File or Blob-like object",
10
+ fatal: true,
11
+ });
12
+
13
+ export function isBlobLike(val: unknown): val is Blob {
14
+ if (val instanceof Blob) {
15
+ return true;
16
+ }
17
+
18
+ if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
19
+ return false;
20
+ }
21
+
22
+ const name = val[Symbol.toStringTag];
23
+ if (typeof name !== "string") {
24
+ return false;
25
+ }
26
+ if (name !== "Blob" && name !== "File") {
27
+ return false;
28
+ }
29
+
30
+ return "stream" in val && typeof val.stream === "function";
31
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ export function constDateTime(
8
+ val: string,
9
+ ): z.ZodType<string, z.ZodTypeDef, unknown> {
10
+ return z.custom<string>((v) => {
11
+ return (
12
+ typeof v === "string" && new Date(v).getTime() === new Date(val).getTime()
13
+ );
14
+ }, `Value must be equivelant to ${val}`);
15
+ }
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ declare const __brand: unique symbol;
6
+ export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
7
+
8
+ export function catchUnrecognizedEnum<T>(value: T): Unrecognized<T> {
9
+ return value as Unrecognized<T>;
10
+ }
11
+
12
+ type Prettify<T> = { [K in keyof T]: T[K] } & {};
13
+ export type ClosedEnum<T> = T[keyof T];
14
+ export type OpenEnum<T> =
15
+ | Prettify<T[keyof T]>
16
+ | Unrecognized<T[keyof T] extends number ? number : string>;
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ /**
6
+ * A monad that captures the result of a function call or an error if it was not
7
+ * successful. Railway programming, enabled by this type, can be a nicer
8
+ * alternative to traditional exception throwing because it allows functions to
9
+ * declare all _known_ errors with static types and then check for them
10
+ * exhaustively in application code. Thrown exception have a type of `unknown`
11
+ * and break out of regular control flow of programs making them harder to
12
+ * inspect and more verbose work with due to try-catch blocks.
13
+ */
14
+ export type Result<T, E = unknown> =
15
+ | { ok: true; value: T; error?: never }
16
+ | { ok: false; value?: never; error: E };
17
+
18
+ export function OK<V>(value: V): Result<V, never> {
19
+ return { ok: true, value };
20
+ }
21
+
22
+ export function ERR<E>(error: E): Result<never, E> {
23
+ return { ok: false, error };
24
+ }
25
+
26
+ /**
27
+ * unwrap is a convenience function for extracting a value from a result or
28
+ * throwing if there was an error.
29
+ */
30
+ export function unwrap<T>(r: Result<T, unknown>): T {
31
+ if (!r.ok) {
32
+ throw r.error;
33
+ }
34
+ return r.value;
35
+ }
36
+
37
+ /**
38
+ * unwrapAsync is a convenience function for resolving a value from a Promise
39
+ * of a result or rejecting if an error occurred.
40
+ */
41
+ export async function unwrapAsync<T>(
42
+ pr: Promise<Result<T, unknown>>,
43
+ ): Promise<T> {
44
+ const r = await pr;
45
+ if (!r.ok) {
46
+ throw r.error;
47
+ }
48
+
49
+ return r.value;
50
+ }
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ export { blobLikeSchema, isBlobLike } from "./blobs.js";
6
+ export { catchUnrecognizedEnum } from "./enums.js";
7
+ export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js";
8
+ export type { Result } from "./fp.js";
9
+ export type { PageIterator, Paginator } from "./operations.js";
10
+ export { createPageIterator } from "./operations.js";
11
+ export { RFCDate } from "./rfcdate.js";