@homeflare/alchemy 0.41.0 → 0.43.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 (115) hide show
  1. package/dist/litellm/budget-errors.d.ts +36 -0
  2. package/dist/litellm/budget-errors.d.ts.map +1 -0
  3. package/dist/litellm/budget-form.d.ts +50 -0
  4. package/dist/litellm/budget-form.d.ts.map +1 -0
  5. package/dist/litellm/budget-operations.d.ts +20 -0
  6. package/dist/litellm/budget-operations.d.ts.map +1 -0
  7. package/dist/litellm/budget.d.ts +61 -0
  8. package/dist/litellm/budget.d.ts.map +1 -0
  9. package/dist/litellm/fake-litellm.d.ts +5 -0
  10. package/dist/litellm/fake-litellm.d.ts.map +1 -1
  11. package/dist/litellm/index.d.ts +2 -0
  12. package/dist/litellm/index.d.ts.map +1 -1
  13. package/dist/litellm/index.js +125 -2
  14. package/dist/litellm/index.js.map +9 -5
  15. package/dist/litellm/operations.d.ts +22 -0
  16. package/dist/litellm/operations.d.ts.map +1 -1
  17. package/dist/litellm/providers.d.ts +1 -1
  18. package/dist/litellm/providers.d.ts.map +1 -1
  19. package/dist/openbao/auth-role-form.d.ts +9 -0
  20. package/dist/openbao/auth-role-form.d.ts.map +1 -1
  21. package/dist/openbao/auth-role-wire.d.ts.map +1 -1
  22. package/dist/openbao/fake-engines-roles.d.ts.map +1 -1
  23. package/dist/openbao/index.js +9 -6
  24. package/dist/openbao/index.js.map +4 -4
  25. package/dist/postgres/connection.d.ts +20 -2
  26. package/dist/postgres/connection.d.ts.map +1 -1
  27. package/dist/postgres/database-sql.d.ts +1 -1
  28. package/dist/postgres/database-sql.d.ts.map +1 -1
  29. package/dist/postgres/database.d.ts +1 -1
  30. package/dist/postgres/database.d.ts.map +1 -1
  31. package/dist/postgres/index.d.ts +5 -3
  32. package/dist/postgres/index.d.ts.map +1 -1
  33. package/dist/postgres/index.js +124 -38
  34. package/dist/postgres/index.js.map +8 -7
  35. package/dist/postgres/providers.d.ts +4 -2
  36. package/dist/postgres/providers.d.ts.map +1 -1
  37. package/dist/postgres/psql-executor.d.ts +21 -0
  38. package/dist/postgres/psql-executor.d.ts.map +1 -0
  39. package/dist/proxmox/acl.d.ts.map +1 -1
  40. package/dist/proxmox/api-token.d.ts.map +1 -1
  41. package/dist/proxmox/ceph-flag-types.d.ts +57 -0
  42. package/dist/proxmox/ceph-flag-types.d.ts.map +1 -0
  43. package/dist/proxmox/ceph-flag-wire.d.ts +77 -0
  44. package/dist/proxmox/ceph-flag-wire.d.ts.map +1 -0
  45. package/dist/proxmox/ceph-flag.d.ts +15 -50
  46. package/dist/proxmox/ceph-flag.d.ts.map +1 -1
  47. package/dist/proxmox/ceph-osd-write.d.ts +10 -13
  48. package/dist/proxmox/ceph-osd-write.d.ts.map +1 -1
  49. package/dist/proxmox/credential-errors.d.ts +18 -4
  50. package/dist/proxmox/credential-errors.d.ts.map +1 -1
  51. package/dist/proxmox/credentials.d.ts +35 -1
  52. package/dist/proxmox/credentials.d.ts.map +1 -1
  53. package/dist/proxmox/group.d.ts.map +1 -1
  54. package/dist/proxmox/index.js +805 -757
  55. package/dist/proxmox/index.js.map +21 -19
  56. package/dist/proxmox/lease-cache.d.ts +67 -5
  57. package/dist/proxmox/lease-cache.d.ts.map +1 -1
  58. package/dist/proxmox/mint.d.ts +4 -2
  59. package/dist/proxmox/mint.d.ts.map +1 -1
  60. package/dist/proxmox/node-network.d.ts.map +1 -1
  61. package/dist/proxmox/role.d.ts.map +1 -1
  62. package/dist/proxmox/storage.d.ts.map +1 -1
  63. package/dist/proxmox/unreadable-read.d.ts +8 -1
  64. package/dist/proxmox/unreadable-read.d.ts.map +1 -1
  65. package/dist/proxmox/user.d.ts.map +1 -1
  66. package/dist/proxmox/zfs-pool.d.ts.map +1 -1
  67. package/docs/credentials.md +14 -1
  68. package/docs/litellm-budget.md +55 -0
  69. package/docs/litellm.md +7 -6
  70. package/docs/postgres.md +22 -0
  71. package/docs/proxmox-sdk-migration.md +45 -0
  72. package/package.json +3 -3
  73. package/src/litellm/budget-errors.ts +38 -0
  74. package/src/litellm/budget-form.ts +94 -0
  75. package/src/litellm/budget-operations.ts +51 -0
  76. package/src/litellm/budget.test.ts +105 -0
  77. package/src/litellm/budget.ts +127 -0
  78. package/src/litellm/fake-litellm.ts +50 -1
  79. package/src/litellm/index.ts +13 -0
  80. package/src/litellm/operations.ts +1 -1
  81. package/src/litellm/providers.ts +4 -1
  82. package/src/openbao/auth-role-form.test.ts +37 -0
  83. package/src/openbao/auth-role-form.ts +12 -1
  84. package/src/openbao/auth-role-wire.test.ts +1 -0
  85. package/src/openbao/auth-role-wire.ts +13 -1
  86. package/src/openbao/distilled-retry.test.ts +1 -0
  87. package/src/openbao/fake-engines-roles.ts +7 -1
  88. package/src/postgres/connection.ts +37 -3
  89. package/src/postgres/database-sql.ts +4 -3
  90. package/src/postgres/database.ts +3 -2
  91. package/src/postgres/index.ts +10 -3
  92. package/src/postgres/providers.ts +15 -2
  93. package/src/postgres/psql-executor.test.ts +106 -0
  94. package/src/postgres/psql-executor.ts +130 -0
  95. package/src/proxmox/acl.ts +7 -1
  96. package/src/proxmox/api-token.ts +7 -1
  97. package/src/proxmox/ceph-flag-types.ts +70 -0
  98. package/src/proxmox/ceph-flag-wire.test.ts +72 -0
  99. package/src/proxmox/ceph-flag-wire.ts +123 -0
  100. package/src/proxmox/ceph-flag.ts +77 -130
  101. package/src/proxmox/ceph-osd-write.ts +10 -13
  102. package/src/proxmox/credential-errors.ts +19 -5
  103. package/src/proxmox/credentials.test.ts +73 -1
  104. package/src/proxmox/credentials.ts +72 -1
  105. package/src/proxmox/group.ts +7 -1
  106. package/src/proxmox/lease-cache-mint.test.ts +70 -0
  107. package/src/proxmox/lease-cache.test.ts +83 -7
  108. package/src/proxmox/lease-cache.ts +74 -10
  109. package/src/proxmox/mint.ts +12 -5
  110. package/src/proxmox/node-network.ts +7 -1
  111. package/src/proxmox/role.ts +7 -1
  112. package/src/proxmox/storage.ts +7 -1
  113. package/src/proxmox/unreadable-read.ts +16 -4
  114. package/src/proxmox/user.ts +7 -1
  115. package/src/proxmox/zfs-pool.ts +7 -1
@@ -34,6 +34,28 @@ import * as Effect from 'effect/Effect';
34
34
  export type { LitellmOpContext } from '@distilled.cloud/litellm/Protocol';
35
35
  export type LitellmRequirements = LitellmOpContext;
36
36
  export type { PassThroughEndpointResponse, PassThroughGenericEndpoint, PassThroughGuardrailSettings, } from '@distilled.cloud/litellm/misc';
37
+ /**
38
+ * Serialises a write against this call's own base URL — see the file header.
39
+ *
40
+ * ⚠️ `Credentials` itself ends in `Effect.orDie` on a missing/misspelled env var (Q6, decision
41
+ * 49 "upstream wins", 2026-09-24, matching distilled's own convention — 73 of 80 packages'
42
+ * `credentials.ts` do the same at `homeflare/base`), so resolving it here can no longer fail
43
+ * typed. The `| ConfigError` this function still adds to its return type stays only because
44
+ * `@distilled.cloud/litellm`'s own `LitellmOpError` (protocol.ts) unconditionally declares
45
+ * `ConfigError` as a member of every generated operation's error union regardless of
46
+ * `Credentials`'s own type — so `E` (the wrapped operation's error) already contains it, and
47
+ * this widening is a genuine no-op for callers, not dead type-state left over from the revert.
48
+ */
49
+ /**
50
+ * ⛔ THE STACK'S AMBIENT `HttpClient` MAY BE CADDY'S. `caddyProviders()` provideMerges a client
51
+ * that dials the admin listener and ignores the request host (`caddy-http-client.ts`). Measured
52
+ * 2026-09-25: that client answers `GET /config/pass_through_endpoint` with HTTP 200 `null`
53
+ * (Caddy's empty-config body). The decoded value then has no `endpoints`, and `locate` throws
54
+ * `rows.find` of undefined. FetchHttpClient uses the URL the LiteLLM protocol built. An outer
55
+ * `Fetch` service still wins inside that client, which is how the fake proxy stays the test
56
+ * transport.
57
+ */
58
+ export declare const throughFetch: <A, E, R>(io: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, import("effect/unstable/http/HttpClient").HttpClient>>;
37
59
  /** GET /config/pass_through_endpoint — every row, config-file and DB alike. Not under the semaphore: reads don't race the field. */
38
60
  export declare const listPassThroughEndpoints: () => Effect.Effect<readonly misc.PassThroughGenericEndpoint[], misc.GetPassThroughEndpointsConfigPassThroughEndpointGetError, LitellmOpContext>;
39
61
  /** POST /config/pass_through_endpoint. `body` carries `id` — see pass-through-form.ts. */
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/litellm/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AACnD,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;AA8DvC,oIAAoI;AACpI,eAAO,MAAM,wBAAwB,QAAO,MAAM,CAAC,MAAM,CACvD,SAAS,IAAI,CAAC,0BAA0B,EAAE,EAC1C,IAAI,CAAC,wDAAwD,EAC7D,gBAAgB,CAIf,CAAC;AAEJ,0FAA0F;AAC1F,eAAO,MAAM,yBAAyB,SAC9B,IAAI,CAAC,0BAA0B,KACpC,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,IAAI,CAAC,4DAA4D,EACjE,gBAAgB,CACiF,CAAC;AAEpG;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,eACxB,MAAM,QACZ,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,GACrE,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,MAAM,GAAG,QAAQ,CAAC,KACzD,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,IAAI,CAAC,sEAAsE,EAC3E,g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EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,GACrE,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,MAAM,GAAG,QAAQ,CAAC,KACzD,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,IAAI,CAAC,sEAAsE,EAC3E,gBAAgB,CASf,CAAC;AAEJ;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,eACxB,MAAM,KACjB,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,IAAI,CAAC,8DAA8D,EACnE,gBAAgB,CAcf,CAAC"}
@@ -20,5 +20,5 @@
20
20
  */
21
21
  import { type Credentials } from '@distilled.cloud/litellm/Credentials';
22
22
  import * as Layer from 'effect/Layer';
23
- export declare const litellmProviders: (creds?: Layer.Layer<Credentials>) => Layer.Layer<Credentials | import("alchemy").Provider<import("./pass-through-endpoint.ts").LiteLLMPassThroughEndpoint>, never, import("effect/unstable/http/HttpClient").HttpClient | import("alchemy").Stack | import("alchemy").Stage>;
23
+ export declare const litellmProviders: (creds?: Layer.Layer<Credentials>) => Layer.Layer<Credentials | import("alchemy").Provider<import("./budget.ts").LiteLLMBudget> | import("alchemy").Provider<import("./pass-through-endpoint.ts").LiteLLMPassThroughEndpoint>, never, import("effect/unstable/http/HttpClient").HttpClient | import("alchemy").Stack | import("alchemy").Stage>;
24
24
  //# sourceMappingURL=providers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/litellm/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,sCAAsC,CAAC;AAC5F,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,eAAO,MAAM,gBAAgB,WAAW,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,4OACM,CAAC"}
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/litellm/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,sCAAsC,CAAC;AAC5F,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,eAAO,MAAM,gBAAgB,WAAW,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,8SAG7D,CAAC"}
@@ -13,6 +13,14 @@ export interface BaoAuthRoleProps {
13
13
  bindSecretId?: boolean;
14
14
  /** `0` means unlimited uses — the shape reconcile.sh writes for headless roles. */
15
15
  secretIdNumUses?: number;
16
+ /**
17
+ * Token period, e.g. `24h` — set only for a periodic (forever-renewable) role, where
18
+ * `tokenTtl`/`tokenMaxTtl` are conventionally `'0'`. Omitted means this declaration does not
19
+ * manage the field: a live role's `token_period` (however it got set) is left untouched, the
20
+ * same way an omitted `bindSecretId` is. See house `openbao/approles.ts` for the role this
21
+ * unblocks — a periodic agent token that was inexpressible with these props.
22
+ */
23
+ tokenPeriod?: string;
16
24
  }
17
25
  export interface BaoAuthRoleAttributes {
18
26
  name: string;
@@ -22,6 +30,7 @@ export interface BaoAuthRoleAttributes {
22
30
  secretIdTtl: string;
23
31
  bindSecretId: boolean;
24
32
  secretIdNumUses: number;
33
+ tokenPeriod: string;
25
34
  /** SHA-256 of the managed fields — safe to persist; see policy.ts. */
26
35
  digest: string;
27
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"auth-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-form.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EA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AE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAwBD,eAAO,MAAM,YAAY,UAChB,gBAAgB,QACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,qBAYF,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,MAAM,WAAgC,CAAC;AAWtE,6EAA6E;AAC7E,eAAO,MAAM,OAAO,eAAgB,qBAAqB,SAAS,gBAAgB,YAWjF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth-role-wire.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-wire.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAI7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAY,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAwB3C,eAAO,MAAM,YAAY,SAAU,MAAM,81BAQtC,CAAC;AAEJ,eAAO,MAAM,cAAc,SAAU,MAAM,k0BACwB,CAAC;AAEpE,eAAO,MAAM,eAAe,UAAW,gBAAgB,4DAuBnD,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,aAAa,UAAW,gBAAgB,0PAC6C,CAAC;AAEnG,+EAA+E;AAC/E,eAAO,MAAM,cAAc,SAAU,MAAM,s4BACqD,CAAC"}
1
+ {"version":3,"file":"auth-role-wire.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-wire.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAI7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAY,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAyB3C,eAAO,MAAM,YAAY,SAAU,MAAM,81BAQtC,CAAC;AAEJ,eAAO,MAAM,cAAc,SAAU,MAAM,k0BACwB,CAAC;AAEpE,eAAO,MAAM,eAAe,UAAW,gBAAgB,4DAkCnD,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,aAAa,UAAW,gBAAgB,0PAC6C,CAAC;AAEnG,+EAA+E;AAC/E,eAAO,MAAM,cAAc,SAAU,MAAM,s4BACqD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fake-engines-roles.d.ts","sourceRoot":"","sources":["../../src/openbao/fake-engines-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAU,KAAK,KAAK,EAAmC,MAAM,mBAAmB,CAAC;AAwCxF;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAO,KAO1B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,KAO9B,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAO,KAuB9B,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,UAAU,gBAIC,IAAI,KAAG,KAAK;;;;CAMnC,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"fake-engines-roles.d.ts","sourceRoot":"","sources":["../../src/openbao/fake-engines-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAU,KAAK,KAAK,EAAmC,MAAM,mBAAmB,CAAC;AAwCxF;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAO,KAa1B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,KAO9B,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAO,KAuB9B,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,UAAU,gBAIC,IAAI,KAAG,KAAK;;;;CAMnC,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -858,7 +858,8 @@ var attributesOf3 = (props, live) => {
858
858
  tokenMaxTtl: ttlText(ttlSeconds(live["token_max_ttl"])),
859
859
  secretIdTtl: ttlText(ttlSeconds(live["secret_id_ttl"]), "0"),
860
860
  bindSecretId: bool(live["bind_secret_id"], true),
861
- secretIdNumUses: int(live["secret_id_num_uses"], 0)
861
+ secretIdNumUses: int(live["secret_id_num_uses"], 0),
862
+ tokenPeriod: ttlText(ttlSeconds(live["token_period"]), "0")
862
863
  };
863
864
  return { ...attrs, digest: sha256(JSON.stringify(attrs)) };
864
865
  };
@@ -871,7 +872,7 @@ var sameTtl3 = (want, have) => {
871
872
  };
872
873
  var matches3 = (attributes, props) => {
873
874
  const wantPolicies = props.tokenPolicies.slice().sort();
874
- return samePolicies(wantPolicies, attributes.tokenPolicies) && sameTtl3(props.tokenTtl, attributes.tokenTtl) && sameTtl3(props.tokenMaxTtl, attributes.tokenMaxTtl) && sameTtl3(props.secretIdTtl, attributes.secretIdTtl) && (props.bindSecretId === undefined || attributes.bindSecretId === props.bindSecretId) && (props.secretIdNumUses === undefined || attributes.secretIdNumUses === props.secretIdNumUses);
875
+ return samePolicies(wantPolicies, attributes.tokenPolicies) && sameTtl3(props.tokenTtl, attributes.tokenTtl) && sameTtl3(props.tokenMaxTtl, attributes.tokenMaxTtl) && sameTtl3(props.secretIdTtl, attributes.secretIdTtl) && (props.bindSecretId === undefined || attributes.bindSecretId === props.bindSecretId) && (props.secretIdNumUses === undefined || attributes.secretIdNumUses === props.secretIdNumUses) && (props.tokenPeriod === undefined || sameTtl3(props.tokenPeriod, attributes.tokenPeriod));
875
876
  };
876
877
 
877
878
  // src/openbao/auth-role-wire.ts
@@ -906,14 +907,15 @@ var runBaoWrite = (operation, timeout3 = BAO_TIMEOUT) => retryTransport(runBao(o
906
907
  // src/openbao/auth-role-wire.ts
907
908
  var identity = (name) => ({ approle_mount_path: "approle", role_name: name });
908
909
  var seconds = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
909
- var completeRole = (live) => live !== null && typeof live === "object" && typeof live.bind_secret_id === "boolean" && seconds(live.secret_id_num_uses) && seconds(live.secret_id_ttl) && seconds(live.token_ttl) && seconds(live.token_max_ttl) && Array.isArray(live.token_policies) && live.token_policies.every((policy) => typeof policy === "string");
910
+ var completeRole = (live) => live !== null && typeof live === "object" && typeof live.bind_secret_id === "boolean" && seconds(live.secret_id_num_uses) && seconds(live.secret_id_ttl) && seconds(live.token_ttl) && seconds(live.token_max_ttl) && seconds(live.token_period) && Array.isArray(live.token_policies) && live.token_policies.every((policy) => typeof policy === "string");
910
911
  var readAuthRole = (name) => runBaoRead(appRoleReadRole(identity(name))).pipe(Effect14.flatMap((live) => completeRole(live) ? Effect14.succeed(live) : Effect14.fail(new BaoError(200, "GET", readPath3(name), ["incomplete role metadata"]))), Effect14.catchTag("NotFound", () => Effect14.succeed(undefined)));
911
912
  var authRoleExists = (name) => readAuthRole(name).pipe(Effect14.map((live) => live !== undefined));
912
913
  var authRoleRequest = (props) => Effect14.gen(function* () {
913
914
  const tokenTtl = parseDuration(props.tokenTtl);
914
915
  const tokenMaxTtl = parseDuration(props.tokenMaxTtl);
915
916
  const secretIdTtl = parseDuration(props.secretIdTtl);
916
- if (!seconds(tokenTtl) || !seconds(tokenMaxTtl) || !seconds(secretIdTtl)) {
917
+ const tokenPeriod = props.tokenPeriod === undefined ? undefined : parseDuration(props.tokenPeriod);
918
+ if (!seconds(tokenTtl) || !seconds(tokenMaxTtl) || !seconds(secretIdTtl) || props.tokenPeriod !== undefined && !seconds(tokenPeriod)) {
917
919
  return yield* Effect14.fail(new BaoError(0, "POST", readPath3(props.name), ["invalid role TTL duration"]));
918
920
  }
919
921
  const request = {
@@ -923,7 +925,8 @@ var authRoleRequest = (props) => Effect14.gen(function* () {
923
925
  token_max_ttl: tokenMaxTtl,
924
926
  secret_id_ttl: secretIdTtl,
925
927
  ...props.bindSecretId === undefined ? {} : { bind_secret_id: props.bindSecretId },
926
- ...props.secretIdNumUses === undefined ? {} : { secret_id_num_uses: props.secretIdNumUses }
928
+ ...props.secretIdNumUses === undefined ? {} : { secret_id_num_uses: props.secretIdNumUses },
929
+ ...tokenPeriod === undefined ? {} : { token_period: tokenPeriod }
927
930
  };
928
931
  return request;
929
932
  });
@@ -3592,5 +3595,5 @@ export {
3592
3595
  revokeSelfEffect
3593
3596
  };
3594
3597
 
3595
- //# debugId=C687B72D0BAE7E8D64756E2164756E21
3598
+ //# debugId=6284E1A37FA458FA64756E2164756E21
3596
3599
  //# sourceMappingURL=index.js.map