@auth0/ai 3.1.0 → 3.2.1
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/cjs/authorizers/types.js +10 -1
- package/dist/cjs/authorizers/types.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/authorizers/types.d.ts +18 -4
- package/dist/esm/authorizers/types.js +10 -1
- package/dist/esm/authorizers/types.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,16 @@ const zod_1 = require("zod");
|
|
|
5
5
|
exports.Auth0ClientSchema = zod_1.z.object({
|
|
6
6
|
domain: zod_1.z.string().default(() => process.env.AUTH0_DOMAIN),
|
|
7
7
|
clientId: zod_1.z.string().default(() => process.env.AUTH0_CLIENT_ID),
|
|
8
|
-
clientSecret: zod_1.z
|
|
8
|
+
clientSecret: zod_1.z
|
|
9
|
+
.union([zod_1.z.string(), zod_1.z.undefined()])
|
|
10
|
+
.transform((v) => v !== null && v !== void 0 ? v : process.env.AUTH0_CLIENT_SECRET),
|
|
11
|
+
telemetry: zod_1.z.boolean().optional(),
|
|
12
|
+
clientInfo: zod_1.z
|
|
13
|
+
.object({
|
|
14
|
+
name: zod_1.z.string(),
|
|
15
|
+
})
|
|
16
|
+
.passthrough()
|
|
17
|
+
.optional(),
|
|
9
18
|
});
|
|
10
19
|
exports.Auth0PublicClientSchema = zod_1.z.object({
|
|
11
20
|
domain: zod_1.z.string().default(() => process.env.AUTH0_DOMAIN),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/authorizers/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/authorizers/types.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAcX,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,YAAa,CAAC;IAC3D,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAgB,CAAC;IAChE,YAAY,EAAE,OAAC;SACZ,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,SAAS,EAAE,CAAC,CAAC;SAClC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,cAAD,CAAC,GAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IACzD,SAAS,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,OAAC;SACV,MAAM,CAAC;QACN,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;KACjB,CAAC;SACD,WAAW,EAAE;SACb,QAAQ,EAAE;CACd,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,YAAa,CAAC;IAC3D,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAgB,CAAC;CACjE,CAAC,CAAC","sourcesContent":["import * as jose from \"jose\";\nimport { z } from \"zod\";\n\nexport type AuthParams = {\n allowed?: boolean;\n accessToken?: string;\n claims?: jose.JWTPayload;\n};\n\nexport type ToolWithAuthHandler<I, O, C> = (\n authParams: AuthParams,\n input: I,\n config?: C\n) => Promise<O>;\n\nexport const Auth0ClientSchema = z.object({\n domain: z.string().default(() => process.env.AUTH0_DOMAIN!),\n clientId: z.string().default(() => process.env.AUTH0_CLIENT_ID!),\n clientSecret: z\n .union([z.string(), z.undefined()])\n .transform((v) => v ?? process.env.AUTH0_CLIENT_SECRET),\n telemetry: z.boolean().optional(),\n clientInfo: z\n .object({\n name: z.string(),\n })\n .passthrough()\n .optional(),\n});\n\nexport const Auth0PublicClientSchema = z.object({\n domain: z.string().default(() => process.env.AUTH0_DOMAIN!),\n clientId: z.string().default(() => process.env.AUTH0_CLIENT_ID!),\n});\n\nexport type Auth0ClientParams = z.infer<typeof Auth0ClientSchema>;\nexport type Auth0PublicClientParams = z.infer<typeof Auth0PublicClientSchema>;\n\nexport type OnAuthorizationRequest = \"block\" | \"interrupt\";\n"]}
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,2CAAyB;AACzB,+DAA6C;AAC7C,+DAA6C;AAC7C,+CAA6B","sourcesContent":["export type { AuthParams,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,2CAAyB;AACzB,+DAA6C;AAC7C,+DAA6C;AAC7C,+CAA6B","sourcesContent":["export type { AuthParams, Auth0ClientParams } from \"./authorizers/types\";\nexport type * from \"./credentials\";\nexport * from \"./errors\";\nexport * from \"./authorizers/fga/fga-filter\";\nexport * from \"./authorizers/fga/fga-client\";\nexport * from \"./parameters\";\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AuthenticationClientOptions } from "auth0";
|
|
2
1
|
import * as jose from "jose";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
export type AuthParams = {
|
|
@@ -10,15 +9,31 @@ export type ToolWithAuthHandler<I, O, C> = (authParams: AuthParams, input: I, co
|
|
|
10
9
|
export declare const Auth0ClientSchema: z.ZodObject<{
|
|
11
10
|
domain: z.ZodDefault<z.ZodString>;
|
|
12
11
|
clientId: z.ZodDefault<z.ZodString>;
|
|
13
|
-
clientSecret: z.
|
|
12
|
+
clientSecret: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodUndefined]>, string | undefined, string | undefined>;
|
|
13
|
+
telemetry: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
clientInfo: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
14
21
|
}, "strip", z.ZodTypeAny, {
|
|
15
22
|
domain: string;
|
|
16
23
|
clientId: string;
|
|
17
|
-
clientSecret
|
|
24
|
+
clientSecret?: string | undefined;
|
|
25
|
+
telemetry?: boolean | undefined;
|
|
26
|
+
clientInfo?: z.objectOutputType<{
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
18
29
|
}, {
|
|
19
30
|
domain?: string | undefined;
|
|
20
31
|
clientId?: string | undefined;
|
|
21
32
|
clientSecret?: string | undefined;
|
|
33
|
+
telemetry?: boolean | undefined;
|
|
34
|
+
clientInfo?: z.objectInputType<{
|
|
35
|
+
name: z.ZodString;
|
|
36
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
22
37
|
}>;
|
|
23
38
|
export declare const Auth0PublicClientSchema: z.ZodObject<{
|
|
24
39
|
domain: z.ZodDefault<z.ZodString>;
|
|
@@ -32,6 +47,5 @@ export declare const Auth0PublicClientSchema: z.ZodObject<{
|
|
|
32
47
|
}>;
|
|
33
48
|
export type Auth0ClientParams = z.infer<typeof Auth0ClientSchema>;
|
|
34
49
|
export type Auth0PublicClientParams = z.infer<typeof Auth0PublicClientSchema>;
|
|
35
|
-
export type AuthorizerParams = Pick<AuthenticationClientOptions, "domain" | "clientId" | "clientSecret">;
|
|
36
50
|
export type OnAuthorizationRequest = "block" | "interrupt";
|
|
37
51
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -2,7 +2,16 @@ import { z } from "zod";
|
|
|
2
2
|
export const Auth0ClientSchema = z.object({
|
|
3
3
|
domain: z.string().default(() => process.env.AUTH0_DOMAIN),
|
|
4
4
|
clientId: z.string().default(() => process.env.AUTH0_CLIENT_ID),
|
|
5
|
-
clientSecret: z
|
|
5
|
+
clientSecret: z
|
|
6
|
+
.union([z.string(), z.undefined()])
|
|
7
|
+
.transform((v) => v !== null && v !== void 0 ? v : process.env.AUTH0_CLIENT_SECRET),
|
|
8
|
+
telemetry: z.boolean().optional(),
|
|
9
|
+
clientInfo: z
|
|
10
|
+
.object({
|
|
11
|
+
name: z.string(),
|
|
12
|
+
})
|
|
13
|
+
.passthrough()
|
|
14
|
+
.optional(),
|
|
6
15
|
});
|
|
7
16
|
export const Auth0PublicClientSchema = z.object({
|
|
8
17
|
domain: z.string().default(() => process.env.AUTH0_DOMAIN),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/authorizers/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/authorizers/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,YAAa,CAAC;IAC3D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAgB,CAAC;IAChE,YAAY,EAAE,CAAC;SACZ,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;SAClC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,cAAD,CAAC,GAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IACzD,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC;SACV,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB,CAAC;SACD,WAAW,EAAE;SACb,QAAQ,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,YAAa,CAAC;IAC3D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAgB,CAAC;CACjE,CAAC,CAAC","sourcesContent":["import * as jose from \"jose\";\nimport { z } from \"zod\";\n\nexport type AuthParams = {\n allowed?: boolean;\n accessToken?: string;\n claims?: jose.JWTPayload;\n};\n\nexport type ToolWithAuthHandler<I, O, C> = (\n authParams: AuthParams,\n input: I,\n config?: C\n) => Promise<O>;\n\nexport const Auth0ClientSchema = z.object({\n domain: z.string().default(() => process.env.AUTH0_DOMAIN!),\n clientId: z.string().default(() => process.env.AUTH0_CLIENT_ID!),\n clientSecret: z\n .union([z.string(), z.undefined()])\n .transform((v) => v ?? process.env.AUTH0_CLIENT_SECRET),\n telemetry: z.boolean().optional(),\n clientInfo: z\n .object({\n name: z.string(),\n })\n .passthrough()\n .optional(),\n});\n\nexport const Auth0PublicClientSchema = z.object({\n domain: z.string().default(() => process.env.AUTH0_DOMAIN!),\n clientId: z.string().default(() => process.env.AUTH0_CLIENT_ID!),\n});\n\nexport type Auth0ClientParams = z.infer<typeof Auth0ClientSchema>;\nexport type Auth0PublicClientParams = z.infer<typeof Auth0PublicClientSchema>;\n\nexport type OnAuthorizationRequest = \"block\" | \"interrupt\";\n"]}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC","sourcesContent":["export type { AuthParams,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC","sourcesContent":["export type { AuthParams, Auth0ClientParams } from \"./authorizers/types\";\nexport type * from \"./credentials\";\nexport * from \"./errors\";\nexport * from \"./authorizers/fga/fga-filter\";\nexport * from \"./authorizers/fga/fga-client\";\nexport * from \"./parameters\";\n"]}
|