@deepraxis/sdk 0.1.1-dev.fb97f26 → 0.1.1-dev.fc4f4d7

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`. 888 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`. 939 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
 
@@ -969,12 +969,28 @@ Multipart request bodies expand plain objects into bracketed fields (for example
969
969
  | retrieve | GET | `/database/v1/databases/{database_id}` | no | no |
970
970
  | update | PATCH | `/database/v1/databases/{database_id}` | no | no |
971
971
 
972
+ ### database.databases.commands
973
+
974
+ | Method | HTTP | Path | Streaming | Pagination |
975
+ |---|---|---|---|---|
976
+ | execute | POST | `/database/v1/databases/{database_id}/commands` | no | no |
977
+
972
978
  ### database.databases.events
973
979
 
974
980
  | Method | HTTP | Path | Streaming | Pagination |
975
981
  |---|---|---|---|---|
976
982
  | list | GET | `/database/v1/databases/{database_id}/events` | no | no |
977
983
 
984
+ ### database.databases.keys
985
+
986
+ | Method | HTTP | Path | Streaming | Pagination |
987
+ |---|---|---|---|---|
988
+ | delete | DELETE | `/database/v1/databases/{database_id}/keys/{key}` | no | no |
989
+ | list | GET | `/database/v1/databases/{database_id}/keys` | no | yes |
990
+ | retrieve | GET | `/database/v1/databases/{database_id}/keys/{key}` | no | no |
991
+ | set | PUT | `/database/v1/databases/{database_id}/keys/{key}` | no | no |
992
+ | update | PATCH | `/database/v1/databases/{database_id}/keys/{key}` | no | no |
993
+
978
994
  ### database.databases.purge
979
995
 
980
996
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1009,6 +1025,96 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1009
1025
  | delete | DELETE | `/database/v1/databases/{database_id}/tables/{table}/fields/{field}` | no | no |
1010
1026
  | update | PATCH | `/database/v1/databases/{database_id}/tables/{table}/fields/{field}` | no | no |
1011
1027
 
1028
+ ### database.kv
1029
+
1030
+ | Method | HTTP | Path | Streaming | Pagination |
1031
+ |---|---|---|---|---|
1032
+ | create | POST | `/database/v1/kv` | no | no |
1033
+ | delete | DELETE | `/database/v1/kv/{database_id}` | no | no |
1034
+ | list | GET | `/database/v1/kv` | no | yes |
1035
+ | restore | POST | `/database/v1/kv/{database_id}/restore` | no | no |
1036
+ | retrieve | GET | `/database/v1/kv/{database_id}` | no | no |
1037
+ | update | PATCH | `/database/v1/kv/{database_id}` | no | no |
1038
+
1039
+ ### database.kv.commands
1040
+
1041
+ | Method | HTTP | Path | Streaming | Pagination |
1042
+ |---|---|---|---|---|
1043
+ | execute | POST | `/database/v1/kv/{database_id}/commands` | no | no |
1044
+
1045
+ ### database.kv.events
1046
+
1047
+ | Method | HTTP | Path | Streaming | Pagination |
1048
+ |---|---|---|---|---|
1049
+ | list | GET | `/database/v1/kv/{database_id}/events` | no | no |
1050
+
1051
+ ### database.kv.keys
1052
+
1053
+ | Method | HTTP | Path | Streaming | Pagination |
1054
+ |---|---|---|---|---|
1055
+ | delete | DELETE | `/database/v1/kv/{database_id}/keys/{key}` | no | no |
1056
+ | list | GET | `/database/v1/kv/{database_id}/keys` | no | yes |
1057
+ | retrieve | GET | `/database/v1/kv/{database_id}/keys/{key}` | no | no |
1058
+ | set | PUT | `/database/v1/kv/{database_id}/keys/{key}` | no | no |
1059
+ | update | PATCH | `/database/v1/kv/{database_id}/keys/{key}` | no | no |
1060
+
1061
+ ### database.kv.purge
1062
+
1063
+ | Method | HTTP | Path | Streaming | Pagination |
1064
+ |---|---|---|---|---|
1065
+ | create | POST | `/database/v1/kv/{database_id}/purge` | no | no |
1066
+
1067
+ ### database.table
1068
+
1069
+ | Method | HTTP | Path | Streaming | Pagination |
1070
+ |---|---|---|---|---|
1071
+ | create | POST | `/database/v1/table` | no | no |
1072
+ | delete | DELETE | `/database/v1/table/{database_id}` | no | no |
1073
+ | list | GET | `/database/v1/table` | no | yes |
1074
+ | restore | POST | `/database/v1/table/{database_id}/restore` | no | no |
1075
+ | retrieve | GET | `/database/v1/table/{database_id}` | no | no |
1076
+ | update | PATCH | `/database/v1/table/{database_id}` | no | no |
1077
+
1078
+ ### database.table.events
1079
+
1080
+ | Method | HTTP | Path | Streaming | Pagination |
1081
+ |---|---|---|---|---|
1082
+ | list | GET | `/database/v1/table/{database_id}/events` | no | no |
1083
+
1084
+ ### database.table.purge
1085
+
1086
+ | Method | HTTP | Path | Streaming | Pagination |
1087
+ |---|---|---|---|---|
1088
+ | create | POST | `/database/v1/table/{database_id}/purge` | no | no |
1089
+
1090
+ ### database.table.rest
1091
+
1092
+ | Method | HTTP | Path | Streaming | Pagination |
1093
+ |---|---|---|---|---|
1094
+ | create | POST | `/database/v1/table/{database_id}/rest/{table}` | no | no |
1095
+ | delete | DELETE | `/database/v1/table/{database_id}/rest/{table}` | no | no |
1096
+ | head | HEAD | `/database/v1/table/{database_id}/rest/{table}` | no | no |
1097
+ | retrieve | GET | `/database/v1/table/{database_id}/rest/{table}` | no | no |
1098
+ | update | PATCH | `/database/v1/table/{database_id}/rest/{table}` | no | no |
1099
+
1100
+ ### database.table.tables
1101
+
1102
+ | Method | HTTP | Path | Streaming | Pagination |
1103
+ |---|---|---|---|---|
1104
+ | create | POST | `/database/v1/table/{database_id}/tables` | no | no |
1105
+ | delete | DELETE | `/database/v1/table/{database_id}/tables/{table}` | no | no |
1106
+ | list | GET | `/database/v1/table/{database_id}/tables` | no | no |
1107
+ | retrieve | GET | `/database/v1/table/{database_id}/tables/{table}` | no | no |
1108
+ | update | PATCH | `/database/v1/table/{database_id}/tables/{table}` | no | no |
1109
+
1110
+ ### database.table.tables.fields
1111
+
1112
+ | Method | HTTP | Path | Streaming | Pagination |
1113
+ |---|---|---|---|---|
1114
+ | create | POST | `/database/v1/table/{database_id}/tables/{table}/fields` | no | no |
1115
+ | delete | DELETE | `/database/v1/table/{database_id}/tables/{table}/fields/{field}` | no | no |
1116
+ | update | PATCH | `/database/v1/table/{database_id}/tables/{table}/fields/{field}` | no | no |
1117
+
1012
1118
  ## devops
1013
1119
 
1014
1120
  ### devops.changes
@@ -1893,6 +1999,41 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1893
1999
  |---|---|---|---|---|
1894
2000
  | list | GET | `/organization/v1/members` | no | no |
1895
2001
 
2002
+ ### organization.notifications
2003
+
2004
+ | Method | HTTP | Path | Streaming | Pagination |
2005
+ |---|---|---|---|---|
2006
+ | retrieveInbox | GET | `/organization/v1/notifications/inbox` | no | no |
2007
+ | retrieveOrganizationDefault | GET | `/organization/v1/notifications/organization_default` | no | no |
2008
+
2009
+ ### organization.notifications.deliveries
2010
+
2011
+ | Method | HTTP | Path | Streaming | Pagination |
2012
+ |---|---|---|---|---|
2013
+ | list | GET | `/organization/v1/notifications/deliveries` | no | no |
2014
+
2015
+ ### organization.notifications.letters
2016
+
2017
+ | Method | HTTP | Path | Streaming | Pagination |
2018
+ |---|---|---|---|---|
2019
+ | archive | POST | `/organization/v1/notifications/letters/{id}:archive` | no | no |
2020
+ | list | GET | `/organization/v1/notifications/letters` | no | no |
2021
+ | read | POST | `/organization/v1/notifications/letters/{id}:read` | no | no |
2022
+ | readAll | POST | `/organization/v1/notifications/letters:readAll` | no | no |
2023
+
2024
+ ### organization.notifications.organizationDefault
2025
+
2026
+ | Method | HTTP | Path | Streaming | Pagination |
2027
+ |---|---|---|---|---|
2028
+ | create | POST | `/organization/v1/notifications/organization_default` | no | no |
2029
+
2030
+ ### organization.notifications.preferences
2031
+
2032
+ | Method | HTTP | Path | Streaming | Pagination |
2033
+ |---|---|---|---|---|
2034
+ | create | POST | `/organization/v1/notifications/preferences` | no | no |
2035
+ | list | GET | `/organization/v1/notifications/preferences` | no | no |
2036
+
1896
2037
  ### organization.usage
1897
2038
 
1898
2039
  | Method | HTTP | Path | Streaming | Pagination |
@@ -2833,7 +2974,14 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2833
2974
  | customer.customers.revokeTokens | Revoking every token of one customer is an act on the customer (services/customer's customer.customers.revokeTokens); the path alone would derive customer.customers.revoke_tokens.create. |
2834
2975
  | customer.customers.unblock | unblock lifts the same block fact on the customer (services/customer's customer.customers.unblock); the path alone would derive customer.customers.unblock.create. |
2835
2976
  | customer.usage.retrieve | One customer's usage is the usage read (services/customer's customer.usage.get); usage is a projection of the customer read into billing, not a sub-resource of the customer. |
2977
+ | database.databases.commands.execute | POST runs one Redis command and creates nothing; execute names the action, where the collection rule would derive commands.create. |
2978
+ | database.databases.keys.update | PATCH changes one field (ttl_ms) of an existing key; update matches tables.update and fields.update in the same domain, and the path-derived name collides with PUT. |
2979
+ | database.databases.keys.set | PUT writes a whole key value (Redis SET semantics); use the assignment vocabulary set, as dist-tags and vaults do, so update stays the PATCH that changes the TTL. |
2836
2980
  | database.databases.rest.create | The final parameter identifies a table collection; POST inserts rows rather than updating the table. |
2981
+ | database.kv.commands.execute | POST runs one Redis command and creates nothing; execute names the action, where the collection rule would derive commands.create. |
2982
+ | database.kv.keys.update | PATCH changes one field (ttl_ms) of an existing key; update matches tables.update and fields.update in the same domain, and the path-derived name collides with PUT. |
2983
+ | database.kv.keys.set | PUT writes a whole key value (Redis SET semantics); use the assignment vocabulary set, as dist-tags and vaults do, so update stays the PATCH that changes the TTL. |
2984
+ | database.table.rest.create | The final parameter identifies a table collection; POST inserts rows rather than updating the table. |
2837
2985
  | devops.projects.flags.reportCodeRefs | ADR-125 §4 / #1881: a checkout reports where code names each flag key, so the write is an operation on the project's flags (devops.flags.reportCodeRefs) and returns counts, not a code-refs resource; the path alone would derive a nested codeRefs collection create. |
2838
2986
  | file.uploads.createSigned | Signed upload creation returns a one-time local PUT URL; ADR-039 names this operation uploads.createSigned. |
2839
2987
  | media.libraries.retrieveDefault | ADR-094 §9 names the default-library read libraries.retrieveDefault; the URL names a reference rather than an id, so the path-derived name would otherwise read as retrieving a library called default. |
@@ -0,0 +1,11 @@
1
+ /** Deprecated SDK methods warn once per process per method (ticket-4078). The table is generated from the
2
+ * OpenAPI `deprecated: true` operations; this is the single call path every deprecated binding goes through. */
3
+ export interface DeprecationNotice {
4
+ readonly replacement: string;
5
+ readonly sunset: string;
6
+ }
7
+ export declare function deprecationMessage(method: string, notice: DeprecationNotice): string;
8
+ /** Test seam: forget which methods already warned. */
9
+ export declare function resetDeprecationWarnings(): void;
10
+ export declare function envSilencesDeprecations(): boolean;
11
+ export declare function deprecate<F extends (...args: any[]) => any>(silenced: () => boolean, method: string, notice: DeprecationNotice, fn: F): F;
@@ -0,0 +1,20 @@
1
+ const warned = new Set();
2
+ export function deprecationMessage(method, notice) {
3
+ return `${method} is deprecated and stops working on ${notice.sunset}; use ${notice.replacement} instead.`;
4
+ }
5
+ /** Test seam: forget which methods already warned. */
6
+ export function resetDeprecationWarnings() { warned.clear(); }
7
+ export function envSilencesDeprecations() {
8
+ const env = globalThis.process?.env;
9
+ const value = env?.PRAXIS_SDK_SILENCE_DEPRECATIONS;
10
+ return value !== undefined && value !== '' && value !== '0' && value !== 'false';
11
+ }
12
+ export function deprecate(silenced, method, notice, fn) {
13
+ return ((...args) => {
14
+ if (!warned.has(method) && !silenced()) {
15
+ warned.add(method);
16
+ console.warn(deprecationMessage(method, notice));
17
+ }
18
+ return fn(...args);
19
+ });
20
+ }
@@ -6,6 +6,8 @@ export interface PraxisOptions {
6
6
  timeoutMs?: number;
7
7
  maxRetries?: number;
8
8
  fetch?: typeof globalThis.fetch;
9
+ /** Silence the once-per-method warning a deprecated method prints. PRAXIS_SDK_SILENCE_DEPRECATIONS=1 does the same. */
10
+ silenceDeprecations?: boolean;
9
11
  }
10
12
  export interface RequestOptions {
11
13
  headers?: Record<string, string>;
@@ -37,6 +39,8 @@ export declare function serverDeadlineMs(options: {
37
39
  export declare class Transport {
38
40
  private readonly config;
39
41
  constructor(options: PraxisOptions);
42
+ /** Whether deprecated-method warnings are off (client option or PRAXIS_SDK_SILENCE_DEPRECATIONS). */
43
+ readonly silenced: () => boolean;
40
44
  private validate;
41
45
  private scope;
42
46
  request<R>(operation: Operation, options?: InternalOptions): Promise<R>;
@@ -4,6 +4,7 @@ import { abortable, fetchWithRetry } from "./retry.js";
4
4
  import { parseSSE } from "./sse.js";
5
5
  import { resolveDefaultCredentials } from "./credentials.js";
6
6
  import { isBinaryOperation } from "./binary-operations.js";
7
+ import { envSilencesDeprecations } from "./deprecation.js";
7
8
  /** Our own per-call keys, beyond what the generated hey-api client accepts. */
8
9
  const SDK_OPTION_KEYS = ['timeoutMs', 'maxRetries', 'stream', 'lastEventId'];
9
10
  /** Every key of the generated client's per-call RequestOptions (request parts, fetch/RequestInit, serializers,
@@ -50,6 +51,8 @@ export class Transport {
50
51
  this.config = { timeoutMs: 600_000, maxRetries: 2, fetch: globalThis.fetch, ...options };
51
52
  this.validate(this.config.timeoutMs, this.config.maxRetries);
52
53
  }
54
+ /** Whether deprecated-method warnings are off (client option or PRAXIS_SDK_SILENCE_DEPRECATIONS). */
55
+ silenced = () => this.config.silenceDeprecations === true || envSilencesDeprecations();
53
56
  validate(timeout, retries) {
54
57
  if (!Number.isFinite(timeout) || timeout <= 0)
55
58
  throw new RangeError('timeoutMs must be positive and finite');