@sentry/junior-plugin-api 0.295.0 → 0.296.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 (2) hide show
  1. package/dist/index.d.ts +54 -1
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1927,6 +1927,57 @@ export type PluginGitPush = {
1927
1927
  kind: "unreadable";
1928
1928
  reason: PluginGitPushUnreadableReason;
1929
1929
  };
1930
+ /** One field that a GraphQL operation selects. */
1931
+ export interface PluginGraphqlField {
1932
+ /** Names of the arguments that the field passes. */
1933
+ arguments: string[];
1934
+ /** Schema field name. An alias does not replace it. */
1935
+ name: string;
1936
+ }
1937
+ /** The GraphQL operation that one request runs. */
1938
+ export interface PluginGraphqlOperation {
1939
+ /**
1940
+ * Each distinct field that the operation selects at any depth, also through
1941
+ * fragments.
1942
+ */
1943
+ fields: PluginGraphqlField[];
1944
+ name?: string;
1945
+ /**
1946
+ * Field names at the operation root, also through fragments. There is one
1947
+ * entry for each field selection, so an aliased repeat shows twice.
1948
+ */
1949
+ rootFields: string[];
1950
+ type: "mutation" | "query" | "subscription";
1951
+ }
1952
+ /**
1953
+ * Why the host could not read the operation of a GraphQL request:
1954
+ *
1955
+ * - `document`: the query does not parse, or it spreads a fragment that it
1956
+ * does not define.
1957
+ * - `gzip`: the body is compressed.
1958
+ * - `json`: the body is not a JSON object or a JSON array of objects.
1959
+ * - `operation`: `operationName` names no operation, or the document has more
1960
+ * than one operation and no `operationName`.
1961
+ * - `query`: the body has no `query` string, such as a persisted query hash.
1962
+ * - `too-large`: the body is larger than the host reads before it issues
1963
+ * credentials.
1964
+ */
1965
+ export type PluginGraphqlUnreadableReason = "document" | "gzip" | "json" | "operation" | "query" | "too-large";
1966
+ /**
1967
+ * The operations of a GraphQL POST, which the host reads from the JSON body.
1968
+ * A `batch` is a JSON array of requests. An `unreadable` request can run any
1969
+ * operation, mutations included.
1970
+ */
1971
+ export type PluginGraphqlRequest = {
1972
+ kind: "batch";
1973
+ operations: PluginGraphqlOperation[];
1974
+ } | {
1975
+ kind: "operation";
1976
+ operation: PluginGraphqlOperation;
1977
+ } | {
1978
+ kind: "unreadable";
1979
+ reason: PluginGraphqlUnreadableReason;
1980
+ };
1930
1981
  /** Request details available while selecting the grant for sandbox egress. */
1931
1982
  export interface PluginEgressRequest {
1932
1983
  /**
@@ -1936,6 +1987,8 @@ export interface PluginEgressRequest {
1936
1987
  bodyText?: string;
1937
1988
  /** Set for every Git `git-receive-pack` POST. */
1938
1989
  gitPush?: PluginGitPush;
1990
+ /** Set for every POST to a URL path that ends in `/graphql`. */
1991
+ graphql?: PluginGraphqlRequest;
1939
1992
  method: string;
1940
1993
  /** Plugin-declared operation this request performs, used for grant classification and diagnostics. */
1941
1994
  operation?: string;
@@ -1953,7 +2006,7 @@ export interface PluginEgressResponse {
1953
2006
  export interface EgressResponseHookContext extends PluginContext {
1954
2007
  grant: PluginGrant;
1955
2008
  permissionDenied(message: string): void;
1956
- request: Omit<PluginEgressRequest, "bodyText" | "gitPush">;
2009
+ request: Omit<PluginEgressRequest, "bodyText" | "gitPush" | "graphql">;
1957
2010
  response: PluginEgressResponse;
1958
2011
  }
1959
2012
  /** Header mutations a plugin-issued credential lease may apply to owned domains. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-plugin-api",
3
- "version": "0.295.0",
3
+ "version": "0.296.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"