processfocus 0.1.0-next.2 → 0.1.0-next.4

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 (67) hide show
  1. package/dist/{auth-FmXptohB.mjs → auth-DWWupwJA.mjs} +57 -24
  2. package/dist/auth-config/src/lib/authentication-config.d.ts +13 -8
  3. package/dist/auth-config/src/lib/aws-role-binding.d.ts +21 -0
  4. package/dist/auth-config/src/lib/provider-types.d.ts +87 -76
  5. package/dist/auth-config/src/lib/workload-trust.d.ts +41 -0
  6. package/dist/auth.mjs +1 -2
  7. package/dist/business-calendar/src/lib/calendar-config.d.ts +73 -76
  8. package/dist/business-calendar/src/lib/calendar-period.d.ts +30 -30
  9. package/dist/business-calendar/src/lib/calendar-service.d.ts +10 -10
  10. package/dist/business-calendar/src/lib/datetime-utils.d.ts +1 -1
  11. package/dist/business-calendar/src/lib/holidays.d.ts +40 -40
  12. package/dist/business-calendar/src/lib/types.d.ts +29 -29
  13. package/dist/calendar.mjs +73 -63
  14. package/dist/form-schema/src/index.d.ts +4 -1
  15. package/dist/form-schema/src/lib/annotation-helpers.d.ts +2 -2
  16. package/dist/form-schema/src/lib/email.d.ts +2 -2
  17. package/dist/form-schema/src/lib/field-count.d.ts +2 -2
  18. package/dist/form-schema/src/lib/form-annotations.d.ts +6 -0
  19. package/dist/form-schema/src/lib/form-presentation.d.ts +30 -0
  20. package/dist/form-schema/src/lib/form-schema.d.ts +64 -34
  21. package/dist/form-schema/src/lib/number-from-string.d.ts +3 -0
  22. package/dist/form-schema/src/lib/phone.d.ts +2 -2
  23. package/dist/form-schema/src/lib/public-completion-correction.d.ts +5 -0
  24. package/dist/form-schema/src/lib/search-lookup-items.d.ts +3 -0
  25. package/dist/form-submission-schema/src/index.d.ts +3 -0
  26. package/dist/form-submission-schema/src/lib/executable-rules.d.ts +43 -0
  27. package/dist/form-submission-schema/src/lib/form-submission-schema.d.ts +33 -10
  28. package/dist/form-submission-schema/src/lib/json-schema.d.ts +3 -0
  29. package/dist/form-submission-schema/src/lib/submission-utils.d.ts +19 -0
  30. package/dist/forms.mjs +26 -2
  31. package/dist/frontend-manifest/src/lib/browser-plugin-artifact.d.ts +9 -0
  32. package/dist/frontend-manifest/src/lib/frontend-manifest.d.ts +8 -6
  33. package/dist/frontend-plugin-host/src/lib/frontend-plugin-host.d.ts +11 -1
  34. package/dist/index.d.ts +1 -1
  35. package/dist/index.mjs +466 -972
  36. package/dist/manifest.mjs +1 -2
  37. package/dist/plugin.mjs +1 -2
  38. package/dist/process/src/lib/form-authoring.d.ts +1 -1
  39. package/dist/process/src/lib/form-decoration.d.ts +3 -3
  40. package/dist/process/src/lib/form.d.ts +61 -97
  41. package/dist/process/src/lib/list.d.ts +36 -23
  42. package/dist/process/src/lib/lookup-accessor.d.ts +4 -1
  43. package/dist/process/src/lib/organisation.d.ts +14 -0
  44. package/dist/process/src/lib/process.d.ts +24 -2
  45. package/dist/process/src/lib/schedule.d.ts +1 -1
  46. package/dist/process/src/lib/step.d.ts +13 -3
  47. package/dist/process/src/lib/system-step-executor.d.ts +4 -4
  48. package/dist/process/src/lib/system-step.d.ts +11 -1
  49. package/dist/sdk/src/index.d.ts +1 -1
  50. package/dist/sdk/src/testing.d.ts +0 -1
  51. package/dist/{src-C-909PVQ.mjs → src-BQ55-khF.mjs} +118 -66
  52. package/dist/testing.d.ts +0 -1
  53. package/dist/testing.mjs +2 -4
  54. package/package.json +4 -4
  55. package/dist/form-client-representation/src/index.d.ts +0 -6
  56. package/dist/form-client-representation/src/lib/as-client-representation.d.ts +0 -31
  57. package/dist/form-client-representation/src/lib/client-form-definition.d.ts +0 -17
  58. package/dist/form-client-representation/src/lib/extract-annotations.d.ts +0 -20
  59. package/dist/form-client-representation/src/lib/plugin-registry.d.ts +0 -6
  60. package/dist/form-client-representation/src/lib/types.d.ts +0 -239
  61. package/dist/form-client-representation/src/lib/walker.d.ts +0 -68
  62. package/dist/form-rule/src/index.d.ts +0 -3
  63. package/dist/form-rule/src/lib/evaluator.d.ts +0 -2
  64. package/dist/form-rule/src/lib/paths.d.ts +0 -9
  65. package/dist/form-rule/src/lib/types.d.ts +0 -89
  66. package/dist/form-schema/src/lib/property-signature.d.ts +0 -3
  67. package/dist/paths-BkzLn-rG.mjs +0 -282
@@ -1,6 +1,30 @@
1
1
  import { Construct } from "constructs";
2
2
  import { Schema } from "effect";
3
- //#region ../auth-config/src/lib/authentication-config.ts
3
+ // ../auth-config/src/lib/aws-role-binding.ts
4
+ const text = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(256)));
5
+ const bindingFields = {
6
+ id: text,
7
+ targetIssuer: text,
8
+ accountId: Schema.String.pipe(Schema.check(Schema.isPattern(/^\d{12}$/))),
9
+ serviceAccountId: Schema.String.pipe(Schema.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/))),
10
+ label: Schema.optional(text)
11
+ };
12
+ /** Exactly one selector; a name binding deliberately survives role replacement. */
13
+ const AwsRoleBindingSchema = Schema.Union([Schema.Struct({
14
+ ...bindingFields,
15
+ roleId: Schema.String.pipe(Schema.check(Schema.isPattern(/^AROA[A-Z0-9]{17}$/))),
16
+ roleName: Schema.optionalKey(Schema.Never)
17
+ }), Schema.Struct({
18
+ ...bindingFields,
19
+ roleId: Schema.optionalKey(Schema.Never),
20
+ roleName: Schema.String.pipe(Schema.check(Schema.isPattern(/^[A-Za-z0-9_+=,.@-]{1,64}$/)))
21
+ })]);
22
+ const awsRoleBindingIdentityKey = (binding) => JSON.stringify([
23
+ binding.targetIssuer,
24
+ binding.accountId,
25
+ binding.roleId === void 0 ? ["roleName", binding.roleName] : ["roleId", binding.roleId]
26
+ ]);
27
+ // ../auth-config/src/lib/authentication-config.ts
4
28
  /**
5
29
  * Configuration for OAuth authentication providers.
6
30
  *
@@ -21,13 +45,27 @@ var AuthenticationConfig = class extends Construct {
21
45
  isAuthenticationConfig = true;
22
46
  _inviteOnly;
23
47
  delegatedAccess;
48
+ workloadClients;
49
+ awsRoleBindings;
24
50
  _identityProviders = [];
25
51
  _passkey;
26
52
  _secretClients = [];
27
53
  constructor(scope, id, props) {
28
54
  super(scope, id);
55
+ this.awsRoleBindings = Schema.decodeUnknownSync(Schema.Array(AwsRoleBindingSchema))(props?.awsRoleBindings ?? []);
56
+ const identities = /* @__PURE__ */ new Set();
57
+ const bindingIds = /* @__PURE__ */ new Set();
58
+ for (const binding of this.awsRoleBindings) {
59
+ const identity = awsRoleBindingIdentityKey(binding);
60
+ if (identities.has(identity) || bindingIds.has(binding.id) || binding.serviceAccountId.startsWith("project-workload-") || props?.workloadClients?.[binding.serviceAccountId] || props?.secretClients?.[binding.serviceAccountId] && props.secretClients[binding.serviceAccountId]?.audience !== "graphql-api") throw new Error("Invalid or ambiguous AWS role binding");
61
+ identities.add(identity);
62
+ bindingIds.add(binding.id);
63
+ }
64
+ for (const clientId of [...Object.keys(props?.workloadClients ?? {}), ...Object.keys(props?.secretClients ?? {})]) if (clientId.startsWith("project-workload-")) throw new Error("project-workload- client identifiers are reserved for runtime-managed project identities");
29
65
  this._inviteOnly = props?.inviteOnly ?? true;
30
66
  this.delegatedAccess = props?.delegatedAccess ?? false;
67
+ this.workloadClients = props?.workloadClients ?? {};
68
+ for (const clientId of Object.keys(this.workloadClients)) if (props?.secretClients?.[clientId]) throw new Error("A machine client must select exactly one authentication method");
31
69
  if (props?.identityProviders) {
32
70
  for (const [name, config] of Object.entries(props.identityProviders)) if (config) this._identityProviders.push({
33
71
  name,
@@ -69,8 +107,7 @@ var AuthenticationConfig = class extends Construct {
69
107
  }
70
108
  };
71
109
  const isAuthenticationConfig = (value) => typeof value === "object" && value !== null && "isAuthenticationConfig" in value && value.isAuthenticationConfig === true;
72
- //#endregion
73
- //#region ../auth-config/src/lib/custom-entities-config.ts
110
+ // ../auth-config/src/lib/custom-entities-config.ts
74
111
  /**
75
112
  * Configuration for custom Cedar entity schemas.
76
113
  *
@@ -103,8 +140,7 @@ var CustomEntitiesConfig = class extends Construct {
103
140
  }
104
141
  };
105
142
  const isCustomEntitiesConfig = (value) => typeof value === "object" && value !== null && "isCustomEntitiesConfig" in value && value.isCustomEntitiesConfig === true;
106
- //#endregion
107
- //#region ../auth-config/src/lib/policies-config.ts
143
+ // ../auth-config/src/lib/policies-config.ts
108
144
  /**
109
145
  * Configuration for custom Cedar authorization policies.
110
146
  *
@@ -142,15 +178,16 @@ var PoliciesConfig = class extends Construct {
142
178
  }
143
179
  };
144
180
  const isPoliciesConfig = (value) => typeof value === "object" && value !== null && "isPoliciesConfig" in value && value.isPoliciesConfig === true;
145
- //#endregion
146
- //#region ../auth-config/src/lib/provider-types.ts
181
+ // ../auth-config/src/lib/provider-types.ts
147
182
  /**
148
- * Effect Schema for PasskeyProviderConfig validation.
183
+ * Validates hydrated passkey configuration at runtime, where the relying party
184
+ * ID and origin must be present after organisation import.
149
185
  */
150
186
  const PasskeyProviderConfigSchema = Schema.Struct({
187
+ accountLabel: Schema.optional(Schema.String),
151
188
  rpName: Schema.String,
152
189
  rpID: Schema.String,
153
- origin: Schema.Union(Schema.String, Schema.Array(Schema.String))
190
+ origin: Schema.Union([Schema.String, Schema.Array(Schema.String)])
154
191
  });
155
192
  /**
156
193
  * Supported OAuth provider names.
@@ -233,37 +270,34 @@ const OAuthProviderConfigSchema = Schema.Struct({
233
270
  clientSecret: Schema.String,
234
271
  scopes: Schema.Array(Schema.String),
235
272
  pkce: Schema.optional(Schema.Boolean),
236
- query: Schema.optional(Schema.Record({
237
- key: Schema.String,
238
- value: Schema.String
239
- }))
273
+ query: Schema.optional(Schema.Record(Schema.String, Schema.String))
240
274
  });
241
- const AppleOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.extend(Schema.Struct({ responseMode: Schema.optional(Schema.Literal("query", "form_post")) })));
242
- const MicrosoftOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.extend(Schema.Struct({ tenant: Schema.String })));
243
- const SlackOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.extend(Schema.Struct({ team: Schema.String })));
244
- const KeycloakOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.extend(Schema.Struct({
275
+ const AppleOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.fieldsAssign({ responseMode: Schema.optional(Schema.Literals(["query", "form_post"])) }));
276
+ const MicrosoftOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.fieldsAssign({ tenant: Schema.String }));
277
+ const SlackOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.fieldsAssign({ team: Schema.String }));
278
+ const KeycloakOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.fieldsAssign({
245
279
  baseUrl: Schema.String,
246
280
  realm: Schema.String
247
- })));
248
- const CognitoOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.extend(Schema.Struct({
281
+ }));
282
+ const CognitoOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.fieldsAssign({
249
283
  domain: Schema.String,
250
284
  region: Schema.String,
251
285
  userPoolId: Schema.String
252
- })));
286
+ }));
253
287
  /**
254
288
  * Effect Schema for OAuthProviderName validation.
255
289
  */
256
- const OAuthProviderNameSchema = Schema.Literal(...OAUTH_PROVIDER_NAMES);
290
+ const OAuthProviderNameSchema = Schema.Literals(OAUTH_PROVIDER_NAMES);
257
291
  /**
258
292
  * Effect Schema for GoogleOAuthProviderConfig validation.
259
293
  * Extends the base OAuthProviderConfigSchema with Google-specific fields.
260
294
  */
261
- const GoogleOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.extend(Schema.Struct({
295
+ const GoogleOAuthProviderConfigSchema = OAuthProviderConfigSchema.pipe(Schema.fieldsAssign({
262
296
  invitedOrgUnits: Schema.optional(Schema.Array(Schema.String)),
263
297
  orgUnitAsRole: Schema.optional(Schema.Boolean),
264
298
  serviceAccountKey: Schema.optional(Schema.String),
265
299
  adminEmail: Schema.optional(Schema.String)
266
- })));
300
+ }));
267
301
  /**
268
302
  * Effect Schema for SecretClientConfig validation.
269
303
  */
@@ -271,5 +305,4 @@ const SecretClientConfigSchema = Schema.Struct({
271
305
  secret: Schema.String,
272
306
  audience: Schema.String
273
307
  });
274
- //#endregion
275
308
  export { AuthenticationConfig as _, KeycloakOAuthProviderConfigSchema as a, OAuthProviderConfigSchema as c, SecretClientConfigSchema as d, SlackOAuthProviderConfigSchema as f, isCustomEntitiesConfig as g, CustomEntitiesConfig as h, GoogleOAuthProviderConfigSchema as i, OAuthProviderNameSchema as l, isPoliciesConfig as m, CognitoOAuthProviderConfigSchema as n, MicrosoftOAuthProviderConfigSchema as o, PoliciesConfig as p, DEFAULT_OAUTH_PROVIDER_SCOPES as r, OAUTH_PROVIDER_NAMES as s, AppleOAuthProviderConfigSchema as t, PasskeyProviderConfigSchema as u, isAuthenticationConfig as v };
@@ -1,5 +1,7 @@
1
1
  import { Construct, type IConstruct } from "constructs";
2
+ import { type AwsRoleBinding } from "./aws-role-binding.js";
2
3
  import type { AppleOAuthProviderConfig, CognitoOAuthProviderConfig, GoogleOAuthProviderConfig, KeycloakOAuthProviderConfig, MicrosoftOAuthProviderConfig, OAuthProviderConfig, OAuthProviderName, PasskeyProviderConfig, SecretClientConfig, SlackOAuthProviderConfig } from "./provider-types.js";
4
+ import type { WorkloadClientConfig } from "./workload-trust.js";
3
5
  interface ProviderEntry {
4
6
  readonly name: OAuthProviderName;
5
7
  readonly config: OAuthProviderConfig;
@@ -30,13 +32,12 @@ export type IdentityProvidersConfig = {
30
32
  export type SecretClientsConfig = Record<string, SecretClientConfig>;
31
33
  export interface AuthenticationConfigProps {
32
34
  /**
33
- * Show **Log in with a secret** on the anonymous login page.
35
+ * Whether to offer "Log in with a secret" for delegated access.
34
36
  *
35
- * The login page has no identified principal whose Cedar token-management
36
- * permissions it can evaluate, so this is a presentation choice only. Cedar
37
- * independently authorizes token listing, issuance, management, redemption,
38
- * and delegated work. Hiding the control does not disable authentication or
39
- * revoke an existing credential.
37
+ * This controls the visibility of the login option, not permission to create
38
+ * or use delegated credentials. Those permissions are governed by Cedar
39
+ * policies. Setting this to false hides the option but does not prevent
40
+ * secret-based authentication or revoke existing credentials.
40
41
  *
41
42
  * @default false
42
43
  */
@@ -78,8 +79,6 @@ export interface AuthenticationConfigProps {
78
79
  * ```typescript
79
80
  * {
80
81
  * rpName: "My App",
81
- * rpID: "example.com",
82
- * origin: "https://example.com"
83
82
  * }
84
83
  * ```
85
84
  */
@@ -100,6 +99,10 @@ export interface AuthenticationConfigProps {
100
99
  * ```
101
100
  */
102
101
  secretClients?: SecretClientsConfig;
102
+ /** Secretless M2M identities. A client must select exactly one authentication method. */
103
+ workloadClients?: Record<string, WorkloadClientConfig>;
104
+ /** Direct GraphQL authentication; each binding also declares its service account. */
105
+ awsRoleBindings?: readonly AwsRoleBinding[];
103
106
  }
104
107
  /**
105
108
  * Configuration for OAuth authentication providers.
@@ -121,6 +124,8 @@ export declare class AuthenticationConfig extends Construct {
121
124
  readonly isAuthenticationConfig: true;
122
125
  private readonly _inviteOnly;
123
126
  readonly delegatedAccess: boolean;
127
+ readonly workloadClients: Readonly<Record<string, WorkloadClientConfig>>;
128
+ readonly awsRoleBindings: readonly AwsRoleBinding[];
124
129
  private readonly _identityProviders;
125
130
  private readonly _passkey;
126
131
  private readonly _secretClients;
@@ -0,0 +1,21 @@
1
+ import { Schema } from "effect";
2
+ /** Exactly one selector; a name binding deliberately survives role replacement. */
3
+ export declare const AwsRoleBindingSchema: Schema.Union<readonly [Schema.Struct<{
4
+ readonly roleId: Schema.String;
5
+ readonly roleName: Schema.optionalKey<Schema.Never>;
6
+ readonly id: Schema.String;
7
+ readonly targetIssuer: Schema.String;
8
+ readonly accountId: Schema.String;
9
+ readonly serviceAccountId: Schema.String;
10
+ readonly label: Schema.optional<Schema.String>;
11
+ }>, Schema.Struct<{
12
+ readonly roleId: Schema.optionalKey<Schema.Never>;
13
+ readonly roleName: Schema.String;
14
+ readonly id: Schema.String;
15
+ readonly targetIssuer: Schema.String;
16
+ readonly accountId: Schema.String;
17
+ readonly serviceAccountId: Schema.String;
18
+ readonly label: Schema.optional<Schema.String>;
19
+ }>]>;
20
+ export type AwsRoleBinding = Schema.Schema.Type<typeof AwsRoleBindingSchema>;
21
+ export declare const awsRoleBindingIdentityKey: (binding: AwsRoleBinding) => string;
@@ -1,6 +1,17 @@
1
1
  import { Schema } from "effect";
2
2
  /**
3
3
  * Passkey (WebAuthn) provider configuration.
4
+ *
5
+ * During organisation import, `processfocus/org-to-db` overrides `rpID` and `origin`
6
+ * from `PF_LOCAL_FRONTEND_ORIGIN`, or otherwise `OAUTH_ISSUER_URL`, when set.
7
+ * The URL's hostname becomes `rpID`; the full URL replaces `origin` (including
8
+ * any configured array). Without either variable, the authored values are used.
9
+ * Both fields may be omitted when the environment supplies the URL.
10
+ *
11
+ * Hosted deployments set `OAUTH_ISSUER_URL` to the deployment's public URL,
12
+ * including its custom domain. For example, `https://pf.example.com` produces
13
+ * `rpID: "pf.example.com"` and `origin: "https://pf.example.com"`, even when
14
+ * the organisation declares localhost values. `rpName` is not overridden.
4
15
  */
5
16
  export interface PasskeyProviderConfig {
6
17
  /**
@@ -9,23 +20,29 @@ export interface PasskeyProviderConfig {
9
20
  */
10
21
  readonly rpName: string;
11
22
  /**
12
- * The Relying Party ID (domain without protocol).
23
+ * The fallback Relying Party ID (hostname without protocol or port).
24
+ * Organisation import replaces this with the environment URL's hostname
25
+ * when an override described on `PasskeyProviderConfig` is set.
13
26
  * @example "localhost" or "example.com"
14
27
  */
15
- readonly rpID: string;
28
+ readonly rpID?: string;
16
29
  /**
17
- * The allowed origin(s) for WebAuthn requests.
30
+ * The fallback allowed origin(s) for WebAuthn requests.
31
+ * Organisation import replaces this with the single environment URL
32
+ * when an override described on `PasskeyProviderConfig` is set.
18
33
  * @example "http://localhost:3000" or ["https://example.com", "https://app.example.com"]
19
34
  */
20
- readonly origin: string | readonly string[];
35
+ readonly origin?: string | readonly string[];
21
36
  }
22
37
  /**
23
- * Effect Schema for PasskeyProviderConfig validation.
38
+ * Validates hydrated passkey configuration at runtime, where the relying party
39
+ * ID and origin must be present after organisation import.
24
40
  */
25
41
  export declare const PasskeyProviderConfigSchema: Schema.Struct<{
26
- rpName: typeof Schema.String;
27
- rpID: typeof Schema.String;
28
- origin: Schema.Union<[typeof Schema.String, Schema.Array$<typeof Schema.String>]>;
42
+ readonly accountLabel: Schema.optional<Schema.String>;
43
+ readonly rpName: Schema.String;
44
+ readonly rpID: Schema.String;
45
+ readonly origin: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.String>]>;
29
46
  }>;
30
47
  /**
31
48
  * Supported OAuth provider names.
@@ -66,64 +83,59 @@ export interface CognitoOAuthProviderConfig extends OAuthProviderConfig {
66
83
  * Effect Schema for OAuthProviderConfig validation.
67
84
  */
68
85
  export declare const OAuthProviderConfigSchema: Schema.Struct<{
69
- clientID: typeof Schema.String;
70
- clientSecret: typeof Schema.String;
71
- scopes: Schema.Array$<typeof Schema.String>;
72
- pkce: Schema.optional<typeof Schema.Boolean>;
73
- query: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
86
+ readonly clientID: Schema.String;
87
+ readonly clientSecret: Schema.String;
88
+ readonly scopes: Schema.$Array<Schema.String>;
89
+ readonly pkce: Schema.optional<Schema.Boolean>;
90
+ readonly query: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
91
+ }>;
92
+ export declare const AppleOAuthProviderConfigSchema: Schema.Struct<{
93
+ readonly clientID: Schema.String;
94
+ readonly clientSecret: Schema.String;
95
+ readonly scopes: Schema.$Array<Schema.String>;
96
+ readonly pkce: Schema.optional<Schema.Boolean>;
97
+ readonly query: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
98
+ readonly responseMode: Schema.optional<Schema.Literals<readonly ["query", "form_post"]>>;
99
+ }>;
100
+ export declare const MicrosoftOAuthProviderConfigSchema: Schema.Struct<{
101
+ readonly clientID: Schema.String;
102
+ readonly clientSecret: Schema.String;
103
+ readonly scopes: Schema.$Array<Schema.String>;
104
+ readonly pkce: Schema.optional<Schema.Boolean>;
105
+ readonly query: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
106
+ readonly tenant: Schema.String;
107
+ }>;
108
+ export declare const SlackOAuthProviderConfigSchema: Schema.Struct<{
109
+ readonly clientID: Schema.String;
110
+ readonly clientSecret: Schema.String;
111
+ readonly scopes: Schema.$Array<Schema.String>;
112
+ readonly pkce: Schema.optional<Schema.Boolean>;
113
+ readonly query: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
114
+ readonly team: Schema.String;
115
+ }>;
116
+ export declare const KeycloakOAuthProviderConfigSchema: Schema.Struct<{
117
+ readonly clientID: Schema.String;
118
+ readonly clientSecret: Schema.String;
119
+ readonly scopes: Schema.$Array<Schema.String>;
120
+ readonly pkce: Schema.optional<Schema.Boolean>;
121
+ readonly query: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
122
+ readonly baseUrl: Schema.String;
123
+ readonly realm: Schema.String;
124
+ }>;
125
+ export declare const CognitoOAuthProviderConfigSchema: Schema.Struct<{
126
+ readonly clientID: Schema.String;
127
+ readonly clientSecret: Schema.String;
128
+ readonly scopes: Schema.$Array<Schema.String>;
129
+ readonly pkce: Schema.optional<Schema.Boolean>;
130
+ readonly query: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
131
+ readonly domain: Schema.String;
132
+ readonly region: Schema.String;
133
+ readonly userPoolId: Schema.String;
74
134
  }>;
75
- export declare const AppleOAuthProviderConfigSchema: Schema.extend<Schema.Struct<{
76
- clientID: typeof Schema.String;
77
- clientSecret: typeof Schema.String;
78
- scopes: Schema.Array$<typeof Schema.String>;
79
- pkce: Schema.optional<typeof Schema.Boolean>;
80
- query: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
81
- }>, Schema.Struct<{
82
- responseMode: Schema.optional<Schema.Literal<["query", "form_post"]>>;
83
- }>>;
84
- export declare const MicrosoftOAuthProviderConfigSchema: Schema.extend<Schema.Struct<{
85
- clientID: typeof Schema.String;
86
- clientSecret: typeof Schema.String;
87
- scopes: Schema.Array$<typeof Schema.String>;
88
- pkce: Schema.optional<typeof Schema.Boolean>;
89
- query: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
90
- }>, Schema.Struct<{
91
- tenant: typeof Schema.String;
92
- }>>;
93
- export declare const SlackOAuthProviderConfigSchema: Schema.extend<Schema.Struct<{
94
- clientID: typeof Schema.String;
95
- clientSecret: typeof Schema.String;
96
- scopes: Schema.Array$<typeof Schema.String>;
97
- pkce: Schema.optional<typeof Schema.Boolean>;
98
- query: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
99
- }>, Schema.Struct<{
100
- team: typeof Schema.String;
101
- }>>;
102
- export declare const KeycloakOAuthProviderConfigSchema: Schema.extend<Schema.Struct<{
103
- clientID: typeof Schema.String;
104
- clientSecret: typeof Schema.String;
105
- scopes: Schema.Array$<typeof Schema.String>;
106
- pkce: Schema.optional<typeof Schema.Boolean>;
107
- query: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
108
- }>, Schema.Struct<{
109
- baseUrl: typeof Schema.String;
110
- realm: typeof Schema.String;
111
- }>>;
112
- export declare const CognitoOAuthProviderConfigSchema: Schema.extend<Schema.Struct<{
113
- clientID: typeof Schema.String;
114
- clientSecret: typeof Schema.String;
115
- scopes: Schema.Array$<typeof Schema.String>;
116
- pkce: Schema.optional<typeof Schema.Boolean>;
117
- query: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
118
- }>, Schema.Struct<{
119
- domain: typeof Schema.String;
120
- region: typeof Schema.String;
121
- userPoolId: typeof Schema.String;
122
- }>>;
123
135
  /**
124
136
  * Effect Schema for OAuthProviderName validation.
125
137
  */
126
- export declare const OAuthProviderNameSchema: Schema.Literal<["google", "github", "microsoft", "apple", "discord", "spotify", "slack", "linkedin", "twitch", "yahoo", "x", "keycloak", "cognito", "jumpcloud", "facebook"]>;
138
+ export declare const OAuthProviderNameSchema: Schema.Literals<readonly ["google", "github", "microsoft", "apple", "discord", "spotify", "slack", "linkedin", "twitch", "yahoo", "x", "keycloak", "cognito", "jumpcloud", "facebook"]>;
127
139
  /**
128
140
  * Google OAuth provider configuration extending the base OAuth config
129
141
  * with Google Workspace organizational unit (OU) invitation support.
@@ -156,18 +168,17 @@ export interface GoogleOAuthProviderConfig extends OAuthProviderConfig {
156
168
  * Effect Schema for GoogleOAuthProviderConfig validation.
157
169
  * Extends the base OAuthProviderConfigSchema with Google-specific fields.
158
170
  */
159
- export declare const GoogleOAuthProviderConfigSchema: Schema.extend<Schema.Struct<{
160
- clientID: typeof Schema.String;
161
- clientSecret: typeof Schema.String;
162
- scopes: Schema.Array$<typeof Schema.String>;
163
- pkce: Schema.optional<typeof Schema.Boolean>;
164
- query: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
165
- }>, Schema.Struct<{
166
- invitedOrgUnits: Schema.optional<Schema.Array$<typeof Schema.String>>;
167
- orgUnitAsRole: Schema.optional<typeof Schema.Boolean>;
168
- serviceAccountKey: Schema.optional<typeof Schema.String>;
169
- adminEmail: Schema.optional<typeof Schema.String>;
170
- }>>;
171
+ export declare const GoogleOAuthProviderConfigSchema: Schema.Struct<{
172
+ readonly clientID: Schema.String;
173
+ readonly clientSecret: Schema.String;
174
+ readonly scopes: Schema.$Array<Schema.String>;
175
+ readonly pkce: Schema.optional<Schema.Boolean>;
176
+ readonly query: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
177
+ readonly invitedOrgUnits: Schema.optional<Schema.$Array<Schema.String>>;
178
+ readonly orgUnitAsRole: Schema.optional<Schema.Boolean>;
179
+ readonly serviceAccountKey: Schema.optional<Schema.String>;
180
+ readonly adminEmail: Schema.optional<Schema.String>;
181
+ }>;
171
182
  /**
172
183
  * Secret client configuration for M2M (machine-to-machine) authentication
173
184
  * via OAuth2 client_credentials grant.
@@ -189,6 +200,6 @@ export interface SecretClientConfig {
189
200
  * Effect Schema for SecretClientConfig validation.
190
201
  */
191
202
  export declare const SecretClientConfigSchema: Schema.Struct<{
192
- secret: typeof Schema.String;
193
- audience: typeof Schema.String;
203
+ readonly secret: Schema.String;
204
+ readonly audience: Schema.String;
194
205
  }>;
@@ -0,0 +1,41 @@
1
+ import { Schema } from "effect";
2
+ /** Code-owned admission policy. PF issuer pins the organisation/project/environment. */
3
+ export declare const WorkloadTrustBindingSchema: Schema.Struct<{
4
+ readonly id: Schema.String;
5
+ readonly targetIssuer: Schema.String;
6
+ readonly issuer: Schema.Literal<"https://token.actions.githubusercontent.com">;
7
+ readonly assertionAudience: Schema.String;
8
+ readonly repositoryId: Schema.String;
9
+ readonly repositoryOwnerId: Schema.String;
10
+ readonly workflowRef: Schema.String;
11
+ readonly jobWorkflowRef: Schema.optional<Schema.String>;
12
+ readonly refs: Schema.$Array<Schema.String>;
13
+ readonly events: Schema.$Array<Schema.String>;
14
+ readonly environment: Schema.String;
15
+ readonly lifetimeSeconds: Schema.Number;
16
+ }>;
17
+ export type WorkloadTrustBinding = Schema.Schema.Type<typeof WorkloadTrustBindingSchema>;
18
+ export declare const WorkloadTrustConfigSchema: Schema.Struct<{
19
+ readonly bindings: Schema.$Array<Schema.Struct<{
20
+ readonly id: Schema.String;
21
+ readonly targetIssuer: Schema.String;
22
+ readonly issuer: Schema.Literal<"https://token.actions.githubusercontent.com">;
23
+ readonly assertionAudience: Schema.String;
24
+ readonly repositoryId: Schema.String;
25
+ readonly repositoryOwnerId: Schema.String;
26
+ readonly workflowRef: Schema.String;
27
+ readonly jobWorkflowRef: Schema.optional<Schema.String>;
28
+ readonly refs: Schema.$Array<Schema.String>;
29
+ readonly events: Schema.$Array<Schema.String>;
30
+ readonly environment: Schema.String;
31
+ readonly lifetimeSeconds: Schema.Number;
32
+ }>>;
33
+ readonly databaseTransferProjects: Schema.optional<Schema.$Array<Schema.String>>;
34
+ readonly deploymentProjects: Schema.optional<Schema.$Array<Schema.String>>;
35
+ }>;
36
+ export interface WorkloadClientConfig {
37
+ readonly audience: string;
38
+ readonly bindings: readonly WorkloadTrustBinding[];
39
+ readonly databaseTransferProjects?: readonly string[];
40
+ readonly deploymentProjects?: readonly string[];
41
+ }
package/dist/auth.mjs CHANGED
@@ -1,2 +1 @@
1
- import { _ as AuthenticationConfig, a as KeycloakOAuthProviderConfigSchema, c as OAuthProviderConfigSchema, d as SecretClientConfigSchema, f as SlackOAuthProviderConfigSchema, g as isCustomEntitiesConfig, h as CustomEntitiesConfig, i as GoogleOAuthProviderConfigSchema, l as OAuthProviderNameSchema, m as isPoliciesConfig, n as CognitoOAuthProviderConfigSchema, o as MicrosoftOAuthProviderConfigSchema, p as PoliciesConfig, r as DEFAULT_OAUTH_PROVIDER_SCOPES, s as OAUTH_PROVIDER_NAMES, t as AppleOAuthProviderConfigSchema, u as PasskeyProviderConfigSchema, v as isAuthenticationConfig } from "./auth-FmXptohB.mjs";
2
- export { AppleOAuthProviderConfigSchema, AuthenticationConfig, CognitoOAuthProviderConfigSchema, CustomEntitiesConfig, DEFAULT_OAUTH_PROVIDER_SCOPES, GoogleOAuthProviderConfigSchema, KeycloakOAuthProviderConfigSchema, MicrosoftOAuthProviderConfigSchema, OAUTH_PROVIDER_NAMES, OAuthProviderConfigSchema, OAuthProviderNameSchema, PasskeyProviderConfigSchema, PoliciesConfig, SecretClientConfigSchema, SlackOAuthProviderConfigSchema, isAuthenticationConfig, isCustomEntitiesConfig, isPoliciesConfig };
1
+ export { t as AppleOAuthProviderConfigSchema, _ as AuthenticationConfig, n as CognitoOAuthProviderConfigSchema, h as CustomEntitiesConfig, r as DEFAULT_OAUTH_PROVIDER_SCOPES, i as GoogleOAuthProviderConfigSchema, a as KeycloakOAuthProviderConfigSchema, o as MicrosoftOAuthProviderConfigSchema, s as OAUTH_PROVIDER_NAMES, c as OAuthProviderConfigSchema, l as OAuthProviderNameSchema, u as PasskeyProviderConfigSchema, p as PoliciesConfig, d as SecretClientConfigSchema, f as SlackOAuthProviderConfigSchema, v as isAuthenticationConfig, g as isCustomEntitiesConfig, m as isPoliciesConfig } from "./auth-DWWupwJA.mjs";