@sylphx/management 0.4.2 → 0.6.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 (58) hide show
  1. package/CHANGELOG.md +44 -2
  2. package/README.md +6 -6
  3. package/dist/auth.d.ts +7 -18
  4. package/dist/auth.d.ts.map +1 -1
  5. package/dist/auth.js +1 -2
  6. package/dist/authSettings.d.ts +7 -60
  7. package/dist/authSettings.d.ts.map +1 -1
  8. package/dist/authSettings.js +11 -19
  9. package/dist/backups.d.ts +7 -24
  10. package/dist/backups.d.ts.map +1 -1
  11. package/dist/backups.js +21 -7
  12. package/dist/client.d.ts +5 -2
  13. package/dist/client.d.ts.map +1 -1
  14. package/dist/client.js +3 -2
  15. package/dist/domains.d.ts +7 -3
  16. package/dist/domains.d.ts.map +1 -1
  17. package/dist/domains.js +4 -4
  18. package/dist/email.d.ts +22 -29
  19. package/dist/email.d.ts.map +1 -1
  20. package/dist/email.js +52 -12
  21. package/dist/envVars.d.ts +7 -4
  22. package/dist/envVars.d.ts.map +1 -1
  23. package/dist/envVars.js +4 -3
  24. package/dist/environments.d.ts.map +1 -1
  25. package/dist/environments.js +16 -6
  26. package/dist/http.d.ts.map +1 -1
  27. package/dist/http.js +6 -3
  28. package/dist/logs.d.ts +1 -1
  29. package/dist/logs.d.ts.map +1 -1
  30. package/dist/logs.js +8 -2
  31. package/dist/newsletter.d.ts +32 -257
  32. package/dist/newsletter.d.ts.map +1 -1
  33. package/dist/newsletter.js +135 -95
  34. package/dist/oidc.d.ts +6 -27
  35. package/dist/oidc.d.ts.map +1 -1
  36. package/dist/oidc.js +16 -6
  37. package/dist/organizations.d.ts +3 -1
  38. package/dist/organizations.d.ts.map +1 -1
  39. package/dist/organizations.js +8 -0
  40. package/dist/privacy.d.ts +3 -98
  41. package/dist/privacy.d.ts.map +1 -1
  42. package/dist/privacy.js +57 -25
  43. package/dist/refresh.d.ts +11 -12
  44. package/dist/refresh.d.ts.map +1 -1
  45. package/dist/refresh.js +10 -2
  46. package/dist/runners.d.ts +7 -58
  47. package/dist/runners.d.ts.map +1 -1
  48. package/dist/runners.js +18 -17
  49. package/dist/search.d.ts +7 -40
  50. package/dist/search.d.ts.map +1 -1
  51. package/dist/search.js +28 -18
  52. package/dist/serviceTokens.d.ts +8 -44
  53. package/dist/serviceTokens.d.ts.map +1 -1
  54. package/dist/serviceTokens.js +24 -8
  55. package/dist/services.d.ts +4 -1
  56. package/dist/services.d.ts.map +1 -1
  57. package/dist/services.js +6 -2
  58. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @sylphx/management
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1019](https://github.com/SylphxAI/platform/pull/1019) [`7978a14`](https://github.com/SylphxAI/platform/commit/7978a140c6eaf146456a458aa89b943cd3989659) Thanks [@shtse8](https://github.com/shtse8)! - Fail closed when environment targeting is ambiguous across platform management APIs.
8
+
9
+ The contract, Management SDK, and CLI now preserve explicit `envId` targeting for env vars, domains, services, deployments, and logs instead of relying on `envType` defaults when a project has multiple matching environments.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [[`7978a14`](https://github.com/SylphxAI/platform/commit/7978a140c6eaf146456a458aa89b943cd3989659)]:
14
+ - @sylphx/contract@0.8.0
15
+
16
+ ## 0.5.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [#746](https://github.com/SylphxAI/platform/pull/746) [`382a78e`](https://github.com/SylphxAI/platform/commit/382a78e2fb52d248890ae4fcb9551b8dde17a641) Thanks [@shtse8](https://github.com/shtse8)! - Align Management SDK email logs, suppressions, and settings with the contract-derived email admin surface.
21
+
22
+ The email management module now returns the contract list shape for logs, exposes log detail and suppression management helpers, and uses the contract settings input/response types. Consumers using the older hand-written email settings or log-list TypeScript shapes should migrate to the exported `EmailSettings`, `UpdateEmailSettingsInput`, `ListEmailLogsResult`, and `ListSuppressionsResult` types.
23
+
24
+ - [#766](https://github.com/SylphxAI/platform/pull/766) [`809abfe`](https://github.com/SylphxAI/platform/commit/809abfe0f9115e397dbd0fb2c75deeeb006712b6) Thanks [@shtse8](https://github.com/shtse8)! - Align the Management SDK auth admin surface with the contract-owned project auth API.
25
+
26
+ Auth admin helpers now require a project reference, use contract-derived request paths and result types, and send the contract-owned OAuth/settings field names. The unsupported `rotateOAuthSecret` helper has been removed because the production auth admin contract does not accept OAuth client secret mutation on this route.
27
+
28
+ - [#763](https://github.com/SylphxAI/platform/pull/763) [`5dfa410`](https://github.com/SylphxAI/platform/commit/5dfa4105f20573a482d3cfefcf247084724f31b5) Thanks [@shtse8](https://github.com/shtse8)! - Align the Management SDK newsletter module with the contract-derived newsletter API surface.
29
+
30
+ Newsletter management methods now derive request paths, HTTP methods, input types, and result types from `@sylphx/contract`. Public newsletter SDK types are re-exported from the contract package, and SDK-specific query helpers only adapt booleans and numbers into the string query parameters used by the HTTP contract.
31
+
32
+ - [#764](https://github.com/SylphxAI/platform/pull/764) [`d83b7de`](https://github.com/SylphxAI/platform/commit/d83b7de54ba3c7c331967ab882ea4d68623c041f) Thanks [@shtse8](https://github.com/shtse8)! - Derive the Management refresh-token SDK surface from `@sylphx/contract`, using contract-owned refresh/logout routes and the `refresh_token` wire body/response field names.
33
+
34
+ - [#759](https://github.com/SylphxAI/platform/pull/759) [`3257675`](https://github.com/SylphxAI/platform/commit/325767586a2fa5e53f00cd81e438d561d0e37c41) Thanks [@shtse8](https://github.com/shtse8)! - Align the Management SDK runners module with the contract-derived runner API surface.
35
+
36
+ Runner management methods now derive request paths, HTTP methods, input types, and result types from `@sylphx/contract`. The create input no longer advertises unsupported `labels` or `maxJobs` fields; callers should pass the contract-owned `name`, `platform`, and `arch` fields.
37
+
38
+ The `sylphx runners register` CLI command no longer exposes the unsupported `--labels` or `--max-jobs` flags and now submits only the contract-owned runner registration fields.
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [[`382a78e`](https://github.com/SylphxAI/platform/commit/382a78e2fb52d248890ae4fcb9551b8dde17a641)]:
43
+ - @sylphx/contract@0.7.0
44
+
3
45
  ## 0.4.2
4
46
 
5
47
  ### Patch Changes
@@ -107,9 +149,9 @@ rationale).
107
149
 
108
150
  ### Changes
109
151
 
110
- - **Beta API surface.** Per [ADR-077](https://github.com/SylphxAI/platform/blob/main/docs/adr/ADR-077-trio-completeness.md), the Promise-based pure-functional interface is the target public contract. No classes, no `this`, no hidden state — `createClient` returns a frozen value, and every capability is a free function that takes `client` as its first argument. Shape is NOT yet frozen; still iterating in 0.x.
152
+ - **Beta API surface.** Per **ADR-077** (Trio Completeness — Sylphx-internal architecture record), the Promise-based pure-functional interface is the target public contract. No classes, no `this`, no hidden state — `createClient` returns a frozen value, and every capability is a free function that takes `client` as its first argument. Shape is NOT yet frozen; still iterating in 0.x.
111
153
  - **Capability namespaces** (in-flight; count may change before stable) covering the Management plane: `projects`, `deployments`, `environments`, `envVars`, `domains`, `databases`, `services`, `volumes`, `storage`, `secrets`, `tasks`, `resourceBindings`, `organizations`, `users`, `sandboxes`, `logs`, `email` (admin), `notifications` (admin/inbox), `monitoring`, `analytics`, `flags`, `experiments`, `remoteConfig`, `ai`, `webhooks`, `runners`, `backups`, `billing`, `certs`, `consent`, `engagement`, `newsletter`, `oidc`, `privacy`, `realtime`, `referrals`, `saml`, `search`, `serviceTokens`, `sessionReplay`. Function lifecycle is withheld until the Management API owns `/projects/:projectId/functions/*`.
112
- - **Contract-first types** ([ADR-084](https://github.com/SylphxAI/platform/blob/main/docs/adr/ADR-084-effect-schema-contract.md)). Wire types and endpoint metadata (method + path) are imported from [`@sylphx/contract`](https://www.npmjs.com/package/@sylphx/contract) — the Effect Schema SSOT. Hand-written type shims were removed; the contract package is the only place wire shape is defined.
154
+ - **Contract-first types** (**ADR-084** — Effect Schema Contract, Sylphx-internal architecture record). Wire types and endpoint metadata (method + path) are imported from [`@sylphx/contract`](https://www.npmjs.com/package/@sylphx/contract) — the Effect Schema SSOT. Hand-written type shims were removed; the contract package is the only place wire shape is defined.
113
155
  - **Bearer-token auth.** `createClient({ token })` accepts service tokens (`svc_...`) and OAuth access JWTs. The same SDK works for CLI / CI / backend integrations on the Management plane (`api.sylphx.com/v1`).
114
156
  - **Tree-shakable subpath exports.** Every namespace is also reachable as `@sylphx/management/projects`, `@sylphx/management/deployments`, etc. `sideEffects: false` for bundler-friendly dead-code elimination.
115
157
  - **ESM-only.** `"type": "module"`, Node ≥ 20, uses the built-in `fetch`. No classes, no polyfills, no peer framework required.
package/README.md CHANGED
@@ -83,6 +83,7 @@ argument. Key namespaces:
83
83
  | Namespace | Representative functions |
84
84
  | -------------------- | ------------------------------------------------------------------------------------------ |
85
85
  | `users` | `whoami` |
86
+ | `auth`, `authSettings` | `getOAuthProviders`, `updateOAuthProviders`, `getAuthSettings`, `updateAuthSettings`, `getAuthStats` |
86
87
  | `projects` | `list`, `create`, `delete` |
87
88
  | `deployments` | `status`, `trigger`, `history`, `rollback` |
88
89
  | `environments` | `list`, `resolveId`, `create`, `update`, `delete`, `promote` |
@@ -167,12 +168,11 @@ try {
167
168
  across parallel calls. No hidden globals, no singletons.
168
169
  - **ESM-only, tree-shakable.** `"type": "module"`, `sideEffects: false`,
169
170
  per-namespace subpath exports.
170
- - See [ADR-077](https://github.com/SylphxAI/platform/blob/main/docs/adr/ADR-077-trio-completeness.md)
171
- for the design rationale,
172
- [ADR-083](https://github.com/SylphxAI/platform/blob/main/docs/adr/ADR-083-two-plane-sdk-architecture.md)
173
- for the two-plane split,
174
- [ADR-084](https://github.com/SylphxAI/platform/blob/main/docs/adr/ADR-084-effect-schema-contract.md)
175
- for the contract SSOT.
171
+ - See **ADR-077** (Trio Completeness) for the design rationale,
172
+ **ADR-083** (Two-Plane SDK Architecture) for the management /
173
+ BaaS split, and **ADR-084** (Effect Schema Contract) for the
174
+ contract SSOT. (ADRs live in the Sylphx-internal architecture
175
+ records.)
176
176
 
177
177
  ## Agent integration
178
178
 
package/dist/auth.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  * This file re-binds every export of `authSettings.ts` as a local
11
11
  * `export const` so that both:
12
12
  *
13
- * - `@sylphx/management/auth` — maps 1:1 to `authEndpoints`
13
+ * - `@sylphx/management/auth` — maps 1:1 to `authAdminEndpoints`
14
14
  * - `@sylphx/management/authSettings` — ergonomic alias
15
15
  *
16
16
  * resolve to the same transport functions, and the ADR-089 S7 coverage
@@ -19,21 +19,10 @@
19
19
  * @see ./authSettings.ts — source of truth
20
20
  */
21
21
  import * as settings from './authSettings.js';
22
- export declare const getOAuthProviders: (client: import("./client.js").Client) => Promise<{
23
- providers: readonly settings.OAuthProviderConfig[];
24
- }>;
25
- export declare const updateOAuthProviders: (client: import("./client.js").Client, body: settings.UpdateOAuthProvidersInput) => Promise<{
26
- providers: readonly settings.OAuthProviderConfig[];
27
- }>;
28
- export declare const rotateOAuthSecret: (client: import("./client.js").Client, provider: string, newClientSecret: string) => Promise<{
29
- providers: readonly settings.OAuthProviderConfig[];
30
- }>;
31
- export declare const getAuthSettings: (client: import("./client.js").Client) => Promise<{
32
- settings: settings.AuthSettings;
33
- }>;
34
- export declare const updateAuthSettings: (client: import("./client.js").Client, body: Partial<settings.AuthSettings>) => Promise<{
35
- settings: settings.AuthSettings;
36
- }>;
37
- export declare const getAuthStats: (client: import("./client.js").Client) => Promise<settings.AuthStats>;
38
- export type { AuthSettings, AuthStats, OAuthProviderConfig, UpdateOAuthProvidersInput, } from './authSettings.js';
22
+ export declare const getOAuthProviders: (client: import("./client.js").Client, projectId: string) => Promise<settings.OAuthProvidersResult>;
23
+ export declare const updateOAuthProviders: (client: import("./client.js").Client, projectId: string, body: settings.UpdateOAuthProvidersInput) => Promise<settings.UpdateOAuthProvidersResult>;
24
+ export declare const getAuthSettings: (client: import("./client.js").Client, projectId: string) => Promise<settings.AuthSettings>;
25
+ export declare const updateAuthSettings: (client: import("./client.js").Client, projectId: string, body: settings.UpdateAuthSettingsInput) => Promise<settings.AuthSettings>;
26
+ export declare const getAuthStats: (client: import("./client.js").Client, projectId: string) => Promise<settings.AuthStats>;
27
+ export type { AuthSettings, AuthStats, OAuthProvidersResult, UpdateAuthSettingsInput, UpdateOAuthProvidersInput, UpdateOAuthProvidersResult, } from '@sylphx/contract';
39
28
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,eAAO,MAAM,iBAAiB;;EAA6B,CAAA;AAC3D,eAAO,MAAM,oBAAoB;;EAAgC,CAAA;AACjE,eAAO,MAAM,iBAAiB;;EAA6B,CAAA;AAC3D,eAAO,MAAM,eAAe;;EAA2B,CAAA;AACvD,eAAO,MAAM,kBAAkB;;EAA8B,CAAA;AAC7D,eAAO,MAAM,YAAY,uEAAwB,CAAA;AAEjD,YAAY,EACX,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,yBAAyB,GACzB,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,eAAO,MAAM,iBAAiB,qGAA6B,CAAA;AAC3D,eAAO,MAAM,oBAAoB,qJAAgC,CAAA;AACjE,eAAO,MAAM,eAAe,6FAA2B,CAAA;AACvD,eAAO,MAAM,kBAAkB,qIAA8B,CAAA;AAC7D,eAAO,MAAM,YAAY,0FAAwB,CAAA;AAEjD,YAAY,EACX,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,GAC1B,MAAM,kBAAkB,CAAA"}
package/dist/auth.js CHANGED
@@ -10,7 +10,7 @@
10
10
  * This file re-binds every export of `authSettings.ts` as a local
11
11
  * `export const` so that both:
12
12
  *
13
- * - `@sylphx/management/auth` — maps 1:1 to `authEndpoints`
13
+ * - `@sylphx/management/auth` — maps 1:1 to `authAdminEndpoints`
14
14
  * - `@sylphx/management/authSettings` — ergonomic alias
15
15
  *
16
16
  * resolve to the same transport functions, and the ADR-089 S7 coverage
@@ -21,7 +21,6 @@
21
21
  import * as settings from './authSettings.js';
22
22
  export const getOAuthProviders = settings.getOAuthProviders;
23
23
  export const updateOAuthProviders = settings.updateOAuthProviders;
24
- export const rotateOAuthSecret = settings.rotateOAuthSecret;
25
24
  export const getAuthSettings = settings.getAuthSettings;
26
25
  export const updateAuthSettings = settings.updateAuthSettings;
27
26
  export const getAuthStats = settings.getAuthStats;
@@ -7,65 +7,12 @@
7
7
  * Mirrors the `authAdminEndpoints` portion of
8
8
  * `apps/api/src/server/platform/routes/auth.ts`.
9
9
  */
10
+ import type { AuthSettings, AuthStats, OAuthProvidersResult, UpdateAuthSettingsInput, UpdateOAuthProvidersInput, UpdateOAuthProvidersResult } from '@sylphx/contract';
10
11
  import type { Client } from './client.js';
11
- export interface OAuthProviderConfig {
12
- readonly provider: 'google' | 'github' | 'microsoft' | 'apple' | string;
13
- readonly enabled: boolean;
14
- readonly clientId: string | null;
15
- readonly hasClientSecret: boolean;
16
- readonly scopes: readonly string[];
17
- readonly updatedAt: string | null;
18
- }
19
- export declare const getOAuthProviders: (client: Client) => Promise<{
20
- providers: readonly OAuthProviderConfig[];
21
- }>;
22
- export interface UpdateOAuthProvidersInput {
23
- readonly providers: readonly {
24
- readonly provider: string;
25
- readonly enabled: boolean;
26
- readonly clientId?: string;
27
- /** Omit to keep the stored secret; pass `null` to clear; pass a new string to rotate. */
28
- readonly clientSecret?: string | null;
29
- readonly scopes?: readonly string[];
30
- }[];
31
- }
32
- export declare const updateOAuthProviders: (client: Client, body: UpdateOAuthProvidersInput) => Promise<{
33
- providers: readonly OAuthProviderConfig[];
34
- }>;
35
- /**
36
- * Rotate a single OAuth provider's client secret without touching the
37
- * rest of the provider list. Convenience wrapper over
38
- * `updateOAuthProviders` — Phase 4b SOTA addition (ADR-089 Matrix 2 gap).
39
- */
40
- export declare const rotateOAuthSecret: (client: Client, provider: string, newClientSecret: string) => Promise<{
41
- providers: readonly OAuthProviderConfig[];
42
- }>;
43
- export interface AuthSettings {
44
- readonly passwordMinLength: number;
45
- readonly passwordRequireMixedCase: boolean;
46
- readonly passwordRequireDigits: boolean;
47
- readonly passwordRequireSymbols: boolean;
48
- readonly mfaRequired: boolean;
49
- readonly mfaGracePeriodDays: number;
50
- readonly sessionMaxAgeSeconds: number;
51
- readonly sessionIdleTimeoutSeconds: number;
52
- readonly allowSignup: boolean;
53
- readonly allowedEmailDomains: readonly string[] | null;
54
- }
55
- export declare const getAuthSettings: (client: Client) => Promise<{
56
- settings: AuthSettings;
57
- }>;
58
- export declare const updateAuthSettings: (client: Client, body: Partial<AuthSettings>) => Promise<{
59
- settings: AuthSettings;
60
- }>;
61
- export interface AuthStats {
62
- readonly totalUsers: number;
63
- readonly activeLast24h: number;
64
- readonly activeLast7d: number;
65
- readonly signupsLast24h: number;
66
- readonly mfaEnabledCount: number;
67
- readonly passkeyEnrolledCount: number;
68
- readonly failedLoginsLast24h: number;
69
- }
70
- export declare const getAuthStats: (client: Client) => Promise<AuthStats>;
12
+ export type { AuthSettings, AuthStats, OAuthProvidersResult, UpdateAuthSettingsInput, UpdateOAuthProvidersInput, UpdateOAuthProvidersResult, } from '@sylphx/contract';
13
+ export declare const getOAuthProviders: (client: Client, projectId: string) => Promise<OAuthProvidersResult>;
14
+ export declare const updateOAuthProviders: (client: Client, projectId: string, body: UpdateOAuthProvidersInput) => Promise<UpdateOAuthProvidersResult>;
15
+ export declare const getAuthSettings: (client: Client, projectId: string) => Promise<AuthSettings>;
16
+ export declare const updateAuthSettings: (client: Client, projectId: string, body: UpdateAuthSettingsInput) => Promise<AuthSettings>;
17
+ export declare const getAuthStats: (client: Client, projectId: string) => Promise<AuthStats>;
71
18
  //# sourceMapping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mB,EAAE,MAAM,CAAA;CACpC;AAED,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,KAAG,OAAO,CAAC,SAAS,CAG9D,CAAA"}
1
+ {"version":3,"file":"authSettings.d.ts","sourceRoot":"","sources":["../src/authSettings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,YAAY,EACX,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,GAC1B,MAAM,kBAAkB,CAAA;AAEzB,eAAO,MAAM,iBAAiB,GAC7B,QAAQ,MAAM,EACd,WAAW,MAAM,KACf,OAAO,CAAC,oBAAoB,CAG9B,CAAA;AAED,eAAO,MAAM,oBAAoB,GAChC,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,MAAM,yBAAyB,KAC7B,OAAO,CAAC,0BAA0B,CAGpC,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,YAAY,CAGvF,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC9B,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,MAAM,uBAAuB,KAC3B,OAAO,CAAC,YAAY,CAGtB,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,SAAS,CAGjF,CAAA"}
@@ -8,32 +8,24 @@
8
8
  * `apps/api/src/server/platform/routes/auth.ts`.
9
9
  */
10
10
  import { authAdminEndpoints } from '@sylphx/contract';
11
- import { request } from './http.js';
12
- export const getOAuthProviders = (client) => {
11
+ import { interpolatePath, request } from './http.js';
12
+ export const getOAuthProviders = (client, projectId) => {
13
13
  const { method, path } = authAdminEndpoints.getOAuthProviders;
14
- return request(client, method, path);
14
+ return request(client, method, interpolatePath(path, { id: projectId }));
15
15
  };
16
- export const updateOAuthProviders = (client, body) => {
16
+ export const updateOAuthProviders = (client, projectId, body) => {
17
17
  const { method, path } = authAdminEndpoints.updateOAuthProviders;
18
- return request(client, method, path, { body });
18
+ return request(client, method, interpolatePath(path, { id: projectId }), { body });
19
19
  };
20
- /**
21
- * Rotate a single OAuth provider's client secret without touching the
22
- * rest of the provider list. Convenience wrapper over
23
- * `updateOAuthProviders` — Phase 4b SOTA addition (ADR-089 Matrix 2 gap).
24
- */
25
- export const rotateOAuthSecret = (client, provider, newClientSecret) => updateOAuthProviders(client, {
26
- providers: [{ provider, enabled: true, clientSecret: newClientSecret }],
27
- });
28
- export const getAuthSettings = (client) => {
20
+ export const getAuthSettings = (client, projectId) => {
29
21
  const { method, path } = authAdminEndpoints.getAuthSettings;
30
- return request(client, method, path);
22
+ return request(client, method, interpolatePath(path, { id: projectId }));
31
23
  };
32
- export const updateAuthSettings = (client, body) => {
24
+ export const updateAuthSettings = (client, projectId, body) => {
33
25
  const { method, path } = authAdminEndpoints.updateAuthSettings;
34
- return request(client, method, path, { body });
26
+ return request(client, method, interpolatePath(path, { id: projectId }), { body });
35
27
  };
36
- export const getAuthStats = (client) => {
28
+ export const getAuthStats = (client, projectId) => {
37
29
  const { method, path } = authAdminEndpoints.getAuthStats;
38
- return request(client, method, path);
30
+ return request(client, method, interpolatePath(path, { id: projectId }));
39
31
  };
package/dist/backups.d.ts CHANGED
@@ -10,29 +10,14 @@
10
10
  * accessed via `authedFetch` in the CLI; promoted to a first-class SDK
11
11
  * module per ADR-077 trio-completeness.
12
12
  */
13
+ import type { BackupEntry, DeleteBackupResult, ListBackupsResult, RestoreBackupResult, TriggerBackupResult } from '@sylphx/contract';
13
14
  import type { Client } from './client.js';
14
- export type BackupStatus = 'completed' | 'in_progress' | 'failed';
15
- export interface Backup {
16
- readonly id: string;
17
- readonly projectId: string;
18
- readonly envId: string;
19
- readonly key: string;
20
- readonly timestamp: string;
21
- readonly sizeBytes: number;
22
- readonly status: BackupStatus;
23
- }
24
- export interface ListResult {
25
- readonly backups: readonly Backup[];
26
- readonly total: number;
27
- }
15
+ export type BackupStatus = BackupEntry['status'];
16
+ export type Backup = BackupEntry;
17
+ export type ListResult = ListBackupsResult;
28
18
  export declare const list: (client: Client, projectId: string, envId?: string) => Promise<ListResult>;
29
- export declare const trigger: (client: Client, projectId: string, envId: string) => Promise<{
30
- backup: Backup;
31
- }>;
32
- export declare const restore: (client: Client, backupId: string, targetDatabaseUrl?: string) => Promise<{
33
- success: boolean;
34
- message: string;
35
- }>;
19
+ export declare const trigger: (client: Client, projectId: string, envId: string) => Promise<TriggerBackupResult>;
20
+ export declare const restore: (client: Client, backupId: string, targetDatabaseUrl?: string) => Promise<RestoreBackupResult>;
36
21
  /**
37
22
  * Point-in-time recovery. Targets a specific timestamp between the most
38
23
  * recent base backup and current time; the platform walks WAL to land
@@ -59,8 +44,6 @@ export declare const restoreInPlace: (client: Client, backupId: string) => Promi
59
44
  success: boolean;
60
45
  message: string;
61
46
  }>;
62
- declare const _delete: (client: Client, backupId: string) => Promise<{
63
- success: boolean;
64
- }>;
47
+ declare const _delete: (client: Client, backupId: string) => Promise<DeleteBackupResult>;
65
48
  export { _delete as delete };
66
49
  //# sourceMappingURL=backups.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"backups.d.ts","sourceRoot":"","sources":["../src/backups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAA;AAEjE,MAAM,WAAW,MAAM;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ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,wGAAwG;IACxG,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CACnC,KACC,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,CACkB,CAAA;AAE/F;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAC1B,QAAQ,MAAM,EACd,UAAU,MAAM,KACd,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CACqC,CAAA;AAErF,QAAA,MAAM,OAAO,GAAI,QAAQ,MAAM,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,kBAAkB,CAG7E,CAAA;AACD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAA"}
package/dist/backups.js CHANGED
@@ -10,12 +10,23 @@
10
10
  * accessed via `authedFetch` in the CLI; promoted to a first-class SDK
11
11
  * module per ADR-077 trio-completeness.
12
12
  */
13
- import { request } from './http.js';
14
- export const list = (client, projectId, envId) => request(client, 'GET', '/backups', { query: { projectId, envId } });
15
- export const trigger = (client, projectId, envId) => request(client, 'POST', '/backups/trigger', { body: { projectId, envId } });
16
- export const restore = (client, backupId, targetDatabaseUrl) => request(client, 'POST', `/backups/${encodeURIComponent(backupId)}/restore`, {
17
- body: targetDatabaseUrl ? { targetDatabaseUrl } : {},
18
- });
13
+ import { backupsEndpoints } from '@sylphx/contract';
14
+ import { interpolatePath, request } from './http.js';
15
+ export const list = (client, projectId, envId) => {
16
+ const { method, path } = backupsEndpoints.list;
17
+ return request(client, method, path, { query: { projectId, envId } });
18
+ };
19
+ export const trigger = (client, projectId, envId) => {
20
+ const { method, path } = backupsEndpoints.trigger;
21
+ return request(client, method, path, { body: { projectId, envId } });
22
+ };
23
+ export const restore = (client, backupId, targetDatabaseUrl) => {
24
+ const { method, path } = backupsEndpoints.restore;
25
+ const body = targetDatabaseUrl ? { targetDatabaseUrl } : {};
26
+ return request(client, method, interpolatePath(path, { id: backupId }), {
27
+ body,
28
+ });
29
+ };
19
30
  /**
20
31
  * Point-in-time recovery. Targets a specific timestamp between the most
21
32
  * recent base backup and current time; the platform walks WAL to land
@@ -28,5 +39,8 @@ export const restorePointInTime = (client, databaseId, body) => request(client,
28
39
  * maintenance window.
29
40
  */
30
41
  export const restoreInPlace = (client, backupId) => request(client, 'POST', `/backups/${encodeURIComponent(backupId)}/restore-in-place`);
31
- const _delete = (client, backupId) => request(client, 'DELETE', `/backups/${encodeURIComponent(backupId)}`);
42
+ const _delete = (client, backupId) => {
43
+ const { method, path } = backupsEndpoints.delete;
44
+ return request(client, method, interpolatePath(path, { id: backupId }));
45
+ };
32
46
  export { _delete as delete };
package/dist/client.d.ts CHANGED
@@ -11,8 +11,8 @@
11
11
  * const db = await databases.create(client, { name: 'mydb', tier: 'standard', env: 'production', storageGb: 10 })
12
12
  *
13
13
  * The `Client` returned by `createClient` is a frozen value-type carrying
14
- * only the transport primitives (token, URLs, User-Agent). All business
15
- * logic lives server-side (Effect-TS, ADR-058). Capability modules
14
+ * only the transport primitives (token, URLs, User-Agent, optional fetch).
15
+ * All business logic lives server-side (Effect-TS, ADR-058). Capability modules
16
16
  * (`projects`, `databases`, …) are flat namespaces of free async
17
17
  * functions that take `Client` as their first argument. No state is
18
18
  * held in the SDK; the same `Client` may be shared across any number
@@ -28,6 +28,8 @@ export interface ClientOptions {
28
28
  readonly baseUrl?: string;
29
29
  /** User-Agent header value. Default: `@sylphx/management/1.0.0`. */
30
30
  readonly userAgent?: string;
31
+ /** Optional transport override for server-side cookie forwarding or tests. */
32
+ readonly fetch?: typeof globalThis.fetch;
31
33
  /**
32
34
  * Optional organization selector for user-context Management API calls.
33
35
  * Multi-org operators use this to scope requests without minting a separate
@@ -40,6 +42,7 @@ export interface Client {
40
42
  readonly baseUrl: string;
41
43
  readonly apiBase: string;
42
44
  readonly userAgent: string;
45
+ readonly fetch?: typeof globalThis.fetch;
43
46
  readonly preferredOrgId?: string;
44
47
  }
45
48
  export declare function createClient(opts: ClientOptions): Client;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,oEAAoE;IACpE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAChC;AAED,MAAM,WAAW,MAAM;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAChC;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAUxD"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,oEAAoE;IACpE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IACxC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAChC;AAED,MAAM,WAAW,MAAM;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IACxC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAChC;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAWxD"}
package/dist/client.js CHANGED
@@ -11,8 +11,8 @@
11
11
  * const db = await databases.create(client, { name: 'mydb', tier: 'standard', env: 'production', storageGb: 10 })
12
12
  *
13
13
  * The `Client` returned by `createClient` is a frozen value-type carrying
14
- * only the transport primitives (token, URLs, User-Agent). All business
15
- * logic lives server-side (Effect-TS, ADR-058). Capability modules
14
+ * only the transport primitives (token, URLs, User-Agent, optional fetch).
15
+ * All business logic lives server-side (Effect-TS, ADR-058). Capability modules
16
16
  * (`projects`, `databases`, …) are flat namespaces of free async
17
17
  * functions that take `Client` as their first argument. No state is
18
18
  * held in the SDK; the same `Client` may be shared across any number
@@ -29,6 +29,7 @@ export function createClient(opts) {
29
29
  baseUrl,
30
30
  apiBase: `${baseUrl}/v1`,
31
31
  userAgent: opts.userAgent ?? '@sylphx/management/1.0.0',
32
+ ...(opts.fetch ? { fetch: opts.fetch } : {}),
32
33
  ...(opts.preferredOrgId ? { preferredOrgId: opts.preferredOrgId } : {}),
33
34
  };
34
35
  return Object.freeze(client);
package/dist/domains.d.ts CHANGED
@@ -11,12 +11,16 @@ import type { Client } from './client.js';
11
11
  export interface OrgScopedRequestOptions {
12
12
  readonly orgId?: string;
13
13
  }
14
- export declare const list: (client: Client, projectId: string, envType?: string, options?: OrgScopedRequestOptions) => Promise<DomainResult[]>;
15
- export declare const create: (client: Client, projectId: string, apexDomain: string, envType?: string, options?: OrgScopedRequestOptions) => Promise<DomainResult>;
14
+ export interface EnvironmentTargetRequestOptions extends OrgScopedRequestOptions {
15
+ readonly envId?: string;
16
+ }
17
+ export declare const list: (client: Client, projectId: string, envType?: string, options?: EnvironmentTargetRequestOptions) => Promise<DomainResult[]>;
18
+ export declare const create: (client: Client, projectId: string, apexDomain: string, envType?: string, options?: EnvironmentTargetRequestOptions) => Promise<DomainResult>;
16
19
  export interface AddHostnameOpts extends Omit<AddHostnameInput, 'hostname'> {
17
20
  readonly envType?: string;
21
+ readonly envId?: string;
18
22
  }
19
- export declare const addHostname: (client: Client, projectId: string, domainId: string, hostname: string, opts?: AddHostnameOpts, options?: OrgScopedRequestOptions) => Promise<DomainHostname>;
23
+ export declare const addHostname: (client: Client, projectId: string, domainId: string, hostname: string, opts: AddHostnameOpts, options?: OrgScopedRequestOptions) => Promise<DomainHostname>;
20
24
  export declare const removeHostname: (client: Client, projectId: string, domainId: string, hostnameId: string, options?: OrgScopedRequestOptions) => Promise<void>;
21
25
  export declare const checkHostname: (client: Client, projectId: string, domainId: string, hostnameId: string, options?: OrgScopedRequestOptions) => Promise<DomainHostname>;
22
26
  export interface EnableEmailOpts {
@@ -1 +1 @@
1
- {"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../src/domains.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACX,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,MAAM,IAAI,YAAY,EACtB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACvB;AAQD,eAAO,MAAM,IAAI,GAChB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,gBAAsB,EACtB,UAAS,uBAA4B,K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M,EACd,WAAW,MAAM,EACjB,UAAU,MAAM,EAChB,YAAY,MAAM,EAClB,UAAS,uBAA4B,KACnC,OAAO,CAAC,IAAI,CAKd,CAAA;AAID,eAAO,MAAM,aAAa,GACzB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,UAAU,MAAM,EAChB,YAAY,MAAM,EAClB,UAAS,uBAA4B,KACnC,OAAO,CAAC,cAAc,CAMvB,CAAA;AAEF,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CACjC;AAED,eAAO,MAAM,WAAW,GACvB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,UAAU,MAAM,EAChB,OAAO,eAAe,EACtB,UAAS,uBAA4B,KACnC,OAAO,CAAC,kBAAkB,CAM3B,CAAA;AAEF,eAAO,MAAM,UAAU,GACtB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,UAAU,MAAM,EAChB,UAAS,uBAA4B,KACnC,OAAO,CAAC,kBAAkB,CAM3B,CAAA;AAEF,eAAO,MAAM,YAAY,GACxB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,UAAU,MAAM,EAChB,UAAS,uBAA4B,KACnC,OAAO,CAAC,IAAI,CAMb,CAAA"}
package/dist/domains.js CHANGED
@@ -14,22 +14,22 @@ const orgHeaders = (options = {}) => ({
14
14
  export const list = (client, projectId, envType = 'production', options = {}) => {
15
15
  const { method, path } = domainsEndpoints.list;
16
16
  return request(client, method, interpolatePath(path, { projectId }), {
17
- query: { envType },
17
+ query: { envType, envId: options.envId },
18
18
  headers: orgHeaders(options),
19
19
  });
20
20
  };
21
21
  export const create = (client, projectId, apexDomain, envType = 'production', options = {}) => {
22
22
  const { method, path } = domainsEndpoints.create;
23
23
  return request(client, method, interpolatePath(path, { projectId }), {
24
- body: { apexDomain, envType },
24
+ body: { apexDomain, envType, envId: options.envId },
25
25
  headers: orgHeaders(options),
26
26
  });
27
27
  };
28
28
  export const addHostname = (client, projectId, domainId, hostname, opts, options = {}) => {
29
29
  const { method, path } = domainsEndpoints.addHostname;
30
- const { envType = 'production', ...body } = opts ?? {};
30
+ const { envType = 'production', envId, ...body } = opts;
31
31
  return request(client, method, interpolatePath(path, { projectId, domainId }), {
32
- query: { envType },
32
+ query: { envType, envId },
33
33
  body: { hostname, ...body },
34
34
  headers: orgHeaders(options),
35
35
  });
package/dist/email.d.ts CHANGED
@@ -1,45 +1,38 @@
1
1
  /**
2
- * Transactional email — admin surface (logs + settings).
2
+ * Transactional email — Management surface (logs, suppressions, settings).
3
3
  *
4
4
  * GET /email/projects/:id/logs?limit=&status=
5
+ * GET /email/projects/:id/suppressions?limit=&cursor=&email=&reason=
6
+ * POST /email/projects/:id/suppressions
7
+ * DELETE /email/projects/:id/suppressions/:email
5
8
  * GET /email/projects/:id/email-settings
6
9
  * PATCH /email/projects/:id/email-settings
7
10
  *
8
11
  * The runtime `send` verb lives in `@sylphx/sdk` per ADR-083 (BaaS data
9
12
  * plane). Only admin-facing observation / configuration remains here.
10
13
  */
14
+ import { type AddSuppressionInput, type EmailLogDetail, type EmailLogEvent, type EmailLogItem, type EmailSettings, type ListEmailLogsQuery, type ListEmailLogsResult, type ListSuppressionsResult, type SuppressionItem, type SuppressionReason, type UpdateEmailSettingsInput } from '@sylphx/contract';
11
15
  import type { Client } from './client.js';
12
- export interface EmailLogEntry {
13
- readonly id: string;
14
- readonly to: string;
15
- readonly from: string | null;
16
- readonly subject: string;
17
- readonly status: string;
18
- readonly createdAt: string;
19
- }
20
16
  export interface ListLogsOptions {
17
+ readonly cursor?: string;
18
+ readonly email?: string;
19
+ readonly from?: string;
21
20
  readonly limit?: number;
22
- readonly status?: string;
21
+ readonly status?: NonNullable<ListEmailLogsQuery['status']>;
22
+ readonly to?: string;
23
23
  }
24
- export declare const listLogs: (client: Client, projectId: string, options?: ListLogsOptions) => Promise<{
25
- logs: readonly EmailLogEntry[];
26
- }>;
27
- export interface EmailSettings {
28
- readonly defaultFromEmail: string | null;
29
- readonly defaultFromName: string | null;
30
- readonly webhookUrl: string | null;
31
- readonly trackOpens: boolean | null;
32
- readonly trackClicks: boolean | null;
24
+ export declare const listLogs: (client: Client, projectId: string, options?: ListLogsOptions) => Promise<ListEmailLogsResult>;
25
+ export declare const getLog: (client: Client, projectId: string, logId: string) => Promise<EmailLogDetail>;
26
+ export type { AddSuppressionInput, EmailLogDetail, EmailLogEvent, EmailLogItem, EmailSettings, ListEmailLogsResult, ListSuppressionsResult, SuppressionItem, SuppressionReason, UpdateEmailSettingsInput, };
27
+ export interface ListSuppressionsOptions {
28
+ readonly cursor?: string;
29
+ readonly email?: string;
30
+ readonly limit?: number;
31
+ readonly reason?: SuppressionReason;
33
32
  }
33
+ export declare const listSuppressions: (client: Client, projectId: string, options?: ListSuppressionsOptions) => Promise<ListSuppressionsResult>;
34
+ export declare const addSuppression: (client: Client, projectId: string, input: AddSuppressionInput) => Promise<SuppressionItem>;
35
+ export declare const deleteSuppression: (client: Client, projectId: string, email: string) => Promise<SuppressionItem>;
34
36
  export declare const getSettings: (client: Client, projectId: string) => Promise<EmailSettings>;
35
- export interface UpdateSettingsInput {
36
- readonly fromEmail?: string;
37
- readonly fromName?: string;
38
- readonly webhookUrl?: string;
39
- readonly trackOpens?: boolean;
40
- readonly trackClicks?: boolean;
41
- }
42
- export declare const updateSettings: (client: Client, projectId: string, input: UpdateSettingsInput) => Promise<{
43
- success: boolean;
44
- }>;
37
+ export declare const updateSettings: (client: Client, projectId: string, input: UpdateEmailSettingsInput) => Promise<EmailSettings>;
45
38
  //# sourceMappingURL=email.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAA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