@deepraxis/sdk 0.1.0-dev.13103a0 → 0.1.0-dev.331f4e7

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/METHODS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SDK methods
2
2
 
3
- Generated by `bun run generate`. 368 HTTP operations, plus product aliases. Version segments and path parameters are omitted from resource names. Inputs use typed `{ path, query, body, headers }` options. Collections form nested resource objects; POST actions retain their verb. Naming rules are documented in `scripts/resources.ts`; semantic exceptions and aliases with reasons are in `scripts/naming-overrides.ts`.
3
+ Generated by `bun run generate`. 413 HTTP operations, plus product aliases. Version segments and path parameters are omitted from resource names. Inputs use typed `{ path, query, body, headers }` options. Collections form nested resource objects; POST actions retain their verb. Naming rules are documented in `scripts/resources.ts`; semantic exceptions and aliases with reasons are in `scripts/naming-overrides.ts`.
4
4
 
5
5
  `always` returns an AsyncIterable; `optional` streams with `{ stream: true }`; `yes` pagination returns a Page. Only `{ data, next_cursor }` + `cursor` query contracts are automatically paginated.
6
6
 
@@ -55,6 +55,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
55
55
 
56
56
  | Method | HTTP | Path | Streaming | Pagination |
57
57
  |---|---|---|---|---|
58
+ | apply | POST | `/agent/v1/agents/{agent_id}/versions/{version}/apply` | no | no |
58
59
  | list | GET | `/agent/v1/agents/{agent_id}/versions` | no | no |
59
60
 
60
61
  ### agent.computers
@@ -625,6 +626,20 @@ Multipart request bodies expand plain objects into bracketed fields (for example
625
626
  | retrieve | GET | `/file/v1/files/{file_id}` | no | no |
626
627
  | retrieveContent | GET | `/file/v1/files/{file_id}/content` | no | no |
627
628
 
629
+ ### file.uploads
630
+
631
+ | Method | HTTP | Path | Streaming | Pagination |
632
+ |---|---|---|---|---|
633
+ | cancel | POST | `/file/v1/uploads/{upload_id}/cancel` | no | no |
634
+ | complete | POST | `/file/v1/uploads/{upload_id}/complete` | no | no |
635
+ | create | POST | `/file/v1/uploads` | no | no |
636
+
637
+ ### file.uploads.parts
638
+
639
+ | Method | HTTP | Path | Streaming | Pagination |
640
+ |---|---|---|---|---|
641
+ | create | POST | `/file/v1/uploads/{upload_id}/parts` | no | no |
642
+
628
643
  ## knowledge
629
644
 
630
645
  ### knowledge.vectorStores
@@ -1093,6 +1108,123 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1093
1108
  |---|---|---|---|---|
1094
1109
  | create | POST | `/search/v1/search` | no | no |
1095
1110
 
1111
+ ## ticket
1112
+
1113
+ ### ticket.activity
1114
+
1115
+ | Method | HTTP | Path | Streaming | Pagination |
1116
+ |---|---|---|---|---|
1117
+ | retrieve | GET | `/ticket/v1/activity` | no | no |
1118
+
1119
+ ### ticket.comments
1120
+
1121
+ | Method | HTTP | Path | Streaming | Pagination |
1122
+ |---|---|---|---|---|
1123
+ | delete | DELETE | `/ticket/v1/comments/{id}` | no | no |
1124
+ | retrieve | GET | `/ticket/v1/comments/{id}` | no | no |
1125
+ | update | PATCH | `/ticket/v1/comments/{id}` | no | no |
1126
+
1127
+ ### ticket.comments.reactions
1128
+
1129
+ | Method | HTTP | Path | Streaming | Pagination |
1130
+ |---|---|---|---|---|
1131
+ | create | POST | `/ticket/v1/comments/{id}/reactions` | no | no |
1132
+ | delete | DELETE | `/ticket/v1/comments/{id}/reactions/{content}` | no | no |
1133
+ | list | GET | `/ticket/v1/comments/{id}/reactions` | no | no |
1134
+
1135
+ ### ticket.labels
1136
+
1137
+ | Method | HTTP | Path | Streaming | Pagination |
1138
+ |---|---|---|---|---|
1139
+ | create | POST | `/ticket/v1/labels` | no | no |
1140
+ | delete | DELETE | `/ticket/v1/labels/{name}` | no | no |
1141
+ | list | GET | `/ticket/v1/labels` | no | no |
1142
+ | update | PATCH | `/ticket/v1/labels/{name}` | no | no |
1143
+
1144
+ ### ticket.milestones
1145
+
1146
+ | Method | HTTP | Path | Streaming | Pagination |
1147
+ |---|---|---|---|---|
1148
+ | create | POST | `/ticket/v1/milestones` | no | no |
1149
+ | delete | DELETE | `/ticket/v1/milestones/{number}` | no | no |
1150
+ | list | GET | `/ticket/v1/milestones` | no | no |
1151
+ | retrieve | GET | `/ticket/v1/milestones/{number}` | no | no |
1152
+ | update | PATCH | `/ticket/v1/milestones/{number}` | no | no |
1153
+
1154
+ ### ticket.repositories
1155
+
1156
+ | Method | HTTP | Path | Streaming | Pagination |
1157
+ |---|---|---|---|---|
1158
+ | list | GET | `/ticket/v1/repositories` | no | no |
1159
+
1160
+ ### ticket.tickets
1161
+
1162
+ | Method | HTTP | Path | Streaming | Pagination |
1163
+ |---|---|---|---|---|
1164
+ | create | POST | `/ticket/v1/tickets` | no | no |
1165
+ | deleteLock | DELETE | `/ticket/v1/tickets/{number}/lock` | no | no |
1166
+ | list | GET | `/ticket/v1/tickets` | no | no |
1167
+ | retrieve | GET | `/ticket/v1/tickets/{number}` | no | no |
1168
+ | update | PATCH | `/ticket/v1/tickets/{number}` | no | no |
1169
+ | updateLock | PUT | `/ticket/v1/tickets/{number}/lock` | no | no |
1170
+
1171
+ ### ticket.tickets.comments
1172
+
1173
+ | Method | HTTP | Path | Streaming | Pagination |
1174
+ |---|---|---|---|---|
1175
+ | create | POST | `/ticket/v1/tickets/{number}/comments` | no | no |
1176
+ | list | GET | `/ticket/v1/tickets/{number}/comments` | no | no |
1177
+
1178
+ ### ticket.tickets.dependencies
1179
+
1180
+ | Method | HTTP | Path | Streaming | Pagination |
1181
+ |---|---|---|---|---|
1182
+ | retrieveBlockedBy | GET | `/ticket/v1/tickets/{number}/dependencies/blocked_by` | no | no |
1183
+ | retrieveBlocking | GET | `/ticket/v1/tickets/{number}/dependencies/blocking` | no | no |
1184
+
1185
+ ### ticket.tickets.dependencies.blockedBy
1186
+
1187
+ | Method | HTTP | Path | Streaming | Pagination |
1188
+ |---|---|---|---|---|
1189
+ | create | POST | `/ticket/v1/tickets/{number}/dependencies/blocked_by` | no | no |
1190
+ | delete | DELETE | `/ticket/v1/tickets/{number}/dependencies/blocked_by/{n}` | no | no |
1191
+
1192
+ ### ticket.tickets.events
1193
+
1194
+ | Method | HTTP | Path | Streaming | Pagination |
1195
+ |---|---|---|---|---|
1196
+ | list | GET | `/ticket/v1/tickets/{number}/events` | no | no |
1197
+
1198
+ ### ticket.tickets.reactions
1199
+
1200
+ | Method | HTTP | Path | Streaming | Pagination |
1201
+ |---|---|---|---|---|
1202
+ | create | POST | `/ticket/v1/tickets/{number}/reactions` | no | no |
1203
+ | delete | DELETE | `/ticket/v1/tickets/{number}/reactions/{content}` | no | no |
1204
+ | list | GET | `/ticket/v1/tickets/{number}/reactions` | no | no |
1205
+
1206
+ ### ticket.tickets.relations
1207
+
1208
+ | Method | HTTP | Path | Streaming | Pagination |
1209
+ |---|---|---|---|---|
1210
+ | create | POST | `/ticket/v1/tickets/{number}/relations` | no | no |
1211
+ | delete | DELETE | `/ticket/v1/tickets/{number}/relations/{n}` | no | no |
1212
+ | list | GET | `/ticket/v1/tickets/{number}/relations` | no | no |
1213
+
1214
+ ### ticket.tickets.subTickets
1215
+
1216
+ | Method | HTTP | Path | Streaming | Pagination |
1217
+ |---|---|---|---|---|
1218
+ | create | POST | `/ticket/v1/tickets/{number}/sub_tickets` | no | no |
1219
+ | delete | DELETE | `/ticket/v1/tickets/{number}/sub_tickets/{child}` | no | no |
1220
+ | list | GET | `/ticket/v1/tickets/{number}/sub_tickets` | no | no |
1221
+
1222
+ ### ticket.types
1223
+
1224
+ | Method | HTTP | Path | Streaming | Pagination |
1225
+ |---|---|---|---|---|
1226
+ | list | GET | `/ticket/v1/types` | no | no |
1227
+
1096
1228
  ## vault
1097
1229
 
1098
1230
  ### vault.authorizations
@@ -1,10 +1,18 @@
1
+ import { type UploadFileOptions, type UploadedFile } from '../helpers/file-upload.js';
1
2
  import { resourceFactories } from '../resources.generated.js';
2
3
  import { type PraxisOptions } from './transport.js';
3
4
  import { type PublishInput, type PublishResult } from '../helpers/application-publish.js';
5
+ import { type CountInput, type CountResult } from '../helpers/database-count.js';
4
6
  type Resources = {
5
7
  readonly [K in keyof typeof resourceFactories]: ReturnType<(typeof resourceFactories)[K]>;
6
8
  };
7
- export interface Praxis extends Omit<Resources, 'application'> {
9
+ export interface Praxis extends Omit<Resources, 'application' | 'database' | 'file'> {
10
+ readonly file: Resources['file'] & {
11
+ uploadFile(file: Blob | File, options: UploadFileOptions): Promise<UploadedFile>;
12
+ };
13
+ readonly database: Resources['database'] & {
14
+ count(input: CountInput): Promise<CountResult>;
15
+ };
8
16
  readonly application: Resources['application'] & {
9
17
  publish(input: PublishInput): Promise<PublishResult>;
10
18
  };
@@ -1,12 +1,18 @@
1
+ import { uploadFile } from "../helpers/file-upload.js";
1
2
  import { resourceFactories } from "../resources.generated.js";
2
3
  import { Transport } from "./transport.js";
3
4
  import { publish } from "../helpers/application-publish.js";
5
+ import { count } from "../helpers/database-count.js";
4
6
  export class Praxis {
5
7
  constructor(options) {
6
8
  const transport = new Transport(options);
7
9
  for (const [name, create] of Object.entries(resourceFactories)) {
8
10
  const resource = create(transport);
9
11
  // Assemble before sealing the resource property; never replace a readonly SDK resource.
12
+ if (name === 'file')
13
+ Object.assign(resource, { uploadFile: (file, options) => uploadFile(this, file, options) });
14
+ if (name === 'database')
15
+ Object.assign(resource, { count: (input) => count(transport, input) });
10
16
  if (name === 'application')
11
17
  Object.assign(resource, { publish: (input) => publish(this, input) });
12
18
  Object.defineProperty(this, name, { value: resource, enumerable: true });
@@ -31,6 +31,11 @@ export declare class Transport {
31
31
  private validate;
32
32
  private scope;
33
33
  request<R>(operation: Operation, options?: InternalOptions): Promise<R>;
34
+ /** Internal helper access to response metadata, with the same request policy. */
35
+ requestWithResponse<R>(operation: Operation, options?: InternalOptions): Promise<{
36
+ data: R;
37
+ response: Response;
38
+ }>;
34
39
  stream<E extends SSEEvent = SSEEvent>(operation: Operation, options?: InternalOptions): AsyncGenerator<E>;
35
40
  }
36
41
  export {};
@@ -92,9 +92,14 @@ export class Transport {
92
92
  };
93
93
  }
94
94
  async request(operation, options = {}) {
95
+ return (await this.requestWithResponse(operation, options)).data;
96
+ }
97
+ /** Internal helper access to response metadata, with the same request policy. */
98
+ async requestWithResponse(operation, options = {}) {
95
99
  const scope = this.scope(options, false);
96
100
  try {
97
- return (await abortable(operation(scope.options), scope.signal)).data;
101
+ const result = await abortable(operation(scope.options), scope.signal);
102
+ return { data: result.data, response: result.response };
98
103
  }
99
104
  finally {
100
105
  scope.close();