notte-sdk 1.10.4 → 1.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -128,6 +128,7 @@ __export(index_exports, {
128
128
  functionSchedulesUpdate: () => functionSchedulesUpdate,
129
129
  functionUpdate: () => functionUpdate,
130
130
  getPayment: () => getPayment,
131
+ getPaymentWalletConnection: () => getPaymentWalletConnection,
131
132
  getPolicy: () => getPolicy,
132
133
  getRootDomain: () => getRootDomain,
133
134
  getScript: () => getScript,
@@ -148,6 +149,7 @@ __export(index_exports, {
148
149
  listFunctionRunsByFunctionId: () => listFunctionRunsByFunctionId,
149
150
  listFunctions: () => listFunctions,
150
151
  listMonitors: () => listMonitors,
152
+ listPaymentRequests: () => listPaymentRequests,
151
153
  listPersonas: () => listPersonas,
152
154
  listSecrets: () => listSecrets,
153
155
  listSessionFiles: () => listSessionFiles,
@@ -163,6 +165,9 @@ __export(index_exports, {
163
165
  mapsSearch: () => mapsSearch,
164
166
  newsSearch: () => newsSearch,
165
167
  observeServerOwnedDialog: () => observeServerOwnedDialog,
168
+ pageAct: () => pageAct,
169
+ pageCheck: () => pageCheck,
170
+ pageChoose: () => pageChoose,
166
171
  pageExecute: () => pageExecute,
167
172
  pageObserve: () => pageObserve,
168
173
  pageScrape: () => pageScrape,
@@ -238,7 +243,7 @@ __export(index_exports, {
238
243
  module.exports = __toCommonJS(index_exports);
239
244
 
240
245
  // src/version.ts
241
- var SDK_VERSION = true ? "1.10.4" : "dev";
246
+ var SDK_VERSION = true ? "1.10.6" : "dev";
242
247
  var SDK_PACKAGE_NAME = true ? "notte-sdk" : "notte-sdk";
243
248
 
244
249
  // src/version-check.ts
@@ -1275,6 +1280,33 @@ var pageScrape = (options) => (options.client ?? client).post({
1275
1280
  ...options.headers
1276
1281
  }
1277
1282
  });
1283
+ var pageAct = (options) => (options.client ?? client).post({
1284
+ security: [{ scheme: "bearer", type: "http" }],
1285
+ url: "/sessions/{session_id}/page/act",
1286
+ ...options,
1287
+ headers: {
1288
+ "Content-Type": "application/json",
1289
+ ...options.headers
1290
+ }
1291
+ });
1292
+ var pageChoose = (options) => (options.client ?? client).post({
1293
+ security: [{ scheme: "bearer", type: "http" }],
1294
+ url: "/sessions/{session_id}/page/choose",
1295
+ ...options,
1296
+ headers: {
1297
+ "Content-Type": "application/json",
1298
+ ...options.headers
1299
+ }
1300
+ });
1301
+ var pageCheck = (options) => (options.client ?? client).post({
1302
+ security: [{ scheme: "bearer", type: "http" }],
1303
+ url: "/sessions/{session_id}/page/check",
1304
+ ...options,
1305
+ headers: {
1306
+ "Content-Type": "application/json",
1307
+ ...options.headers
1308
+ }
1309
+ });
1278
1310
  var sessionNetworkLogs = (options) => (options.client ?? client).get({
1279
1311
  security: [{ scheme: "bearer", type: "http" }],
1280
1312
  url: "/sessions/{session_id}/network/logs",
@@ -1588,6 +1620,16 @@ var createPayment = (options) => (options.client ?? client).post({
1588
1620
  ...options.headers
1589
1621
  }
1590
1622
  });
1623
+ var listPaymentRequests = (options) => (options?.client ?? client).get({
1624
+ security: [{ scheme: "bearer", type: "http" }],
1625
+ url: "/payments",
1626
+ ...options
1627
+ });
1628
+ var getPaymentWalletConnection = (options) => (options?.client ?? client).get({
1629
+ security: [{ scheme: "bearer", type: "http" }],
1630
+ url: "/payments/connection",
1631
+ ...options
1632
+ });
1591
1633
  var getPayment = (options) => (options.client ?? client).get({
1592
1634
  security: [{ scheme: "bearer", type: "http" }],
1593
1635
  url: "/payments/{payment_id}",
@@ -2346,11 +2388,26 @@ var NotteManagedAuth = class {
2346
2388
  function createResources(client2, getApiKey) {
2347
2389
  return {
2348
2390
  sessions: {
2391
+ /** pageAct: /sessions/{session_id}/page/act. Returns the API response body. */
2392
+ act: async (sessionId, body, query = void 0, requestOptions = {}) => {
2393
+ const response = await pageAct({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { "x-notte-timeout-ms": "200000", ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
2394
+ return response.data;
2395
+ },
2349
2396
  /** sessionAuthReadiness: /sessions/{session_id}/auth. Returns the API response body. */
2350
2397
  authReadiness: async (sessionId, requestOptions = {}) => {
2351
2398
  const response = await sessionAuthReadiness({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId } });
2352
2399
  return response.data;
2353
2400
  },
2401
+ /** pageCheck: /sessions/{session_id}/page/check. Returns the API response body. */
2402
+ check: async (sessionId, body, query = void 0, requestOptions = {}) => {
2403
+ const response = await pageCheck({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { "x-notte-timeout-ms": "200000", ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
2404
+ return response.data;
2405
+ },
2406
+ /** pageChoose: /sessions/{session_id}/page/choose. Returns the API response body. */
2407
+ choose: async (sessionId, body, query = void 0, requestOptions = {}) => {
2408
+ const response = await pageChoose({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { "x-notte-timeout-ms": "200000", ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
2409
+ return response.data;
2410
+ },
2354
2411
  /** createPayment: /sessions/{session_id}/payments. Returns the API response body. */
2355
2412
  createPayment: async (sessionId, body, query = void 0, requestOptions) => {
2356
2413
  const response = await createPayment({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, path: { "session_id": sessionId }, body, query });
@@ -5128,14 +5185,22 @@ var NotteFunction = class {
5128
5185
  return response.data;
5129
5186
  }
5130
5187
  /**
5131
- * Delete the function from the Notte console.
5188
+ * Delete the function permanently. This cannot be undone, so it must be confirmed.
5189
+ *
5190
+ * A function with deletion protection on cannot be deleted until it is turned off
5191
+ * with `updateMetadata({ deletion_protected: false })`.
5132
5192
  *
5193
+ * @param options - Must set `confirm` to `true`.
5133
5194
  * @returns The API's function-deletion confirmation.
5195
+ * @throws InvalidRequestError if `confirm` is not `true`.
5134
5196
  * @throws NotteAPIError if the function cannot be deleted.
5135
5197
  * @example
5136
- * await fn.delete();
5198
+ * await fn.delete({ confirm: true });
5137
5199
  */
5138
- async delete() {
5200
+ async delete(options) {
5201
+ if (options?.confirm !== true) {
5202
+ throw new InvalidRequestError("Deleting a function is permanent. Call delete({ confirm: true }) to proceed.");
5203
+ }
5139
5204
  const functionId = await this.ensureInitialized();
5140
5205
  const response = await functionDelete({
5141
5206
  client: this.client.getClient(),
@@ -6706,6 +6771,7 @@ var createClient2 = (config) => {
6706
6771
  functionSchedulesUpdate,
6707
6772
  functionUpdate,
6708
6773
  getPayment,
6774
+ getPaymentWalletConnection,
6709
6775
  getPolicy,
6710
6776
  getRootDomain,
6711
6777
  getScript,
@@ -6726,6 +6792,7 @@ var createClient2 = (config) => {
6726
6792
  listFunctionRunsByFunctionId,
6727
6793
  listFunctions,
6728
6794
  listMonitors,
6795
+ listPaymentRequests,
6729
6796
  listPersonas,
6730
6797
  listSecrets,
6731
6798
  listSessionFiles,
@@ -6741,6 +6808,9 @@ var createClient2 = (config) => {
6741
6808
  mapsSearch,
6742
6809
  newsSearch,
6743
6810
  observeServerOwnedDialog,
6811
+ pageAct,
6812
+ pageCheck,
6813
+ pageChoose,
6744
6814
  pageExecute,
6745
6815
  pageObserve,
6746
6816
  pageScrape,