@distilled.cloud/discord 1.0.0-rc.13 → 1.0.0-rc.15
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/lib/credentials.d.ts +2 -2
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +6 -8
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -1
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/protocol.d.ts +3 -3
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +3 -5
- package/lib/protocol.js.map +1 -1
- package/lib/retry.d.ts +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +1 -1
- package/lib/retry.js.map +1 -1
- package/lib/services/discord.d.ts +74 -12
- package/lib/services/discord.d.ts.map +1 -1
- package/lib/services/discord.js +770 -2414
- package/lib/services/discord.js.map +1 -1
- package/package.json +12 -10
- package/src/credentials.ts +13 -19
- package/src/errors.ts +1 -2
- package/src/index.ts +1 -5
- package/src/protocol.ts +29 -43
- package/src/retry.ts +4 -9
- package/src/services/discord.ts +4816 -7347
- package/lib/response-validation.test.d.ts +0 -4
- package/lib/response-validation.test.d.ts.map +0 -1
- package/lib/response-validation.test.js +0 -31
- package/lib/response-validation.test.js.map +0 -1
- package/src/response-validation.test.ts +0 -45
package/lib/credentials.d.ts
CHANGED
|
@@ -19,9 +19,9 @@ declare const Credentials_base: Context.ServiceClass<Credentials, "DiscordCreden
|
|
|
19
19
|
export declare class Credentials extends Credentials_base {
|
|
20
20
|
}
|
|
21
21
|
export declare const CredentialsFromEnv: Layer.Layer<Credentials, never, never>;
|
|
22
|
-
/** Convenience layer from a
|
|
22
|
+
/** Convenience layer from a redacted token + optional token type / base URL. */
|
|
23
23
|
export declare const credentials: (config: {
|
|
24
|
-
readonly token: string
|
|
24
|
+
readonly token: Redacted.Redacted<string>;
|
|
25
25
|
readonly tokenType?: TokenType;
|
|
26
26
|
readonly apiBaseUrl?: string;
|
|
27
27
|
}) => Layer.Layer<Credentials>;
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAElE,wDAAwD;AACxD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEzC,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAcJ,eAAO,MAAM,kBAAkB,wCAkB9B,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,WAAW,WAAY;IAClC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAQxB,CAAC"}
|
package/lib/credentials.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
1
2
|
/**
|
|
2
3
|
* Discord credentials — hand-written.
|
|
3
4
|
*
|
|
@@ -17,7 +18,6 @@ import * as Context from "effect/Context";
|
|
|
17
18
|
import * as Effect from "effect/Effect";
|
|
18
19
|
import * as Layer from "effect/Layer";
|
|
19
20
|
import * as Redacted from "effect/Redacted";
|
|
20
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
21
21
|
/**
|
|
22
22
|
* Discord HTTP API base URL. The trailing `/v10` is the API version the spec
|
|
23
23
|
* submodule describes — override via `DISCORD_API_URL` only to point at a
|
|
@@ -29,24 +29,22 @@ export class Credentials extends Context.Service()("DiscordCredentials") {
|
|
|
29
29
|
const envConfig = EffectConfig.all({
|
|
30
30
|
// DISCORD_BOT_TOKEN is the spelling discord.js and most hosting platforms
|
|
31
31
|
// use; DISCORD_TOKEN is the fallback.
|
|
32
|
-
token: EffectConfig.
|
|
32
|
+
token: EffectConfig.Redacted("DISCORD_BOT_TOKEN").pipe(EffectConfig.orElse(() => EffectConfig.Redacted("DISCORD_TOKEN"))),
|
|
33
33
|
tokenType: EffectConfig.String("DISCORD_TOKEN_TYPE").pipe(EffectConfig.withDefault("Bot")),
|
|
34
34
|
apiBaseUrl: EffectConfig.String("DISCORD_API_URL").pipe(EffectConfig.withDefault(DEFAULT_API_BASE_URL)),
|
|
35
35
|
});
|
|
36
36
|
export const CredentialsFromEnv = Layer.succeed(Credentials, envConfig.pipe(Effect.mapError(() => new ConfigError({
|
|
37
37
|
message: "DISCORD_BOT_TOKEN (or DISCORD_TOKEN) environment variable is required",
|
|
38
38
|
})), Effect.map(({ token, tokenType, apiBaseUrl }) => ({
|
|
39
|
-
token
|
|
39
|
+
token,
|
|
40
40
|
// Anything but an explicit `Bearer` means a bot token — the OAuth2
|
|
41
41
|
// flavor is the opt-in.
|
|
42
|
-
tokenType: (tokenType.toLowerCase() === "bearer"
|
|
43
|
-
? "Bearer"
|
|
44
|
-
: "Bot"),
|
|
42
|
+
tokenType: (tokenType.toLowerCase() === "bearer" ? "Bearer" : "Bot"),
|
|
45
43
|
apiBaseUrl,
|
|
46
44
|
})), Effect.orDie));
|
|
47
|
-
/** Convenience layer from a
|
|
45
|
+
/** Convenience layer from a redacted token + optional token type / base URL. */
|
|
48
46
|
export const credentials = (config) => Layer.succeed(Credentials, Effect.succeed({
|
|
49
|
-
token:
|
|
47
|
+
token: config.token,
|
|
50
48
|
tokenType: config.tokenType ?? "Bot",
|
|
51
49
|
apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL,
|
|
52
50
|
}));
|
package/lib/credentials.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,6BAA6B,CAAC;AAWlE,MAAM,OAAO,WAAY,SAAQ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AAE,MAAM,CAAC,KAAK;IACnB,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,KAAK;IACpC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,oBAAoB;CACtD,CAAC,CACH,CAAC"}
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;;;;;;;;;;;AAExC;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,wBAQT;CAAG;;;;;;;;;AAEnC,kCAAkC;AAClC,qBAAa,iBAAkB,SAAQ,sBAMR;CAAG;AAElC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,YAAY,CAAC"}
|
package/lib/errors.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* unknown-error and parse-error wrappers.
|
|
6
6
|
*/
|
|
7
7
|
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
8
|
-
import * as Schema from "effect/Schema";
|
|
9
8
|
import * as Category from "@distilled.cloud/core/category";
|
|
9
|
+
import * as Schema from "effect/Schema";
|
|
10
10
|
/**
|
|
11
11
|
* Unknown Discord error — returned when a failed response's HTTP status has
|
|
12
12
|
* no mapped error class. `code` is Discord's own JSON error code (e.g. 50001
|
package/lib/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAoB,SAAQ,MAAM,CAAC,WAAW,EAAuB,CAChF,qBAAqB,EACrB;IACE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC,OAAO;CACrB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;CAAG;AAEnC,kCAAkC;AAClC,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,WAAW,EAAqB,CAC5E,mBAAmB,EACnB;IACE,IAAI,EAAE,MAAM,CAAC,OAAO;IACpB,KAAK,EAAE,MAAM,CAAC,OAAO;CACtB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;CAAG"}
|
package/lib/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export * from "./credentials.ts";
|
|
9
9
|
export * from "./errors.ts";
|
|
10
10
|
export * as T from "./traits.ts";
|
|
11
|
-
export { DiscordProtocol, type DiscordOpError, type DiscordOpContext
|
|
11
|
+
export { DiscordProtocol, type DiscordOpError, type DiscordOpContext } from "./protocol.ts";
|
|
12
12
|
export * as Retry from "./retry.ts";
|
|
13
13
|
export * as Services from "./services/index.ts";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export * from "./credentials.js";
|
|
9
9
|
export * from "./errors.js";
|
|
10
10
|
export * as T from "./traits.js";
|
|
11
|
-
export { DiscordProtocol
|
|
11
|
+
export { DiscordProtocol } from "./protocol.js";
|
|
12
12
|
export * as Retry from "./retry.js";
|
|
13
13
|
export * as Services from "./services/index.js";
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAA8C,MAAM,eAAe,CAAC;AAC5F,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC"}
|
package/lib/protocol.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type * as Layer from "effect/Layer";
|
|
2
|
-
import type * as HttpClient from "effect/http/HttpClient";
|
|
3
|
-
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
4
1
|
import type * as API from "@distilled.cloud/core/api";
|
|
5
2
|
import type { ConfigError } from "@distilled.cloud/core/errors";
|
|
3
|
+
import type * as HttpClient from "effect/http/HttpClient";
|
|
4
|
+
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
5
|
+
import type * as Layer from "effect/Layer";
|
|
6
6
|
import { Credentials } from "./credentials.ts";
|
|
7
7
|
import { type DefaultErrors } from "./errors.ts";
|
|
8
8
|
/**
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAiBhE,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAuB,KAAK,aAAa,EAAqB,MAAM,aAAa,CAAC;AAEzF;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,eAAe,CAAC,eAAe,CAAC;AAE3F,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAyCnE,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAqBpD,CAAC"}
|
package/lib/protocol.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { makeRestProtocol } from "@distilled.cloud/core/protocol-rest";
|
|
1
2
|
/**
|
|
2
3
|
* DiscordProtocol — the shared bearer-REST protocol instantiated for Discord.
|
|
3
4
|
*
|
|
@@ -14,9 +15,8 @@
|
|
|
14
15
|
*/
|
|
15
16
|
import * as Effect from "effect/Effect";
|
|
16
17
|
import * as Redacted from "effect/Redacted";
|
|
17
|
-
import { makeRestProtocol, } from "@distilled.cloud/core/protocol-rest";
|
|
18
18
|
import { Credentials } from "./credentials.js";
|
|
19
|
-
import { UnknownDiscordError, DiscordParseError
|
|
19
|
+
import { UnknownDiscordError, DiscordParseError } from "./errors.js";
|
|
20
20
|
/**
|
|
21
21
|
* Discord's error body is `{ code: <numeric JSON error code>, message }`.
|
|
22
22
|
* The OAuth2 token endpoints answer in the OAuth style instead
|
|
@@ -33,9 +33,7 @@ const errorEnvelope = (body) => {
|
|
|
33
33
|
: typeof b.error === "string"
|
|
34
34
|
? b.error
|
|
35
35
|
: undefined;
|
|
36
|
-
const code = typeof b.code === "number" || typeof b.code === "string"
|
|
37
|
-
? b.code
|
|
38
|
-
: undefined;
|
|
36
|
+
const code = typeof b.code === "number" || typeof b.code === "string" ? b.code : undefined;
|
|
39
37
|
return { code, message };
|
|
40
38
|
};
|
|
41
39
|
/** Discord's `errors` object: per-field validation detail on 400s. */
|
package/lib/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAA0B,MAAM,qCAAqC,CAAC;AAC/F;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB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HANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as Retries from "@distilled.cloud/core/retry";
|
|
1
2
|
/**
|
|
2
3
|
* Discord retry surface — a veneer over `@distilled.cloud/core/retry`.
|
|
3
4
|
*
|
|
@@ -17,7 +18,6 @@
|
|
|
17
18
|
*/
|
|
18
19
|
import * as Context from "effect/Context";
|
|
19
20
|
import * as Effect from "effect/Effect";
|
|
20
|
-
import * as Retries from "@distilled.cloud/core/retry";
|
|
21
21
|
export type Options = Retries.Options;
|
|
22
22
|
export type Factory = Retries.Factory;
|
|
23
23
|
export type Policy = Retries.Policy;
|
package/lib/retry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACtC,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACtC,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;;AAEpC,uEAAuE;AACvE,qBAAa,KAAM,SAAQ,UAAgD;CAAG;AAE9E,yEAAyE;AACzE,eAAO,MAAM,MAAM,EAAE;IACnB,CACE,OAAO,EAAE,OAAO,GACf,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EA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CAAC,KAC3B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAoC,CAAC"}
|
package/lib/retry.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as Retries from "@distilled.cloud/core/retry";
|
|
1
2
|
/**
|
|
2
3
|
* Discord retry surface — a veneer over `@distilled.cloud/core/retry`.
|
|
3
4
|
*
|
|
@@ -18,7 +19,6 @@
|
|
|
18
19
|
import * as Context from "effect/Context";
|
|
19
20
|
import * as Effect from "effect/Effect";
|
|
20
21
|
import * as Layer from "effect/Layer";
|
|
21
|
-
import * as Retries from "@distilled.cloud/core/retry";
|
|
22
22
|
/** Context tag for configuring retry behavior of Discord API calls. */
|
|
23
23
|
export class Retry extends Context.Service()("DiscordRetry") {
|
|
24
24
|
}
|
package/lib/retry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAMtC,uEAAuE;AACvE,MAAM,OAAO,KAAM,SAAQ,OAAO,CAAC,OAAO,EAAiB,CAAC,cAAc,CAAC;CAAG;AAE9E,yEAAyE;AACzE,MAAM,CAAC,MAAM,MAAM,GAOf,CAAC,gBAAmC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEpG,sCAAsC;AACtC,MAAM,CAAC,MAAM,IAAI,GAE6B,MAAM,CAAC,OAAO,CAC1D,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAC7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAY,OAAO,CAAC,WAAW,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AACzC,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAErC,mEAAmE;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAAY,OAAO,CAAC,iBAAiB,CAAC;AAEpE,0EAA0E;AAC1E,MAAM,CAAC,MAAM,UAAU,GAEuB,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEhF,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAY,OAAO,CAAC,gBAAgB,CAAC;AAElE,yEAAyE;AACzE,MAAM,CAAC,MAAM,SAAS,GAEwB,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
1
2
|
import * as S from "@distilled.cloud/core/schema";
|
|
2
3
|
import * as Redacted from "effect/Redacted";
|
|
3
|
-
import * as API from "@distilled.cloud/core/api";
|
|
4
4
|
import { type DiscordOpError, type DiscordOpContext } from "../protocol.ts";
|
|
5
5
|
export type { DiscordOpError, DiscordOpContext };
|
|
6
|
+
declare const NotFound_base: S.Class<NotFound, S.TaggedStruct<"NotFound", {
|
|
7
|
+
readonly code: any;
|
|
8
|
+
readonly message: any;
|
|
9
|
+
}>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
|
|
10
|
+
"@distilled.cloud/error/categories": {
|
|
11
|
+
BadRequestError: true;
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
export declare class NotFound extends /*@__PURE__*/ NotFound_base {
|
|
15
|
+
}
|
|
6
16
|
export interface AddGroupDmUserRequest {
|
|
7
17
|
channel_id: string;
|
|
8
18
|
user_id: string;
|
|
@@ -166,6 +176,14 @@ export declare const AddGuildMemberRoleRequest: S.Schema<AddGuildMemberRoleReque
|
|
|
166
176
|
export interface AddGuildMemberRoleResponse {
|
|
167
177
|
}
|
|
168
178
|
export declare const AddGuildMemberRoleResponse: S.Schema<AddGuildMemberRoleResponse>;
|
|
179
|
+
export interface AddInviteTargetUserRequest {
|
|
180
|
+
code: string;
|
|
181
|
+
user_id: string;
|
|
182
|
+
}
|
|
183
|
+
export declare const AddInviteTargetUserRequest: S.Schema<AddInviteTargetUserRequest>;
|
|
184
|
+
export interface AddInviteTargetUserResponse {
|
|
185
|
+
}
|
|
186
|
+
export declare const AddInviteTargetUserResponse: S.Schema<AddInviteTargetUserResponse>;
|
|
169
187
|
export type AddLobbyMemberRequestMetadataMap = {
|
|
170
188
|
[key: string]: string | undefined;
|
|
171
189
|
};
|
|
@@ -244,6 +262,18 @@ export declare const BotPartnerSdkUnmergeProvisionalAccountRequest: S.Schema<Bot
|
|
|
244
262
|
export interface BotPartnerSdkUnmergeProvisionalAccountResponse {
|
|
245
263
|
}
|
|
246
264
|
export declare const BotPartnerSdkUnmergeProvisionalAccountResponse: S.Schema<BotPartnerSdkUnmergeProvisionalAccountResponse>;
|
|
265
|
+
/** The IDs of the users to target. */
|
|
266
|
+
export type BulkAddInviteTargetUsersRequestUserIdsList = Array<string>;
|
|
267
|
+
export declare const BulkAddInviteTargetUsersRequestUserIdsList: S.Schema<BulkAddInviteTargetUsersRequestUserIdsList>;
|
|
268
|
+
export interface BulkAddInviteTargetUsersRequest {
|
|
269
|
+
code: string;
|
|
270
|
+
/** The IDs of the users to target. */
|
|
271
|
+
user_ids: BulkAddInviteTargetUsersRequestUserIdsList;
|
|
272
|
+
}
|
|
273
|
+
export declare const BulkAddInviteTargetUsersRequest: S.Schema<BulkAddInviteTargetUsersRequest>;
|
|
274
|
+
export interface BulkAddInviteTargetUsersResponse {
|
|
275
|
+
}
|
|
276
|
+
export declare const BulkAddInviteTargetUsersResponse: S.Schema<BulkAddInviteTargetUsersResponse>;
|
|
247
277
|
export type BulkBanUsersFromGuildRequestUserIdsList = Array<string>;
|
|
248
278
|
export declare const BulkBanUsersFromGuildRequestUserIdsList: S.Schema<BulkBanUsersFromGuildRequestUserIdsList>;
|
|
249
279
|
export interface BulkBanUsersFromGuildRequest {
|
|
@@ -271,6 +301,18 @@ export declare const BulkDeleteMessagesRequest: S.Schema<BulkDeleteMessagesReque
|
|
|
271
301
|
export interface BulkDeleteMessagesResponse {
|
|
272
302
|
}
|
|
273
303
|
export declare const BulkDeleteMessagesResponse: S.Schema<BulkDeleteMessagesResponse>;
|
|
304
|
+
/** The IDs of the users to stop targeting. */
|
|
305
|
+
export type BulkRemoveInviteTargetUsersRequestUserIdsList = Array<string>;
|
|
306
|
+
export declare const BulkRemoveInviteTargetUsersRequestUserIdsList: S.Schema<BulkRemoveInviteTargetUsersRequestUserIdsList>;
|
|
307
|
+
export interface BulkRemoveInviteTargetUsersRequest {
|
|
308
|
+
code: string;
|
|
309
|
+
/** The IDs of the users to stop targeting. */
|
|
310
|
+
user_ids: BulkRemoveInviteTargetUsersRequestUserIdsList;
|
|
311
|
+
}
|
|
312
|
+
export declare const BulkRemoveInviteTargetUsersRequest: S.Schema<BulkRemoveInviteTargetUsersRequest>;
|
|
313
|
+
export interface BulkRemoveInviteTargetUsersResponse {
|
|
314
|
+
}
|
|
315
|
+
export declare const BulkRemoveInviteTargetUsersResponse: S.Schema<BulkRemoveInviteTargetUsersResponse>;
|
|
274
316
|
export type ApplicationCommandUpdateRequestNameLocalizationsMap = {
|
|
275
317
|
[key: string]: string | undefined;
|
|
276
318
|
};
|
|
@@ -1437,6 +1479,11 @@ export type CreateGuildInviteRequestRoleIdsCase1List = Array<string>;
|
|
|
1437
1479
|
export declare const CreateGuildInviteRequestRoleIdsCase1List: S.Schema<CreateGuildInviteRequestRoleIdsCase1List>;
|
|
1438
1480
|
export type CreateGuildInviteRequestRoleIds = string | CreateGuildInviteRequestRoleIdsCase1List;
|
|
1439
1481
|
export declare const CreateGuildInviteRequestRoleIds: any;
|
|
1482
|
+
export type CreateGuildInviteRequestTargetUserIdsCase1List = Array<string>;
|
|
1483
|
+
export declare const CreateGuildInviteRequestTargetUserIdsCase1List: S.Schema<CreateGuildInviteRequestTargetUserIdsCase1List>;
|
|
1484
|
+
/** The IDs of the users to target with this invite. */
|
|
1485
|
+
export type CreateGuildInviteRequestTargetUserIds = string | CreateGuildInviteRequestTargetUserIdsCase1List;
|
|
1486
|
+
export declare const CreateGuildInviteRequestTargetUserIds: any;
|
|
1440
1487
|
export interface CreateGuildInviteRequest {
|
|
1441
1488
|
max_age?: number | null;
|
|
1442
1489
|
temporary?: boolean | null;
|
|
@@ -1446,6 +1493,8 @@ export interface CreateGuildInviteRequest {
|
|
|
1446
1493
|
target_application_id?: string | null;
|
|
1447
1494
|
target_type?: InviteTargetTypes | (number & {}) | null;
|
|
1448
1495
|
role_ids?: CreateGuildInviteRequestRoleIds | null;
|
|
1496
|
+
/** The IDs of the users to target with this invite. */
|
|
1497
|
+
target_user_ids?: CreateGuildInviteRequestTargetUserIds | null;
|
|
1449
1498
|
}
|
|
1450
1499
|
export declare const CreateGuildInviteRequest: S.Schema<CreateGuildInviteRequest>;
|
|
1451
1500
|
export type CreateChannelInviteRequestBody = CreateGroupDMInviteRequest | CreateGuildInviteRequest;
|
|
@@ -1470,6 +1519,7 @@ export interface InviteChannelResponse {
|
|
|
1470
1519
|
type: ChannelTypes;
|
|
1471
1520
|
name: string | null;
|
|
1472
1521
|
icon?: string;
|
|
1522
|
+
nsfw?: boolean;
|
|
1473
1523
|
recipients?: InviteChannelResponseRecipientsList;
|
|
1474
1524
|
}
|
|
1475
1525
|
export declare const InviteChannelResponse: S.Schema<InviteChannelResponse>;
|
|
@@ -1698,13 +1748,6 @@ export interface ScheduledEventResponse {
|
|
|
1698
1748
|
guild_scheduled_event_exceptions: ScheduledEventResponseGuildScheduledEventExceptionsList;
|
|
1699
1749
|
}
|
|
1700
1750
|
export declare const ScheduledEventResponse: S.Schema<ScheduledEventResponse>;
|
|
1701
|
-
export type GuildLivelinessResponseMsgActivityBinsList = Array<number>;
|
|
1702
|
-
export declare const GuildLivelinessResponseMsgActivityBinsList: S.Schema<GuildLivelinessResponseMsgActivityBinsList>;
|
|
1703
|
-
export interface GuildLivelinessResponse {
|
|
1704
|
-
msg_activity_bins: GuildLivelinessResponseMsgActivityBinsList;
|
|
1705
|
-
last_updated_ts?: string | null;
|
|
1706
|
-
}
|
|
1707
|
-
export declare const GuildLivelinessResponse: S.Schema<GuildLivelinessResponse>;
|
|
1708
1751
|
export interface InviteGuildRoleResponse {
|
|
1709
1752
|
id: string;
|
|
1710
1753
|
name: string;
|
|
@@ -1736,7 +1779,6 @@ export interface GuildInviteResponse {
|
|
|
1736
1779
|
guild_scheduled_event?: ScheduledEventResponse;
|
|
1737
1780
|
target_channel_id?: string;
|
|
1738
1781
|
target_message_id?: string;
|
|
1739
|
-
liveliness?: GuildLivelinessResponse | null;
|
|
1740
1782
|
uses?: number;
|
|
1741
1783
|
max_uses?: number;
|
|
1742
1784
|
temporary?: boolean;
|
|
@@ -2654,7 +2696,6 @@ export interface MessageAttachmentRequest {
|
|
|
2654
2696
|
waveform?: string | null;
|
|
2655
2697
|
title?: string | null;
|
|
2656
2698
|
is_spoiler?: boolean | null;
|
|
2657
|
-
is_remix?: boolean | null;
|
|
2658
2699
|
}
|
|
2659
2700
|
export declare const MessageAttachmentRequest: S.Schema<MessageAttachmentRequest>;
|
|
2660
2701
|
export type IncomingWebhookInteractionRequestAttachmentsList = Array<MessageAttachmentRequest>;
|
|
@@ -6229,6 +6270,7 @@ export interface ListMyGuildsRequest {
|
|
|
6229
6270
|
before?: string;
|
|
6230
6271
|
after?: string;
|
|
6231
6272
|
limit?: number;
|
|
6273
|
+
shard?: number;
|
|
6232
6274
|
with_counts?: boolean;
|
|
6233
6275
|
}
|
|
6234
6276
|
export declare const ListMyGuildsRequest: S.Schema<ListMyGuildsRequest>;
|
|
@@ -6413,6 +6455,14 @@ export interface GuildOnboardingResponse {
|
|
|
6413
6455
|
mode: GuildOnboardingMode;
|
|
6414
6456
|
}
|
|
6415
6457
|
export declare const GuildOnboardingResponse: S.Schema<GuildOnboardingResponse>;
|
|
6458
|
+
export interface RemoveInviteTargetUserRequest {
|
|
6459
|
+
code: string;
|
|
6460
|
+
user_id: string;
|
|
6461
|
+
}
|
|
6462
|
+
export declare const RemoveInviteTargetUserRequest: S.Schema<RemoveInviteTargetUserRequest>;
|
|
6463
|
+
export interface RemoveInviteTargetUserResponse {
|
|
6464
|
+
}
|
|
6465
|
+
export declare const RemoveInviteTargetUserResponse: S.Schema<RemoveInviteTargetUserResponse>;
|
|
6416
6466
|
export interface RevokeInviteRequest {
|
|
6417
6467
|
code: string;
|
|
6418
6468
|
}
|
|
@@ -7489,6 +7539,9 @@ export type AddGuildMemberError = DiscordOpError;
|
|
|
7489
7539
|
export declare const addGuildMember: API.OperationMethod<AddGuildMemberRequest, GuildMemberResponse, AddGuildMemberError, DiscordOpContext>;
|
|
7490
7540
|
export type AddGuildMemberRoleError = DiscordOpError;
|
|
7491
7541
|
export declare const addGuildMemberRole: API.OperationMethod<AddGuildMemberRoleRequest, AddGuildMemberRoleResponse, AddGuildMemberRoleError, DiscordOpContext>;
|
|
7542
|
+
export type AddInviteTargetUserError = DiscordOpError;
|
|
7543
|
+
/** Add a target user to an existing invite. */
|
|
7544
|
+
export declare const addInviteTargetUser: API.OperationMethod<AddInviteTargetUserRequest, AddInviteTargetUserResponse, AddInviteTargetUserError, DiscordOpContext>;
|
|
7492
7545
|
export type AddLobbyMemberError = DiscordOpError;
|
|
7493
7546
|
export declare const addLobbyMember: API.OperationMethod<AddLobbyMemberRequest, LobbyMemberResponse, AddLobbyMemberError, DiscordOpContext>;
|
|
7494
7547
|
export type AddMyMessageReactionError = DiscordOpError;
|
|
@@ -7501,10 +7554,16 @@ export type BotPartnerSdkTokenError = DiscordOpError;
|
|
|
7501
7554
|
export declare const botPartnerSdkToken: API.OperationMethod<BotPartnerSdkTokenRequest, ProvisionalTokenResponse, BotPartnerSdkTokenError, DiscordOpContext>;
|
|
7502
7555
|
export type BotPartnerSdkUnmergeProvisionalAccountError = DiscordOpError;
|
|
7503
7556
|
export declare const botPartnerSdkUnmergeProvisionalAccount: API.OperationMethod<BotPartnerSdkUnmergeProvisionalAccountRequest, BotPartnerSdkUnmergeProvisionalAccountResponse, BotPartnerSdkUnmergeProvisionalAccountError, DiscordOpContext>;
|
|
7557
|
+
export type BulkAddInviteTargetUsersError = DiscordOpError;
|
|
7558
|
+
/** Add multiple target users to an existing invite. */
|
|
7559
|
+
export declare const bulkAddInviteTargetUsers: API.OperationMethod<BulkAddInviteTargetUsersRequest, BulkAddInviteTargetUsersResponse, BulkAddInviteTargetUsersError, DiscordOpContext>;
|
|
7504
7560
|
export type BulkBanUsersFromGuildError = DiscordOpError;
|
|
7505
7561
|
export declare const bulkBanUsersFromGuild: API.OperationMethod<BulkBanUsersFromGuildRequest, BulkBanUsersResponse, BulkBanUsersFromGuildError, DiscordOpContext>;
|
|
7506
7562
|
export type BulkDeleteMessagesError = DiscordOpError;
|
|
7507
7563
|
export declare const bulkDeleteMessages: API.OperationMethod<BulkDeleteMessagesRequest, BulkDeleteMessagesResponse, BulkDeleteMessagesError, DiscordOpContext>;
|
|
7564
|
+
export type BulkRemoveInviteTargetUsersError = DiscordOpError;
|
|
7565
|
+
/** Remove multiple target users from an existing invite. */
|
|
7566
|
+
export declare const bulkRemoveInviteTargetUsers: API.OperationMethod<BulkRemoveInviteTargetUsersRequest, BulkRemoveInviteTargetUsersResponse, BulkRemoveInviteTargetUsersError, DiscordOpContext>;
|
|
7508
7567
|
export type BulkSetApplicationCommandsError = DiscordOpError;
|
|
7509
7568
|
export declare const bulkSetApplicationCommands: API.OperationMethod<BulkSetApplicationCommandsRequest, BulkSetApplicationCommandsResponse, BulkSetApplicationCommandsError, DiscordOpContext>;
|
|
7510
7569
|
export type BulkSetGuildApplicationCommandsError = DiscordOpError;
|
|
@@ -7681,7 +7740,7 @@ export type GetAutoModerationRuleError = DiscordOpError;
|
|
|
7681
7740
|
export declare const getAutoModerationRule: API.OperationMethod<GetAutoModerationRuleRequest, GetAutoModerationRuleResponse, GetAutoModerationRuleError, DiscordOpContext>;
|
|
7682
7741
|
export type GetBotGatewayError = DiscordOpError;
|
|
7683
7742
|
export declare const getBotGateway: API.OperationMethod<GetBotGatewayRequest, GatewayBotResponse, GetBotGatewayError, DiscordOpContext>;
|
|
7684
|
-
export type GetChannelError = DiscordOpError;
|
|
7743
|
+
export type GetChannelError = NotFound | DiscordOpError;
|
|
7685
7744
|
export declare const getChannel: API.OperationMethod<GetChannelRequest, GetChannelResponse, GetChannelError, DiscordOpContext>;
|
|
7686
7745
|
export type GetCurrentUserApplicationEntitlementsError = DiscordOpError;
|
|
7687
7746
|
export declare const getCurrentUserApplicationEntitlements: API.OperationMethod<GetCurrentUserApplicationEntitlementsRequest, GetCurrentUserApplicationEntitlementsResponse, GetCurrentUserApplicationEntitlementsError, DiscordOpContext>;
|
|
@@ -7691,7 +7750,7 @@ export type GetEntitlementsError = DiscordOpError;
|
|
|
7691
7750
|
export declare const getEntitlements: API.OperationMethod<GetEntitlementsRequest, GetEntitlementsResponse, GetEntitlementsError, DiscordOpContext>;
|
|
7692
7751
|
export type GetGatewayError = DiscordOpError;
|
|
7693
7752
|
export declare const getGateway: API.OperationMethod<GetGatewayRequest, GatewayResponse, GetGatewayError, DiscordOpContext>;
|
|
7694
|
-
export type GetGuildError = DiscordOpError;
|
|
7753
|
+
export type GetGuildError = NotFound | DiscordOpError;
|
|
7695
7754
|
export declare const getGuild: API.OperationMethod<GetGuildRequest, GuildWithCountsResponse, GetGuildError, DiscordOpContext>;
|
|
7696
7755
|
export type GetGuildApplicationCommandError = DiscordOpError;
|
|
7697
7756
|
export declare const getGuildApplicationCommand: API.OperationMethod<GetGuildApplicationCommandRequest, ApplicationCommandResponse, GetGuildApplicationCommandError, DiscordOpContext>;
|
|
@@ -7886,6 +7945,9 @@ export type PruneGuildError = DiscordOpError;
|
|
|
7886
7945
|
export declare const pruneGuild: API.OperationMethod<PruneGuildRequest, GuildPruneResponse, PruneGuildError, DiscordOpContext>;
|
|
7887
7946
|
export type PutGuildsOnboardingError = DiscordOpError;
|
|
7888
7947
|
export declare const putGuildsOnboarding: API.OperationMethod<PutGuildsOnboardingRequest, GuildOnboardingResponse, PutGuildsOnboardingError, DiscordOpContext>;
|
|
7948
|
+
export type RemoveInviteTargetUserError = DiscordOpError;
|
|
7949
|
+
/** Remove a target user from an existing invite. */
|
|
7950
|
+
export declare const removeInviteTargetUser: API.OperationMethod<RemoveInviteTargetUserRequest, RemoveInviteTargetUserResponse, RemoveInviteTargetUserError, DiscordOpContext>;
|
|
7889
7951
|
export type RevokeInviteError = DiscordOpError;
|
|
7890
7952
|
export declare const revokeInvite: API.OperationMethod<RevokeInviteRequest, RevokeInviteResponse, RevokeInviteError, DiscordOpContext>;
|
|
7891
7953
|
export type SearchGuildError = DiscordOpError;
|