@absolutejs/auth 0.56.16 → 0.56.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.
@@ -1,2 +1,18 @@
1
1
  import type { AuthConfig } from './types';
2
- export declare const manifest: import("@absolutejs/manifest").PackageManifest<AuthConfig<unknown>, never>;
2
+ export declare const manifest: Omit<import("@absolutejs/manifest").PackageManifest<AuthConfig<unknown>, never>, "contract" | "settings" | "tools"> & (({
3
+ contract: 1;
4
+ tools?: Record<string, import("@absolutejs/manifest").LegacyManifestTool<never>> | undefined;
5
+ } | {
6
+ contract: 2;
7
+ tools?: Record<string, import("@absolutejs/manifest").AuthorizedManifestTool<never>> | undefined;
8
+ }) & {
9
+ settings: import("@sinclair/typebox").TObject<{
10
+ cleanupIntervalMs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
11
+ cookieSecure: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
12
+ maxSessions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
13
+ providersConfiguration: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
14
+ scope: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
15
+ }>>>;
16
+ sessionDurationMs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
17
+ }>;
18
+ });
package/dist/manifest.js CHANGED
@@ -65,14 +65,19 @@ var defineImplementation = () => (implementation) => {
65
65
  const defined = implementation;
66
66
  return defined;
67
67
  };
68
- var defineManifest = () => (manifest) => {
69
- const defined = manifest;
70
- return defined;
68
+ var defineManifest = () => (manifest) => manifest;
69
+ var literal = (value) => value;
70
+ var RUNTIME_KIND = literal("runtime");
71
+ var WORKSPACE_KIND = literal("workspace");
72
+ var toolFactory = () => {
73
+ function runtime(definition) {
74
+ return { kind: RUNTIME_KIND, ...definition };
75
+ }
76
+ function workspace(definition) {
77
+ return { kind: WORKSPACE_KIND, ...definition };
78
+ }
79
+ return { runtime, workspace };
71
80
  };
72
- var toolFactory = () => ({
73
- runtime: (definition) => ({ kind: "runtime", ...definition }),
74
- workspace: (definition) => ({ kind: "workspace", ...definition })
75
- });
76
81
  function IsAsyncIterator(value) {
77
82
  return IsObject(value) && globalThis.Symbol.asyncIterator in value;
78
83
  }
@@ -810,7 +815,7 @@ function String2(options) {
810
815
  function* FromUnion(syntax) {
811
816
  const trim = syntax.trim().replace(/"|'/g, "");
812
817
  return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt2() : trim === "string" ? yield String2() : yield (() => {
813
- const literals = trim.split("|").map((literal) => Literal(literal.trim()));
818
+ const literals = trim.split("|").map((literal2) => Literal(literal2.trim()));
814
819
  return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
815
820
  })();
816
821
  }
@@ -3518,10 +3523,10 @@ function ScoreUnion(schema, references, value) {
3518
3523
  const keys = Object.getOwnPropertyNames(value);
3519
3524
  const entries = Object.entries(object.properties);
3520
3525
  return entries.reduce((acc, [key, schema2]) => {
3521
- const literal = schema2[Kind] === "Literal" && schema2.const === value[key] ? 100 : 0;
3526
+ const literal2 = schema2[Kind] === "Literal" && schema2.const === value[key] ? 100 : 0;
3522
3527
  const checks = Check(schema2, references, value[key]) ? 10 : 0;
3523
3528
  const exists = keys.includes(key) ? 1 : 0;
3524
- return acc + (literal + checks + exists);
3529
+ return acc + (literal2 + checks + exists);
3525
3530
  }, 0);
3526
3531
  } else if (schema[Kind] === "Union") {
3527
3532
  const schemas = schema.anyOf.map((schema2) => Deref(schema2, references));
@@ -5858,7 +5863,13 @@ var wiringSnippet = Type.Object({
5858
5863
  Type.Literal("server-plugin")
5859
5864
  ]))
5860
5865
  });
5861
- var clientFrameworks = ["angular", "client", "react", "svelte", "vue"];
5866
+ var clientFrameworks = [
5867
+ "angular",
5868
+ "client",
5869
+ "react",
5870
+ "svelte",
5871
+ "vue"
5872
+ ];
5862
5873
  var wiringRecipe = Type.Object({
5863
5874
  client: Type.Optional(Type.Partial(Type.Object(Object.fromEntries(clientFrameworks.map((framework) => [framework, wiringSnippet]))))),
5864
5875
  description: Type.Optional(Type.String()),
@@ -5924,16 +5935,36 @@ var toolAnnotations = Type.Object({
5924
5935
  title: Type.Optional(Type.String())
5925
5936
  });
5926
5937
  var toolAuthorization = Type.Object({
5927
- approval: Type.Optional(Type.Union([
5938
+ approval: Type.Union([
5928
5939
  Type.Literal("always"),
5929
5940
  Type.Literal("never"),
5930
5941
  Type.Literal("policy")
5931
- ])),
5942
+ ]),
5943
+ audience: Type.Union([
5944
+ Type.Literal("admin"),
5945
+ Type.Literal("authenticated"),
5946
+ Type.Literal("owner"),
5947
+ Type.Literal("public")
5948
+ ]),
5932
5949
  compensatingTool: Type.Optional(Type.String({ pattern: TOOL_NAME_PATTERN.source })),
5933
- destinations: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),
5950
+ destinationFields: Type.Optional(Type.Array(Type.String({ minLength: 1 }), { minItems: 1 })),
5951
+ destinations: Type.Optional(Type.Array(Type.String({ minLength: 1 }), { minItems: 1 })),
5934
5952
  effects: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),
5935
- idempotencyKeyField: Type.Optional(Type.String({ minLength: 1 })),
5936
- requiredScopes: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),
5953
+ idempotency: Type.Optional(Type.Union([
5954
+ Type.Object({
5955
+ field: Type.String({ minLength: 1 }),
5956
+ mode: Type.Literal("field")
5957
+ }),
5958
+ Type.Object({ mode: Type.Literal("host") }),
5959
+ Type.Object({ mode: Type.Literal("resource") })
5960
+ ])),
5961
+ requiredScopes: Type.Optional(Type.Array(Type.String({ minLength: 1 }), { minItems: 1 })),
5962
+ resource: Type.Optional(Type.Object({
5963
+ idField: Type.Optional(Type.String({ minLength: 1 })),
5964
+ ownerIdField: Type.Optional(Type.String({ minLength: 1 })),
5965
+ tenantIdField: Type.Optional(Type.String({ minLength: 1 })),
5966
+ type: Type.String({ minLength: 1 })
5967
+ })),
5937
5968
  reversible: Type.Optional(Type.Boolean()),
5938
5969
  spend: Type.Optional(Type.Object({
5939
5970
  amountMinorField: Type.String({ minLength: 1 }),
@@ -5973,7 +6004,9 @@ var manifestSchema = Type.Object({
5973
6004
  svg: Type.Optional(Type.String()),
5974
6005
  url: Type.Optional(Type.String())
5975
6006
  })),
5976
- name: Type.String({ pattern: "^(@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$" }),
6007
+ name: Type.String({
6008
+ pattern: "^(@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$"
6009
+ }),
5977
6010
  tagline: Type.String({ minLength: 1 })
5978
6011
  }),
5979
6012
  implements: Type.Optional(Type.Array(adapterImplementation)),
@@ -6946,7 +6979,7 @@ function String3(options) {
6946
6979
  function* FromUnion21(syntax) {
6947
6980
  const trim = syntax.trim().replace(/"|'/g, "");
6948
6981
  return trim === "boolean" ? yield Boolean2() : trim === "number" ? yield Number3() : trim === "bigint" ? yield BigInt3() : trim === "string" ? yield String3() : yield (() => {
6949
- const literals = trim.split("|").map((literal) => Literal2(literal.trim()));
6982
+ const literals = trim.split("|").map((literal2) => Literal2(literal2.trim()));
6950
6983
  return literals.length === 0 ? Never2() : literals.length === 1 ? literals[0] : UnionEvaluated2(literals);
6951
6984
  })();
6952
6985
  }
@@ -8752,6 +8785,12 @@ var manifest = defineManifest()({
8752
8785
  tools: {
8753
8786
  list_sign_in_providers: tool.workspace({
8754
8787
  annotations: { readOnlyHint: true },
8788
+ authorization: {
8789
+ approval: "never",
8790
+ audience: "admin",
8791
+ effects: ["read"],
8792
+ requiredScopes: ["auth:inspect"]
8793
+ },
8755
8794
  capabilities: ["read", "glob"],
8756
8795
  description: "List which sign-in providers this project has configured, and which are missing credentials.",
8757
8796
  input: Type2.Object({}),
@@ -8801,5 +8840,5 @@ export {
8801
8840
  manifest
8802
8841
  };
8803
8842
 
8804
- //# debugId=2E4F9C3AC2D022D864756E2164756E21
8843
+ //# debugId=50377C17887E5CEE64756E2164756E21
8805
8844
  //# sourceMappingURL=manifest.js.map