@naturali/sdk 0.173.3 → 0.173.4

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.cjs CHANGED
@@ -915,7 +915,7 @@ var Channels = class {
915
915
  * Connect a channel
916
916
  *
917
917
  * Connect a channel. The required fields depend on `channel`; no credential is ever returned.
918
- * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
918
+ * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application. Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
919
919
  * **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
920
920
  * * **BYOT** (`credential_source: byot`, default) — supply
921
921
  * `phone_number_id` and `access_token` from your own Meta app.
package/dist/index.d.cts CHANGED
@@ -2481,6 +2481,22 @@ type Channel = {
2481
2481
  * Whether an access token is on file (its value is never returned).
2482
2482
  */
2483
2483
  has_credential: boolean;
2484
+ /**
2485
+ * Why Discord refused this channel's gateway connection, when it did: the worker stops retrying, so the channel stays silent until a `PATCH` changes `bot_token`, `modes` or `status`, which clears it. Null when there is none, and for non-Discord channels.
2486
+ *
2487
+ */
2488
+ gateway_error: {
2489
+ /**
2490
+ * `invalid_bot_token` — the token was reset or revoked. `disallowed_intents` — `mention_threads` needs the privileged Message Content intent enabled on the Discord application.
2491
+ *
2492
+ */
2493
+ code: 'invalid_bot_token' | 'disallowed_intents' | 'gateway_rejected';
2494
+ /**
2495
+ * The gateway close code Discord sent.
2496
+ */
2497
+ close_code: number;
2498
+ at: Date;
2499
+ } | null;
2484
2500
  created_at: Date;
2485
2501
  updated_at: Date;
2486
2502
  };
@@ -2545,7 +2561,7 @@ type ChannelCreate = {
2545
2561
  modes?: DiscordModes;
2546
2562
  };
2547
2563
  /**
2548
- * At least one field is required. For WhatsApp, `access_token` rotates the write-only credential; for Discord, `bot_token` rotates the sealed bot token and `modes` turns the gateway flows on or off. `default` replaces the channel's default action whole when present. The worker picks either change up on its next poll and reconnects.
2564
+ * At least one field is required. For WhatsApp, `access_token` rotates the write-only credential; for Discord, `bot_token` rotates the sealed bot token (checked with Discord as on connect) and `modes` turns the gateway flows on or off. `default` replaces the channel's default action whole when present. The worker picks either change up on its next poll and reconnects.
2549
2565
  *
2550
2566
  */
2551
2567
  type ChannelUpdate = {
@@ -25248,7 +25264,7 @@ export declare class Channels {
25248
25264
  * Connect a channel
25249
25265
  *
25250
25266
  * Connect a channel. The required fields depend on `channel`; no credential is ever returned.
25251
- * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
25267
+ * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application. Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
25252
25268
  * **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
25253
25269
  * * **BYOT** (`credential_source: byot`, default) — supply
25254
25270
  * `phone_number_id` and `access_token` from your own Meta app.
package/dist/index.d.mts CHANGED
@@ -2481,6 +2481,22 @@ type Channel = {
2481
2481
  * Whether an access token is on file (its value is never returned).
2482
2482
  */
2483
2483
  has_credential: boolean;
2484
+ /**
2485
+ * Why Discord refused this channel's gateway connection, when it did: the worker stops retrying, so the channel stays silent until a `PATCH` changes `bot_token`, `modes` or `status`, which clears it. Null when there is none, and for non-Discord channels.
2486
+ *
2487
+ */
2488
+ gateway_error: {
2489
+ /**
2490
+ * `invalid_bot_token` — the token was reset or revoked. `disallowed_intents` — `mention_threads` needs the privileged Message Content intent enabled on the Discord application.
2491
+ *
2492
+ */
2493
+ code: 'invalid_bot_token' | 'disallowed_intents' | 'gateway_rejected';
2494
+ /**
2495
+ * The gateway close code Discord sent.
2496
+ */
2497
+ close_code: number;
2498
+ at: Date;
2499
+ } | null;
2484
2500
  created_at: Date;
2485
2501
  updated_at: Date;
2486
2502
  };
@@ -2545,7 +2561,7 @@ type ChannelCreate = {
2545
2561
  modes?: DiscordModes;
2546
2562
  };
2547
2563
  /**
2548
- * At least one field is required. For WhatsApp, `access_token` rotates the write-only credential; for Discord, `bot_token` rotates the sealed bot token and `modes` turns the gateway flows on or off. `default` replaces the channel's default action whole when present. The worker picks either change up on its next poll and reconnects.
2564
+ * At least one field is required. For WhatsApp, `access_token` rotates the write-only credential; for Discord, `bot_token` rotates the sealed bot token (checked with Discord as on connect) and `modes` turns the gateway flows on or off. `default` replaces the channel's default action whole when present. The worker picks either change up on its next poll and reconnects.
2549
2565
  *
2550
2566
  */
2551
2567
  type ChannelUpdate = {
@@ -25248,7 +25264,7 @@ export declare class Channels {
25248
25264
  * Connect a channel
25249
25265
  *
25250
25266
  * Connect a channel. The required fields depend on `channel`; no credential is ever returned.
25251
- * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
25267
+ * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application. Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
25252
25268
  * **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
25253
25269
  * * **BYOT** (`credential_source: byot`, default) — supply
25254
25270
  * `phone_number_id` and `access_token` from your own Meta app.
package/dist/index.mjs CHANGED
@@ -914,7 +914,7 @@ var Channels = class {
914
914
  * Connect a channel
915
915
  *
916
916
  * Connect a channel. The required fields depend on `channel`; no credential is ever returned.
917
- * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
917
+ * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application. Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
918
918
  * **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
919
919
  * * **BYOT** (`credential_source: byot`, default) — supply
920
920
  * `phone_number_id` and `access_token` from your own Meta app.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.173.3",
3
+ "version": "0.173.4",
4
4
  "description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hey-api/openapi-ts": "^0.99.0",
34
- "@naturali/api": "0.173.3",
34
+ "@naturali/api": "0.173.4",
35
35
  "@ttoss/openapi-codegen": "^0.5.0",
36
36
  "@types/node": "^26.5.1",
37
37
  "tsdown": "^0.23.0",