@m1212e/rumble 0.16.16 → 0.16.18
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/out/index.cjs +115 -39
- package/out/index.cjs.map +1 -1
- package/out/index.d.cts +45 -27
- package/out/index.d.cts.map +1 -1
- package/out/index.d.mts +45 -27
- package/out/index.d.mts.map +1 -1
- package/out/index.mjs +114 -39
- package/out/index.mjs.map +1 -1
- package/package.json +5 -1
package/out/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="urlpattern-polyfill" />
|
|
2
2
|
import { GraphQLError } from "graphql";
|
|
3
|
+
import { Tracer } from "@opentelemetry/api";
|
|
4
|
+
import { TracingWrapperOptions } from "@pothos/tracing-opentelemetry";
|
|
3
5
|
import * as graphql_yoga0 from "graphql-yoga";
|
|
4
6
|
import { YogaServerOptions, createPubSub } from "graphql-yoga";
|
|
5
7
|
import { useSofa } from "sofa-api";
|
|
@@ -4280,6 +4282,23 @@ type RumbleInput<UserContext extends Record<string, any>, DB extends DrizzleInst
|
|
|
4280
4282
|
*/
|
|
4281
4283
|
cpu_operator_cost?: number;
|
|
4282
4284
|
} | undefined;
|
|
4285
|
+
/**
|
|
4286
|
+
* rumble can set up otel tracing if you want to. This will provide details of execution time and outcome to the provided tracer. See https://pothos-graphql.dev/docs/plugins/tracing#install for more information.
|
|
4287
|
+
*/
|
|
4288
|
+
otel?: {
|
|
4289
|
+
/**
|
|
4290
|
+
* Whether otel tracing should be enabled. This will create a tracer if none is provided.
|
|
4291
|
+
*/
|
|
4292
|
+
enabled?: boolean;
|
|
4293
|
+
/**
|
|
4294
|
+
* The tracer to use. If enabled is true and no tracer is provided, a tracer will be created.
|
|
4295
|
+
*/
|
|
4296
|
+
tracer?: Tracer;
|
|
4297
|
+
/**
|
|
4298
|
+
* You can pass options to the tracing wrapper
|
|
4299
|
+
*/
|
|
4300
|
+
options?: TracingWrapperOptions<unknown>;
|
|
4301
|
+
};
|
|
4283
4302
|
};
|
|
4284
4303
|
//#endregion
|
|
4285
4304
|
//#region lib/rumble.d.ts
|
|
@@ -4294,8 +4313,7 @@ declare const rumble: <UserContext extends Record<string, any>, DB extends Drizz
|
|
|
4294
4313
|
abilityBuilder.users
|
|
4295
4314
|
.allow(["read", "update", "delete"])
|
|
4296
4315
|
.when(({ userId }) => ({ where: eq(schema.users.id, userId) }));
|
|
4297
|
-
|
|
4298
|
-
// everyone can read posts
|
|
4316
|
+
// everyone can read posts
|
|
4299
4317
|
abilityBuilder.posts.allow("read");
|
|
4300
4318
|
*
|
|
4301
4319
|
* ```
|
|
@@ -4394,20 +4412,19 @@ declare const rumble: <UserContext extends Record<string, any>, DB extends Drizz
|
|
|
4394
4412
|
DefaultFieldNullability: false;
|
|
4395
4413
|
}>>;
|
|
4396
4414
|
/**
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
*/
|
|
4415
|
+
* Creates the native yoga instance. Can be used to run an actual HTTP server.
|
|
4416
|
+
*
|
|
4417
|
+
* @example
|
|
4418
|
+
*
|
|
4419
|
+
* ```ts
|
|
4420
|
+
* import { createServer } from "node:http";
|
|
4421
|
+
* const server = createServer(createYoga());
|
|
4422
|
+
* server.listen(3000, () => {
|
|
4423
|
+
* console.info("Visit http://localhost:3000/graphql");
|
|
4424
|
+
* });
|
|
4425
|
+
* ```
|
|
4426
|
+
* https://the-guild.dev/graphql/yoga-server/docs#server
|
|
4427
|
+
*/
|
|
4411
4428
|
createYoga: (args?: (Omit<YogaServerOptions<RequestEvent, any>, "schema" | "context"> & {
|
|
4412
4429
|
/**
|
|
4413
4430
|
* Determines if the API should disclose various things about its structure.
|
|
@@ -4418,17 +4435,18 @@ declare const rumble: <UserContext extends Record<string, any>, DB extends Drizz
|
|
|
4418
4435
|
enableApiDocs?: boolean;
|
|
4419
4436
|
}) | undefined) => graphql_yoga0.YogaServerInstance<RequestEvent, {}>;
|
|
4420
4437
|
/**
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4438
|
+
* Creates a sofa instance to offer a REST API.
|
|
4439
|
+
*
|
|
4440
|
+
* ```ts
|
|
4441
|
+
* import express from "express";
|
|
4442
|
+
*
|
|
4443
|
+
* const app = express();
|
|
4444
|
+
* const sofa = createSofa(...);
|
|
4445
|
+
*
|
|
4446
|
+
* app.use("/api", useSofa({ schema }));
|
|
4447
|
+
* ```
|
|
4448
|
+
* https://the-guild.dev/graphql/sofa-api/docs#usage
|
|
4449
|
+
*/
|
|
4432
4450
|
createSofa: (args: Omit<Parameters<typeof useSofa>[0], "schema" | "context">) => Router<any, {}, {
|
|
4433
4451
|
[TKey: string]: never;
|
|
4434
4452
|
}>;
|