@katerai/sdk 0.2.1 → 0.4.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 (158) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +11 -15
  3. package/client.d.mts +7 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +7 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js +7 -29
  8. package/client.js.map +1 -1
  9. package/client.mjs +7 -29
  10. package/client.mjs.map +1 -1
  11. package/internal/utils/log.d.mts.map +1 -1
  12. package/internal/utils/log.d.ts.map +1 -1
  13. package/internal/utils/log.js +0 -1
  14. package/internal/utils/log.js.map +1 -1
  15. package/internal/utils/log.mjs +0 -1
  16. package/internal/utils/log.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/resources/healthz.d.mts +16 -0
  19. package/resources/healthz.d.mts.map +1 -0
  20. package/resources/healthz.d.ts +16 -0
  21. package/resources/healthz.d.ts.map +1 -0
  22. package/resources/healthz.js +15 -0
  23. package/resources/healthz.js.map +1 -0
  24. package/resources/healthz.mjs +11 -0
  25. package/resources/healthz.mjs.map +1 -0
  26. package/resources/index.d.mts +2 -0
  27. package/resources/index.d.mts.map +1 -1
  28. package/resources/index.d.ts +2 -0
  29. package/resources/index.d.ts.map +1 -1
  30. package/resources/index.js +5 -1
  31. package/resources/index.js.map +1 -1
  32. package/resources/index.mjs +2 -0
  33. package/resources/index.mjs.map +1 -1
  34. package/resources/readyz.d.mts +16 -0
  35. package/resources/readyz.d.mts.map +1 -0
  36. package/resources/readyz.d.ts +16 -0
  37. package/resources/readyz.d.ts.map +1 -0
  38. package/resources/readyz.js +15 -0
  39. package/resources/readyz.js.map +1 -0
  40. package/resources/readyz.mjs +11 -0
  41. package/resources/readyz.mjs.map +1 -0
  42. package/resources/v1/connections/connections.d.mts +258 -65
  43. package/resources/v1/connections/connections.d.mts.map +1 -1
  44. package/resources/v1/connections/connections.d.ts +258 -65
  45. package/resources/v1/connections/connections.d.ts.map +1 -1
  46. package/resources/v1/connections/connections.js +33 -0
  47. package/resources/v1/connections/connections.js.map +1 -1
  48. package/resources/v1/connections/connections.mjs +34 -1
  49. package/resources/v1/connections/connections.mjs.map +1 -1
  50. package/resources/v1/connections/databases.d.mts +118 -1
  51. package/resources/v1/connections/databases.d.mts.map +1 -1
  52. package/resources/v1/connections/databases.d.ts +118 -1
  53. package/resources/v1/connections/databases.d.ts.map +1 -1
  54. package/resources/v1/connections/databases.js +35 -0
  55. package/resources/v1/connections/databases.js.map +1 -1
  56. package/resources/v1/connections/databases.mjs +35 -0
  57. package/resources/v1/connections/databases.mjs.map +1 -1
  58. package/resources/v1/connections/index.d.mts +2 -2
  59. package/resources/v1/connections/index.d.mts.map +1 -1
  60. package/resources/v1/connections/index.d.ts +2 -2
  61. package/resources/v1/connections/index.d.ts.map +1 -1
  62. package/resources/v1/connections/index.js.map +1 -1
  63. package/resources/v1/connections/index.mjs +1 -1
  64. package/resources/v1/connections/index.mjs.map +1 -1
  65. package/resources/v1/github/github.d.mts +50 -42
  66. package/resources/v1/github/github.d.mts.map +1 -1
  67. package/resources/v1/github/github.d.ts +50 -42
  68. package/resources/v1/github/github.d.ts.map +1 -1
  69. package/resources/v1/github/github.js +12 -16
  70. package/resources/v1/github/github.js.map +1 -1
  71. package/resources/v1/github/github.mjs +12 -16
  72. package/resources/v1/github/github.mjs.map +1 -1
  73. package/resources/v1/github/index.d.mts +3 -4
  74. package/resources/v1/github/index.d.mts.map +1 -1
  75. package/resources/v1/github/index.d.ts +3 -4
  76. package/resources/v1/github/index.d.ts.map +1 -1
  77. package/resources/v1/github/index.js +1 -3
  78. package/resources/v1/github/index.js.map +1 -1
  79. package/resources/v1/github/index.mjs +0 -1
  80. package/resources/v1/github/index.mjs.map +1 -1
  81. package/resources/v1/github/scaffold.d.mts +1 -16
  82. package/resources/v1/github/scaffold.d.mts.map +1 -1
  83. package/resources/v1/github/scaffold.d.ts +1 -16
  84. package/resources/v1/github/scaffold.d.ts.map +1 -1
  85. package/resources/v1/github/scaffold.js +0 -6
  86. package/resources/v1/github/scaffold.js.map +1 -1
  87. package/resources/v1/github/scaffold.mjs +0 -6
  88. package/resources/v1/github/scaffold.mjs.map +1 -1
  89. package/resources/v1/github/webhooks.d.mts +18 -6
  90. package/resources/v1/github/webhooks.d.mts.map +1 -1
  91. package/resources/v1/github/webhooks.d.ts +18 -6
  92. package/resources/v1/github/webhooks.d.ts.map +1 -1
  93. package/resources/v1/github/webhooks.js +15 -3
  94. package/resources/v1/github/webhooks.js.map +1 -1
  95. package/resources/v1/github/webhooks.mjs +15 -3
  96. package/resources/v1/github/webhooks.mjs.map +1 -1
  97. package/resources/v1/index.d.mts +3 -4
  98. package/resources/v1/index.d.mts.map +1 -1
  99. package/resources/v1/index.d.ts +3 -4
  100. package/resources/v1/index.d.ts.map +1 -1
  101. package/resources/v1/index.js +1 -3
  102. package/resources/v1/index.js.map +1 -1
  103. package/resources/v1/index.mjs +0 -1
  104. package/resources/v1/index.mjs.map +1 -1
  105. package/resources/v1/me.d.mts +1 -9
  106. package/resources/v1/me.d.mts.map +1 -1
  107. package/resources/v1/me.d.ts +1 -9
  108. package/resources/v1/me.d.ts.map +1 -1
  109. package/resources/v1/me.js +0 -9
  110. package/resources/v1/me.js.map +1 -1
  111. package/resources/v1/me.mjs +0 -9
  112. package/resources/v1/me.mjs.map +1 -1
  113. package/resources/v1/v1.d.mts +6 -10
  114. package/resources/v1/v1.d.mts.map +1 -1
  115. package/resources/v1/v1.d.ts +6 -10
  116. package/resources/v1/v1.d.ts.map +1 -1
  117. package/resources/v1/v1.js +0 -4
  118. package/resources/v1/v1.js.map +1 -1
  119. package/resources/v1/v1.mjs +0 -4
  120. package/resources/v1/v1.mjs.map +1 -1
  121. package/src/client.ts +12 -37
  122. package/src/internal/utils/log.ts +0 -1
  123. package/src/resources/healthz.ts +20 -0
  124. package/src/resources/index.ts +2 -0
  125. package/src/resources/readyz.ts +20 -0
  126. package/src/resources/v1/connections/connections.ts +330 -68
  127. package/src/resources/v1/connections/databases.ts +165 -1
  128. package/src/resources/v1/connections/index.ts +9 -1
  129. package/src/resources/v1/github/github.ts +68 -56
  130. package/src/resources/v1/github/index.ts +7 -6
  131. package/src/resources/v1/github/scaffold.ts +1 -28
  132. package/src/resources/v1/github/webhooks.ts +45 -5
  133. package/src/resources/v1/index.ts +7 -11
  134. package/src/resources/v1/me.ts +1 -17
  135. package/src/resources/v1/v1.ts +14 -25
  136. package/src/version.ts +1 -1
  137. package/version.d.mts +1 -1
  138. package/version.d.ts +1 -1
  139. package/version.js +1 -1
  140. package/version.mjs +1 -1
  141. package/resources/v1/api-keys.d.mts +0 -142
  142. package/resources/v1/api-keys.d.mts.map +0 -1
  143. package/resources/v1/api-keys.d.ts +0 -142
  144. package/resources/v1/api-keys.d.ts.map +0 -1
  145. package/resources/v1/api-keys.js +0 -66
  146. package/resources/v1/api-keys.js.map +0 -1
  147. package/resources/v1/api-keys.mjs +0 -62
  148. package/resources/v1/api-keys.mjs.map +0 -1
  149. package/resources/v1/github/admin.d.mts +0 -33
  150. package/resources/v1/github/admin.d.mts.map +0 -1
  151. package/resources/v1/github/admin.d.ts +0 -33
  152. package/resources/v1/github/admin.d.ts.map +0 -1
  153. package/resources/v1/github/admin.js +0 -17
  154. package/resources/v1/github/admin.js.map +0 -1
  155. package/resources/v1/github/admin.mjs +0 -13
  156. package/resources/v1/github/admin.mjs.map +0 -1
  157. package/src/resources/v1/api-keys.ts +0 -186
  158. package/src/resources/v1/github/admin.ts +0 -56
@@ -1,7 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../../../core/resource.mjs";
3
3
  import * as DatabasesAPI from "./databases.mjs";
4
- import { Databases } from "./databases.mjs";
4
+ import { Databases, } from "./databases.mjs";
5
+ import { buildHeaders } from "../../../internal/headers.mjs";
5
6
  import { path } from "../../../internal/utils/path.mjs";
6
7
  export class Connections extends APIResource {
7
8
  constructor() {
@@ -18,6 +19,10 @@ export class Connections extends APIResource {
18
19
  * Get a single warehouse connection by kater_id.
19
20
  *
20
21
  * Returns connection from the database (source of truth) with full hierarchy.
22
+ * Supports content negotiation via Accept header (handled by MultiFormatRoute):
23
+ *
24
+ * - application/json (default): Returns JSON response
25
+ * - application/yaml: Returns YAML representation
21
26
  *
22
27
  * RLS: Filtered to current client (DualClientRLSDB).
23
28
  *
@@ -26,6 +31,18 @@ export class Connections extends APIResource {
26
31
  retrieve(connectionID, options) {
27
32
  return this._client.get(path `/api/v1/connections/${connectionID}`, options);
28
33
  }
34
+ /**
35
+ * Update a warehouse connection's metadata.
36
+ *
37
+ * Updates name, label, and/or description fields.
38
+ *
39
+ * RLS: Filtered to current client (ClientRLSDB).
40
+ *
41
+ * Raises: ConnectionNotFoundError: If connection doesn't exist (404)
42
+ */
43
+ update(connectionID, body, options) {
44
+ return this._client.patch(path `/api/v1/connections/${connectionID}`, { body, ...options });
45
+ }
29
46
  /**
30
47
  * List all warehouse connections for the client.
31
48
  *
@@ -38,6 +55,22 @@ export class Connections extends APIResource {
38
55
  list(options) {
39
56
  return this._client.get('/api/v1/connections', options);
40
57
  }
58
+ /**
59
+ * Delete a warehouse connection.
60
+ *
61
+ * Soft-deletes the connection record and cascades to all associated databases and
62
+ * schemas, setting deleted_at and deleted_by fields.
63
+ *
64
+ * RLS: Filtered to current client (ClientRLSDB).
65
+ *
66
+ * Raises: ConnectionNotFoundError: If connection doesn't exist (404)
67
+ */
68
+ delete(connectionID, options) {
69
+ return this._client.delete(path `/api/v1/connections/${connectionID}`, {
70
+ ...options,
71
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
72
+ });
73
+ }
41
74
  /**
42
75
  * Get decrypted warehouse credentials for a connection.
43
76
  *
@@ -1 +1 @@
1
- {"version":3,"file":"connections.mjs","sourceRoot":"","sources":["../../../src/resources/v1/connections/connections.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EAA8B,SAAS,EAAE;OAGzC,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA0D/E,CAAC;IAxDC;;OAEG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAoB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,uBAAuB,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;OASG;IACH,kBAAkB,CAChB,YAAoB,EACpB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,uBAAuB,YAAY,aAAa,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,YAAoB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,uBAAuB,YAAY,OAAO,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;CACF;AAktBD,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"connections.mjs","sourceRoot":"","sources":["../../../src/resources/v1/connections/connections.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;O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;IACH,kBAAkB,CAChB,YAAoB,EACpB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,uBAAuB,YAAY,aAAa,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,YAAoB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,uBAAuB,YAAY,OAAO,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;CACF;AAk6BD,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC"}
@@ -1,7 +1,21 @@
1
1
  import { APIResource } from "../../../core/resource.mjs";
2
+ import * as ConnectionsAPI from "./connections.mjs";
2
3
  import { APIPromise } from "../../../core/api-promise.mjs";
3
4
  import { RequestOptions } from "../../../internal/request-options.mjs";
4
5
  export declare class Databases extends APIResource {
6
+ /**
7
+ * Update a database's metadata.
8
+ *
9
+ * Updates label and/or description fields directly. If a name change is requested,
10
+ * a GitHub PR is created to update view YAML files. The name change is applied to
11
+ * the DB when the PR merges (or immediately if auto_merge is true or no views are
12
+ * affected).
13
+ *
14
+ * RLS: Filtered to current client (DualClientRLSDB).
15
+ *
16
+ * Raises: DatabaseNotFoundError: If database doesn't exist (404)
17
+ */
18
+ update(databaseID: string, params: DatabaseUpdateParams, options?: RequestOptions): APIPromise<DatabaseUpdateResponse>;
5
19
  /**
6
20
  * Delete a schema from a connection.
7
21
  *
@@ -14,12 +28,115 @@ export declare class Databases extends APIResource {
14
28
  * Raises: SchemaNotFoundError: If schema doesn't exist (404)
15
29
  */
16
30
  deleteSchema(schemaID: string, params: DatabaseDeleteSchemaParams, options?: RequestOptions): APIPromise<void>;
31
+ /**
32
+ * Update a schema's metadata.
33
+ *
34
+ * Updates label and/or description fields directly. If a name change is requested,
35
+ * a GitHub PR is created to update view YAML files. The name change is applied to
36
+ * the DB when the PR merges (or immediately if auto_merge is true or no views are
37
+ * affected).
38
+ *
39
+ * RLS: Filtered to current client (DualClientRLSDB).
40
+ *
41
+ * Raises: SchemaNotFoundError: If schema doesn't exist (404)
42
+ */
43
+ updateSchema(schemaID: string, params: DatabaseUpdateSchemaParams, options?: RequestOptions): APIPromise<DatabaseUpdateSchemaResponse>;
44
+ }
45
+ /**
46
+ * Response for database/schema updates that may involve a rename PR.
47
+ */
48
+ export interface DatabaseUpdateResponse {
49
+ /**
50
+ * Updated connection
51
+ */
52
+ connection: ConnectionsAPI.Connection;
53
+ /**
54
+ * GitHub PR number
55
+ */
56
+ pr_number?: number | null;
57
+ /**
58
+ * PR status: 'open' or 'merged'
59
+ */
60
+ pr_status?: string | null;
61
+ /**
62
+ * GitHub PR URL (if rename PR created)
63
+ */
64
+ pr_url?: string | null;
65
+ }
66
+ /**
67
+ * Response for database/schema updates that may involve a rename PR.
68
+ */
69
+ export interface DatabaseUpdateSchemaResponse {
70
+ /**
71
+ * Updated connection
72
+ */
73
+ connection: ConnectionsAPI.Connection;
74
+ /**
75
+ * GitHub PR number
76
+ */
77
+ pr_number?: number | null;
78
+ /**
79
+ * PR status: 'open' or 'merged'
80
+ */
81
+ pr_status?: string | null;
82
+ /**
83
+ * GitHub PR URL (if rename PR created)
84
+ */
85
+ pr_url?: string | null;
86
+ }
87
+ export interface DatabaseUpdateParams {
88
+ /**
89
+ * Path param
90
+ */
91
+ connection_id: string;
92
+ /**
93
+ * Body param: If true and a name change requires a PR, auto-merge it
94
+ */
95
+ auto_merge?: boolean;
96
+ /**
97
+ * Body param: Database description
98
+ */
99
+ description?: string | null;
100
+ /**
101
+ * Body param: Human-readable display label
102
+ */
103
+ label?: string | null;
104
+ /**
105
+ * Body param: Database name
106
+ */
107
+ name?: string | null;
17
108
  }
18
109
  export interface DatabaseDeleteSchemaParams {
19
110
  connection_id: string;
20
111
  database_id: string;
21
112
  }
113
+ export interface DatabaseUpdateSchemaParams {
114
+ /**
115
+ * Path param
116
+ */
117
+ connection_id: string;
118
+ /**
119
+ * Path param
120
+ */
121
+ database_id: string;
122
+ /**
123
+ * Body param: If true and a name change requires a PR, auto-merge it
124
+ */
125
+ auto_merge?: boolean;
126
+ /**
127
+ * Body param: Schema description
128
+ */
129
+ description?: string | null;
130
+ /**
131
+ * Body param: Human-readable display label
132
+ */
133
+ label?: string | null;
134
+ /**
135
+ * Body param: Schema name
136
+ */
137
+ name?: string | null;
138
+ }
22
139
  export declare namespace Databases {
23
- export { type DatabaseDeleteSchemaParams as DatabaseDeleteSchemaParams };
140
+ export { type DatabaseUpdateResponse as DatabaseUpdateResponse, type DatabaseUpdateSchemaResponse as DatabaseUpdateSchemaResponse, type DatabaseUpdateParams as DatabaseUpdateParams, type DatabaseDeleteSchemaParams as DatabaseDeleteSchemaParams, type DatabaseUpdateSchemaParams as DatabaseUpdateSchemaParams, };
24
141
  }
25
142
  //# sourceMappingURL=databases.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"databases.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/connections/databases.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;OAUG;IACH,YAAY,CACV,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,0BAA0B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,IAAI,CAAC;CAOpB;AAED,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,MAAM,CAAC;IAEtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EAAE,KAAK,0BAA0B,IAAI,0BAA0B,EAAE,CAAC;CAC1E"}
1
+ {"version":3,"file":"databases.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/connections/databases.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OA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AG,IAAI,CAAC;IAE5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,MAAM,CAAC;IAEtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -1,7 +1,21 @@
1
1
  import { APIResource } from "../../../core/resource.js";
2
+ import * as ConnectionsAPI from "./connections.js";
2
3
  import { APIPromise } from "../../../core/api-promise.js";
3
4
  import { RequestOptions } from "../../../internal/request-options.js";
4
5
  export declare class Databases extends APIResource {
6
+ /**
7
+ * Update a database's metadata.
8
+ *
9
+ * Updates label and/or description fields directly. If a name change is requested,
10
+ * a GitHub PR is created to update view YAML files. The name change is applied to
11
+ * the DB when the PR merges (or immediately if auto_merge is true or no views are
12
+ * affected).
13
+ *
14
+ * RLS: Filtered to current client (DualClientRLSDB).
15
+ *
16
+ * Raises: DatabaseNotFoundError: If database doesn't exist (404)
17
+ */
18
+ update(databaseID: string, params: DatabaseUpdateParams, options?: RequestOptions): APIPromise<DatabaseUpdateResponse>;
5
19
  /**
6
20
  * Delete a schema from a connection.
7
21
  *
@@ -14,12 +28,115 @@ export declare class Databases extends APIResource {
14
28
  * Raises: SchemaNotFoundError: If schema doesn't exist (404)
15
29
  */
16
30
  deleteSchema(schemaID: string, params: DatabaseDeleteSchemaParams, options?: RequestOptions): APIPromise<void>;
31
+ /**
32
+ * Update a schema's metadata.
33
+ *
34
+ * Updates label and/or description fields directly. If a name change is requested,
35
+ * a GitHub PR is created to update view YAML files. The name change is applied to
36
+ * the DB when the PR merges (or immediately if auto_merge is true or no views are
37
+ * affected).
38
+ *
39
+ * RLS: Filtered to current client (DualClientRLSDB).
40
+ *
41
+ * Raises: SchemaNotFoundError: If schema doesn't exist (404)
42
+ */
43
+ updateSchema(schemaID: string, params: DatabaseUpdateSchemaParams, options?: RequestOptions): APIPromise<DatabaseUpdateSchemaResponse>;
44
+ }
45
+ /**
46
+ * Response for database/schema updates that may involve a rename PR.
47
+ */
48
+ export interface DatabaseUpdateResponse {
49
+ /**
50
+ * Updated connection
51
+ */
52
+ connection: ConnectionsAPI.Connection;
53
+ /**
54
+ * GitHub PR number
55
+ */
56
+ pr_number?: number | null;
57
+ /**
58
+ * PR status: 'open' or 'merged'
59
+ */
60
+ pr_status?: string | null;
61
+ /**
62
+ * GitHub PR URL (if rename PR created)
63
+ */
64
+ pr_url?: string | null;
65
+ }
66
+ /**
67
+ * Response for database/schema updates that may involve a rename PR.
68
+ */
69
+ export interface DatabaseUpdateSchemaResponse {
70
+ /**
71
+ * Updated connection
72
+ */
73
+ connection: ConnectionsAPI.Connection;
74
+ /**
75
+ * GitHub PR number
76
+ */
77
+ pr_number?: number | null;
78
+ /**
79
+ * PR status: 'open' or 'merged'
80
+ */
81
+ pr_status?: string | null;
82
+ /**
83
+ * GitHub PR URL (if rename PR created)
84
+ */
85
+ pr_url?: string | null;
86
+ }
87
+ export interface DatabaseUpdateParams {
88
+ /**
89
+ * Path param
90
+ */
91
+ connection_id: string;
92
+ /**
93
+ * Body param: If true and a name change requires a PR, auto-merge it
94
+ */
95
+ auto_merge?: boolean;
96
+ /**
97
+ * Body param: Database description
98
+ */
99
+ description?: string | null;
100
+ /**
101
+ * Body param: Human-readable display label
102
+ */
103
+ label?: string | null;
104
+ /**
105
+ * Body param: Database name
106
+ */
107
+ name?: string | null;
17
108
  }
18
109
  export interface DatabaseDeleteSchemaParams {
19
110
  connection_id: string;
20
111
  database_id: string;
21
112
  }
113
+ export interface DatabaseUpdateSchemaParams {
114
+ /**
115
+ * Path param
116
+ */
117
+ connection_id: string;
118
+ /**
119
+ * Path param
120
+ */
121
+ database_id: string;
122
+ /**
123
+ * Body param: If true and a name change requires a PR, auto-merge it
124
+ */
125
+ auto_merge?: boolean;
126
+ /**
127
+ * Body param: Schema description
128
+ */
129
+ description?: string | null;
130
+ /**
131
+ * Body param: Human-readable display label
132
+ */
133
+ label?: string | null;
134
+ /**
135
+ * Body param: Schema name
136
+ */
137
+ name?: string | null;
138
+ }
22
139
  export declare namespace Databases {
23
- export { type DatabaseDeleteSchemaParams as DatabaseDeleteSchemaParams };
140
+ export { type DatabaseUpdateResponse as DatabaseUpdateResponse, type DatabaseUpdateSchemaResponse as DatabaseUpdateSchemaResponse, type DatabaseUpdateParams as DatabaseUpdateParams, type DatabaseDeleteSchemaParams as DatabaseDeleteSchemaParams, type DatabaseUpdateSchemaParams as DatabaseUpdateSchemaParams, };
24
141
  }
25
142
  //# sourceMappingURL=databases.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"databases.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/connections/databases.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;OAUG;IACH,YAAY,CACV,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,0BAA0B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,IAAI,CAAC;CAOpB;AAED,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,MAAM,CAAC;IAEtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EAAE,KAAK,0BAA0B,IAAI,0BAA0B,EAAE,CAAC;CAC1E"}
1
+ {"version":3,"file":"databases.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/connections/databases.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;IAQrC;;;;;;;;;;OAUG;IACH,YAAY,CACV,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,0BAA0B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,IAAI,CAAC;IAQnB;;;;;;;;;;;OAWG;IACH,YAAY,CACV,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,0BAA0B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,4BAA4B,CAAC;CAO5C;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,UAAU,EAAE,cAAc,CAAC,UAAU,CAAC;IAEtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;C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,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -6,6 +6,25 @@ const resource_1 = require("../../../core/resource.js");
6
6
  const headers_1 = require("../../../internal/headers.js");
7
7
  const path_1 = require("../../../internal/utils/path.js");
8
8
  class Databases extends resource_1.APIResource {
9
+ /**
10
+ * Update a database's metadata.
11
+ *
12
+ * Updates label and/or description fields directly. If a name change is requested,
13
+ * a GitHub PR is created to update view YAML files. The name change is applied to
14
+ * the DB when the PR merges (or immediately if auto_merge is true or no views are
15
+ * affected).
16
+ *
17
+ * RLS: Filtered to current client (DualClientRLSDB).
18
+ *
19
+ * Raises: DatabaseNotFoundError: If database doesn't exist (404)
20
+ */
21
+ update(databaseID, params, options) {
22
+ const { connection_id, ...body } = params;
23
+ return this._client.patch((0, path_1.path) `/api/v1/connections/${connection_id}/databases/${databaseID}`, {
24
+ body,
25
+ ...options,
26
+ });
27
+ }
9
28
  /**
10
29
  * Delete a schema from a connection.
11
30
  *
@@ -21,6 +40,22 @@ class Databases extends resource_1.APIResource {
21
40
  const { connection_id, database_id } = params;
22
41
  return this._client.delete((0, path_1.path) `/api/v1/connections/${connection_id}/databases/${database_id}/schemas/${schemaID}`, { ...options, headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]) });
23
42
  }
43
+ /**
44
+ * Update a schema's metadata.
45
+ *
46
+ * Updates label and/or description fields directly. If a name change is requested,
47
+ * a GitHub PR is created to update view YAML files. The name change is applied to
48
+ * the DB when the PR merges (or immediately if auto_merge is true or no views are
49
+ * affected).
50
+ *
51
+ * RLS: Filtered to current client (DualClientRLSDB).
52
+ *
53
+ * Raises: SchemaNotFoundError: If schema doesn't exist (404)
54
+ */
55
+ updateSchema(schemaID, params, options) {
56
+ const { connection_id, database_id, ...body } = params;
57
+ return this._client.patch((0, path_1.path) `/api/v1/connections/${connection_id}/databases/${database_id}/schemas/${schemaID}`, { body, ...options });
58
+ }
24
59
  }
25
60
  exports.Databases = Databases;
26
61
  //# sourceMappingURL=databases.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"databases.js","sourceRoot":"","sources":["../../../src/resources/v1/connections/databases.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;OAUG;IACH,YAAY,CACV,QAAgB,EAChB,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,IAAA,WAAI,EAAA,uBAAuB,aAAa,cAAc,WAAW,YAAY,QAAQ,EAAE,EACvF,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAC7E,CAAC;IACJ,CAAC;CACF;AAvBD,8BAuBC"}
1
+ {"version":3,"file":"databases.js","sourceRoot":"","sources":["../../../src/resources/v1/connections/databases.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,UAAkB,EAClB,MAA4B,EAC5B,OAAwB;QAExB,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,uBAAuB,aAAa,cAAc,UAAU,EAAE,EAAE;YAC5F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,YAAY,CACV,QAAgB,EAChB,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,IAAA,WAAI,EAAA,uBAAuB,aAAa,cAAc,WAAW,YAAY,QAAQ,EAAE,EACvF,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAC7E,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,YAAY,CACV,QAAgB,EAChB,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CACvB,IAAA,WAAI,EAAA,uBAAuB,aAAa,cAAc,WAAW,YAAY,QAAQ,EAAE,EACvF,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CACrB,CAAC;IACJ,CAAC;CACF;AAvED,8BAuEC"}
@@ -3,6 +3,25 @@ import { APIResource } from "../../../core/resource.mjs";
3
3
  import { buildHeaders } from "../../../internal/headers.mjs";
4
4
  import { path } from "../../../internal/utils/path.mjs";
5
5
  export class Databases extends APIResource {
6
+ /**
7
+ * Update a database's metadata.
8
+ *
9
+ * Updates label and/or description fields directly. If a name change is requested,
10
+ * a GitHub PR is created to update view YAML files. The name change is applied to
11
+ * the DB when the PR merges (or immediately if auto_merge is true or no views are
12
+ * affected).
13
+ *
14
+ * RLS: Filtered to current client (DualClientRLSDB).
15
+ *
16
+ * Raises: DatabaseNotFoundError: If database doesn't exist (404)
17
+ */
18
+ update(databaseID, params, options) {
19
+ const { connection_id, ...body } = params;
20
+ return this._client.patch(path `/api/v1/connections/${connection_id}/databases/${databaseID}`, {
21
+ body,
22
+ ...options,
23
+ });
24
+ }
6
25
  /**
7
26
  * Delete a schema from a connection.
8
27
  *
@@ -18,5 +37,21 @@ export class Databases extends APIResource {
18
37
  const { connection_id, database_id } = params;
19
38
  return this._client.delete(path `/api/v1/connections/${connection_id}/databases/${database_id}/schemas/${schemaID}`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]) });
20
39
  }
40
+ /**
41
+ * Update a schema's metadata.
42
+ *
43
+ * Updates label and/or description fields directly. If a name change is requested,
44
+ * a GitHub PR is created to update view YAML files. The name change is applied to
45
+ * the DB when the PR merges (or immediately if auto_merge is true or no views are
46
+ * affected).
47
+ *
48
+ * RLS: Filtered to current client (DualClientRLSDB).
49
+ *
50
+ * Raises: SchemaNotFoundError: If schema doesn't exist (404)
51
+ */
52
+ updateSchema(schemaID, params, options) {
53
+ const { connection_id, database_id, ...body } = params;
54
+ return this._client.patch(path `/api/v1/connections/${connection_id}/databases/${database_id}/schemas/${schemaID}`, { body, ...options });
55
+ }
21
56
  }
22
57
  //# sourceMappingURL=databases.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"databases.mjs","sourceRoot":"","sources":["../../../src/resources/v1/connections/databases.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;OAUG;IACH,YAAY,CACV,QAAgB,EAChB,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,IAAI,CAAA,uBAAuB,aAAa,cAAc,WAAW,YAAY,QAAQ,EAAE,EACvF,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAC7E,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"databases.mjs","sourceRoot":"","sources":["../../../src/resources/v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nectionListResponse, type ConnectionRetrieveCredentialResponse, type ConnectionSyncResponse, type ConnectionCreateParams, } from "./connections.mjs";
2
- export { Databases, type DatabaseDeleteSchemaParams } from "./databases.mjs";
1
+ export { Connections, type Connection, type DatabaseConfig, type ConnectionListResponse, type ConnectionRetrieveCredentialResponse, type ConnectionSyncResponse, type ConnectionCreateParams, type ConnectionUpdateParams, } from "./connections.mjs";
2
+ export { Databases, type DatabaseUpdateResponse, type DatabaseUpdateSchemaResponse, type DatabaseUpdateParams, type DatabaseDeleteSchemaParams, type DatabaseUpdateSchemaParams, } from "./databases.mjs";
3
3
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/connections/index.ts"],"names":[],"mappings":"OAEO,EACL,WAAW,EACX,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,oCAAoC,EACzC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,GAC5B;OACM,EAAE,SAAS,EAAE,KAAK,0BAA0B,EAAE"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/connections/index.ts"],"names":[],"mappings":"OAEO,EACL,WAAW,EACX,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,oCAAoC,EACzC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,GAC5B;OACM,EACL,SAAS,EACT,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,GAChC"}
@@ -1,3 +1,3 @@
1
- export { Connections, type Connection, type DatabaseConfig, type ConnectionListResponse, type ConnectionRetrieveCredentialResponse, type ConnectionSyncResponse, type ConnectionCreateParams, } from "./connections.js";
2
- export { Databases, type DatabaseDeleteSchemaParams } from "./databases.js";
1
+ export { Connections, type Connection, type DatabaseConfig, type ConnectionListResponse, type ConnectionRetrieveCredentialResponse, type ConnectionSyncResponse, type ConnectionCreateParams, type ConnectionUpdateParams, } from "./connections.js";
2
+ export { Databases, type DatabaseUpdateResponse, type DatabaseUpdateSchemaResponse, type DatabaseUpdateParams, type DatabaseDeleteSchemaParams, type DatabaseUpdateSchemaParams, } from "./databases.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/connections/index.ts"],"names":[],"mappings":"OAEO,EACL,WAAW,EACX,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,oCAAoC,EACzC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,GAC5B;OACM,EAAE,SAAS,EAAE,KAAK,0BAA0B,EAAE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/connections/index.ts"],"names":[],"mappings":"OAEO,EACL,WAAW,EACX,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,oCAAoC,EACzC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,GAC5B;OACM,EACL,SAAS,EACT,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,GAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/v1/connections/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAQuB;AAPrB,0GAAA,WAAW,OAAA;AAQb,4CAAyE;AAAhE,sGAAA,SAAS,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/v1/connections/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDASuB;AARrB,0GAAA,WAAW,OAAA;AASb,4CAOqB;AANnB,sGAAA,SAAS,OAAA"}
@@ -1,4 +1,4 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  export { Connections, } from "./connections.mjs";
3
- export { Databases } from "./databases.mjs";
3
+ export { Databases, } from "./databases.mjs";
4
4
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/v1/connections/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,WAAW,GAOZ;OACM,EAAE,SAAS,EAAmC"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/v1/connections/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,WAAW,GAQZ;OACM,EACL,SAAS,GAMV"}
@@ -1,59 +1,47 @@
1
1
  import { APIResource } from "../../../core/resource.mjs";
2
- import * as AdminAPI from "./admin.mjs";
3
- import { Admin, AdminGetIntegrationStatusResponse } from "./admin.mjs";
4
2
  import * as ReposAPI from "./repos.mjs";
5
3
  import { RepoListResponse, RepoSelectParams, RepoSelectResponse, Repos, Repository } from "./repos.mjs";
6
4
  import * as ScaffoldAPI from "./scaffold.mjs";
7
- import { Scaffold, ScaffoldGetStatusResponse, ScaffoldTrigger } from "./scaffold.mjs";
5
+ import { Scaffold, ScaffoldTrigger } from "./scaffold.mjs";
8
6
  import * as WebhooksAPI from "./webhooks.mjs";
9
- import { WebhookPingResponse, Webhooks } from "./webhooks.mjs";
7
+ import { WebhookReceiveParams, WebhookReceiveResponse, Webhooks } from "./webhooks.mjs";
10
8
  import { APIPromise } from "../../../core/api-promise.mjs";
11
9
  import { RequestOptions } from "../../../internal/request-options.mjs";
12
10
  export declare class GitHub extends APIResource {
13
11
  repos: ReposAPI.Repos;
14
12
  scaffold: ScaffoldAPI.Scaffold;
15
13
  webhooks: WebhooksAPI.Webhooks;
16
- admin: AdminAPI.Admin;
17
14
  /**
18
- * Checks if the GitHub App is already installed on any organizations/accounts.
15
+ * Handles the OAuth callback from GitHub after user authorization.
19
16
  */
20
- checkInstallations(options?: RequestOptions): APIPromise<GitHubCheckInstallationsResponse>;
17
+ callback(query: GitHubCallbackParams, options?: RequestOptions): APIPromise<unknown>;
21
18
  /**
22
- * Disconnects the GitHub connection.
19
+ * Initiates the GitHub App installation flow.
23
20
  */
24
- disconnect(options?: RequestOptions): APIPromise<GitHubDisconnectResponse>;
21
+ connect(query?: GitHubConnectParams | null | undefined, options?: RequestOptions): APIPromise<GitHubConnectResponse>;
25
22
  /**
26
- * Returns the current GitHub connection status for the client.
23
+ * Generates a shareable GitHub App installation link.
27
24
  */
28
- getStatus(options?: RequestOptions): APIPromise<GitHubGetStatusResponse>;
25
+ getInstallationLink(options?: RequestOptions): APIPromise<GitHubGetInstallationLinkResponse>;
29
26
  /**
30
- * Verifies the GitHub connection and updates the last sync timestamp.
27
+ * Returns the current GitHub connection status for the client.
31
28
  */
32
- sync(options?: RequestOptions): APIPromise<GitHubSyncResponse>;
29
+ getStatus(options?: RequestOptions): APIPromise<GitHubGetStatusResponse>;
33
30
  }
31
+ export type GitHubCallbackResponse = unknown;
34
32
  /**
35
- * Response for checking existing installations.
33
+ * Response for starting OAuth flow.
36
34
  */
37
- export interface GitHubCheckInstallationsResponse {
38
- has_existing_installation: boolean;
39
- installations?: Array<GitHubCheckInstallationsResponse.Installation>;
40
- }
41
- export declare namespace GitHubCheckInstallationsResponse {
42
- /**
43
- * Information about an existing GitHub App installation.
44
- */
45
- interface Installation {
46
- account_login: string;
47
- account_type: string;
48
- installation_id: number;
49
- }
35
+ export interface GitHubConnectResponse {
36
+ authorization_url: string;
37
+ state: string;
50
38
  }
51
39
  /**
52
- * Response for disconnecting GitHub.
40
+ * Response for installation link generation.
53
41
  */
54
- export interface GitHubDisconnectResponse {
55
- message: string;
56
- success: boolean;
42
+ export interface GitHubGetInstallationLinkResponse {
43
+ app_name: string;
44
+ installation_url: string;
57
45
  }
58
46
  /**
59
47
  * Response for connection status.
@@ -69,19 +57,39 @@ export interface GitHubGetStatusResponse {
69
57
  scaffolding_status?: string | null;
70
58
  status?: string | null;
71
59
  }
72
- /**
73
- * Response for sync operation.
74
- */
75
- export interface GitHubSyncResponse {
76
- last_sync_at: string;
77
- message: string;
78
- success: boolean;
60
+ export interface GitHubCallbackParams {
61
+ /**
62
+ * State token for CSRF validation
63
+ */
64
+ state: string;
65
+ /**
66
+ * OAuth authorization code
67
+ */
68
+ code?: string | null;
69
+ /**
70
+ * OAuth error code from GitHub
71
+ */
72
+ error?: string | null;
73
+ /**
74
+ * OAuth error description
75
+ */
76
+ error_description?: string | null;
77
+ /**
78
+ * GitHub App installation ID
79
+ */
80
+ installation_id?: number | null;
81
+ }
82
+ export interface GitHubConnectParams {
83
+ /**
84
+ * Frontend path to redirect to after OAuth success (e.g., '/' or
85
+ * '/settings/github')
86
+ */
87
+ return_to?: string | null;
79
88
  }
80
89
  export declare namespace GitHub {
81
- export { type GitHubCheckInstallationsResponse as GitHubCheckInstallationsResponse, type GitHubDisconnectResponse as GitHubDisconnectResponse, type GitHubGetStatusResponse as GitHubGetStatusResponse, type GitHubSyncResponse as GitHubSyncResponse, };
90
+ export { type GitHubCallbackResponse as GitHubCallbackResponse, type GitHubConnectResponse as GitHubConnectResponse, type GitHubGetInstallationLinkResponse as GitHubGetInstallationLinkResponse, type GitHubGetStatusResponse as GitHubGetStatusResponse, type GitHubCallbackParams as GitHubCallbackParams, type GitHubConnectParams as GitHubConnectParams, };
82
91
  export { Repos as Repos, type Repository as Repository, type RepoListResponse as RepoListResponse, type RepoSelectResponse as RepoSelectResponse, type RepoSelectParams as RepoSelectParams, };
83
- export { Scaffold as Scaffold, type ScaffoldTrigger as ScaffoldTrigger, type ScaffoldGetStatusResponse as ScaffoldGetStatusResponse, };
84
- export { Webhooks as Webhooks, type WebhookPingResponse as WebhookPingResponse };
85
- export { Admin as Admin, type AdminGetIntegrationStatusResponse as AdminGetIntegrationStatusResponse };
92
+ export { Scaffold as Scaffold, type ScaffoldTrigger as ScaffoldTrigger };
93
+ export { Webhooks as Webhooks, type WebhookReceiveResponse as WebhookReceiveResponse, type WebhookReceiveParams as WebhookReceiveParams, };
86
94
  }
87
95
  //# sourceMappingURL=github.d.mts.map