@zitadel/sdk-angular 0.1.0-alpha.9 → 1.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -4
- package/dist/index.js +240 -0
- package/dist/types/lib/config.d.ts +34 -0
- package/dist/types/lib/config.d.ts.map +1 -0
- package/dist/types/lib/zitadel-login.component.d.ts +54 -0
- package/dist/types/lib/zitadel-login.component.d.ts.map +1 -0
- package/dist/types/lib/zitadel-logout.component.d.ts +33 -0
- package/dist/types/lib/zitadel-logout.component.d.ts.map +1 -0
- package/dist/types/lib/zitadel-session.component.d.ts +37 -0
- package/dist/types/lib/zitadel-session.component.d.ts.map +1 -0
- package/dist/types/public-api.d.ts +8 -0
- package/dist/types/public-api.d.ts.map +1 -0
- package/dist/types/test-setup.d.ts +2 -0
- package/dist/types/test-setup.d.ts.map +1 -0
- package/package.json +51 -18
- package/fesm2022/zitadel-sdk-angular.mjs +0 -112
- package/fesm2022/zitadel-sdk-angular.mjs.map +0 -1
- package/types/zitadel-sdk-angular.d.ts +0 -73
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Angular components for the Zitadel auth UI, for client-side SPAs.
|
|
4
4
|
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
TypeScript ≥ 5.0 — the published type definitions re-export with `export type *`, which TypeScript introduced in 5.0.
|
|
8
|
+
|
|
5
9
|
## Usage
|
|
6
10
|
|
|
7
11
|
```ts
|
|
@@ -26,12 +30,21 @@ export class LoginPage {
|
|
|
26
30
|
|
|
27
31
|
`<zitadel-auth-logout [project]="project" postSignOutUrl="/login" />` works the same way.
|
|
28
32
|
|
|
33
|
+
The signed-in session card is `<zitadel-auth-session>` (exported as `ZitadelSessionComponent`).
|
|
34
|
+
|
|
29
35
|
> The wrapper uses the selector `zitadel-auth-login` (not `zitadel-login`) because
|
|
30
36
|
> the latter is the underlying custom element the component renders internally.
|
|
31
37
|
|
|
32
38
|
## Proxying to the backend (deployment)
|
|
33
39
|
|
|
34
|
-
The widgets call `${proxyPath}/…` same-origin (default `/__nextgen`).
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
The widgets call `${proxyPath}/…` same-origin (default `/__nextgen`). In
|
|
41
|
+
production the same-origin path must come from your hosting platform — until
|
|
42
|
+
the CLI can scaffold those configs, **production SPA deployment is not yet
|
|
43
|
+
supported**; see
|
|
44
|
+
[ADR 036](https://github.com/zitadel/nextgen/blob/main/docs/adrs/036-api-credential-planes.md)
|
|
45
|
+
and [zitadel/nextgen#560](https://github.com/zitadel/nextgen/issues/560). The
|
|
46
|
+
CLI dev proxy covers local development.
|
|
47
|
+
|
|
48
|
+
For local development you can also skip the proxy and point `proxyPath`
|
|
49
|
+
straight at the backend (cross-origin), e.g. `proxyPath: "http://localhost:8080"`
|
|
50
|
+
(the `zitadel start` local runtime default port).
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import * as t from "@angular/core";
|
|
2
|
+
import { EventEmitter as o, ViewChild as g, Output as p, Input as e, CUSTOM_ELEMENTS_SCHEMA as d, Component as m } from "@angular/core";
|
|
3
|
+
import { businessLocales as I } from "@zitadel/components";
|
|
4
|
+
const a = class a {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.purpose = "login", this.flowStep = new o(), this.flowInput = new o(), this.flowComplete = new o(), this.flowError = new o();
|
|
7
|
+
}
|
|
8
|
+
/** The underlying `<zitadel-login>` custom element, or `null` before view init. */
|
|
9
|
+
get element() {
|
|
10
|
+
return this.elementRef?.nativeElement ?? null;
|
|
11
|
+
}
|
|
12
|
+
onFlowStep(r) {
|
|
13
|
+
this.flowStep.emit(r.detail);
|
|
14
|
+
}
|
|
15
|
+
onFlowInput(r) {
|
|
16
|
+
this.flowInput.emit(r.detail);
|
|
17
|
+
}
|
|
18
|
+
onFlowComplete(r) {
|
|
19
|
+
this.flowComplete.emit(r.detail);
|
|
20
|
+
}
|
|
21
|
+
onFlowError(r) {
|
|
22
|
+
this.flowError.emit(r.detail);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
a.ɵfac = t.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: t, type: a, deps: [], target: t.ɵɵFactoryTarget.Component }), a.ɵcmp = t.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: a, isStandalone: !0, selector: "zitadel-auth-login", inputs: { project: "project", projectId: "projectId", proxyPath: "proxyPath", purpose: "purpose", flowName: "flowName", postSignInUrl: "postSignInUrl", locales: "locales", lang: "lang", variant: "variant", theme: "theme", suppressHeader: "suppressHeader" }, outputs: { flowStep: "flowStep", flowInput: "flowInput", flowComplete: "flowComplete", flowError: "flowError" }, viewQueries: [{ propertyName: "elementRef", first: !0, predicate: ["el"], descendants: !0 }], ngImport: t, template: `<zitadel-login
|
|
26
|
+
#el
|
|
27
|
+
[project]="project"
|
|
28
|
+
[projectId]="projectId"
|
|
29
|
+
[proxyPath]="proxyPath"
|
|
30
|
+
[locales]="locales"
|
|
31
|
+
[lang]="lang"
|
|
32
|
+
[attr.purpose]="purpose"
|
|
33
|
+
[attr.flow-name]="flowName"
|
|
34
|
+
[attr.post-sign-in-url]="postSignInUrl"
|
|
35
|
+
[attr.variant]="variant ?? null"
|
|
36
|
+
[attr.theme]="theme ?? null"
|
|
37
|
+
[suppressHeader]="suppressHeader"
|
|
38
|
+
(zitadel-flow-step)="onFlowStep($event)"
|
|
39
|
+
(zitadel-flow-input)="onFlowInput($event)"
|
|
40
|
+
(zitadel-flow-complete)="onFlowComplete($event)"
|
|
41
|
+
(zitadel-flow-error)="onFlowError($event)"
|
|
42
|
+
></zitadel-login>`, isInline: !0 });
|
|
43
|
+
let i = a;
|
|
44
|
+
t.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: t, type: i, decorators: [{
|
|
45
|
+
type: m,
|
|
46
|
+
args: [{
|
|
47
|
+
selector: "zitadel-auth-login",
|
|
48
|
+
standalone: !0,
|
|
49
|
+
schemas: [d],
|
|
50
|
+
template: `<zitadel-login
|
|
51
|
+
#el
|
|
52
|
+
[project]="project"
|
|
53
|
+
[projectId]="projectId"
|
|
54
|
+
[proxyPath]="proxyPath"
|
|
55
|
+
[locales]="locales"
|
|
56
|
+
[lang]="lang"
|
|
57
|
+
[attr.purpose]="purpose"
|
|
58
|
+
[attr.flow-name]="flowName"
|
|
59
|
+
[attr.post-sign-in-url]="postSignInUrl"
|
|
60
|
+
[attr.variant]="variant ?? null"
|
|
61
|
+
[attr.theme]="theme ?? null"
|
|
62
|
+
[suppressHeader]="suppressHeader"
|
|
63
|
+
(zitadel-flow-step)="onFlowStep($event)"
|
|
64
|
+
(zitadel-flow-input)="onFlowInput($event)"
|
|
65
|
+
(zitadel-flow-complete)="onFlowComplete($event)"
|
|
66
|
+
(zitadel-flow-error)="onFlowError($event)"
|
|
67
|
+
></zitadel-login>`
|
|
68
|
+
}]
|
|
69
|
+
}], propDecorators: { project: [{
|
|
70
|
+
type: e
|
|
71
|
+
}], projectId: [{
|
|
72
|
+
type: e
|
|
73
|
+
}], proxyPath: [{
|
|
74
|
+
type: e
|
|
75
|
+
}], purpose: [{
|
|
76
|
+
type: e
|
|
77
|
+
}], flowName: [{
|
|
78
|
+
type: e
|
|
79
|
+
}], postSignInUrl: [{
|
|
80
|
+
type: e
|
|
81
|
+
}], locales: [{
|
|
82
|
+
type: e
|
|
83
|
+
}], lang: [{
|
|
84
|
+
type: e
|
|
85
|
+
}], variant: [{
|
|
86
|
+
type: e
|
|
87
|
+
}], theme: [{
|
|
88
|
+
type: e
|
|
89
|
+
}], suppressHeader: [{
|
|
90
|
+
type: e
|
|
91
|
+
}], flowStep: [{
|
|
92
|
+
type: p
|
|
93
|
+
}], flowInput: [{
|
|
94
|
+
type: p
|
|
95
|
+
}], flowComplete: [{
|
|
96
|
+
type: p
|
|
97
|
+
}], flowError: [{
|
|
98
|
+
type: p
|
|
99
|
+
}], elementRef: [{
|
|
100
|
+
type: g,
|
|
101
|
+
args: ["el"]
|
|
102
|
+
}] } });
|
|
103
|
+
const l = class l {
|
|
104
|
+
constructor() {
|
|
105
|
+
this.signout = new o();
|
|
106
|
+
}
|
|
107
|
+
/** The underlying `<zitadel-logout>` custom element, or `null` before view init. */
|
|
108
|
+
get element() {
|
|
109
|
+
return this.elementRef?.nativeElement ?? null;
|
|
110
|
+
}
|
|
111
|
+
onSignout(r) {
|
|
112
|
+
this.signout.emit(r.detail);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
l.ɵfac = t.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: t, type: l, deps: [], target: t.ɵɵFactoryTarget.Component }), l.ɵcmp = t.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: l, isStandalone: !0, selector: "zitadel-auth-logout", inputs: { project: "project", projectId: "projectId", proxyPath: "proxyPath", postSignOutUrl: "postSignOutUrl", theme: "theme" }, outputs: { signout: "signout" }, viewQueries: [{ propertyName: "elementRef", first: !0, predicate: ["el"], descendants: !0 }], ngImport: t, template: `<zitadel-logout
|
|
116
|
+
#el
|
|
117
|
+
[project]="project"
|
|
118
|
+
[projectId]="projectId"
|
|
119
|
+
[proxyPath]="proxyPath"
|
|
120
|
+
[attr.post-sign-out-url]="postSignOutUrl"
|
|
121
|
+
[attr.theme]="theme ?? null"
|
|
122
|
+
(zitadel-signout)="onSignout($event)"
|
|
123
|
+
></zitadel-logout>`, isInline: !0 });
|
|
124
|
+
let u = l;
|
|
125
|
+
t.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: t, type: u, decorators: [{
|
|
126
|
+
type: m,
|
|
127
|
+
args: [{
|
|
128
|
+
selector: "zitadel-auth-logout",
|
|
129
|
+
standalone: !0,
|
|
130
|
+
schemas: [d],
|
|
131
|
+
template: `<zitadel-logout
|
|
132
|
+
#el
|
|
133
|
+
[project]="project"
|
|
134
|
+
[projectId]="projectId"
|
|
135
|
+
[proxyPath]="proxyPath"
|
|
136
|
+
[attr.post-sign-out-url]="postSignOutUrl"
|
|
137
|
+
[attr.theme]="theme ?? null"
|
|
138
|
+
(zitadel-signout)="onSignout($event)"
|
|
139
|
+
></zitadel-logout>`
|
|
140
|
+
}]
|
|
141
|
+
}], propDecorators: { project: [{
|
|
142
|
+
type: e
|
|
143
|
+
}], projectId: [{
|
|
144
|
+
type: e
|
|
145
|
+
}], proxyPath: [{
|
|
146
|
+
type: e
|
|
147
|
+
}], postSignOutUrl: [{
|
|
148
|
+
type: e
|
|
149
|
+
}], theme: [{
|
|
150
|
+
type: e
|
|
151
|
+
}], signout: [{
|
|
152
|
+
type: p
|
|
153
|
+
}], elementRef: [{
|
|
154
|
+
type: g,
|
|
155
|
+
args: ["el"]
|
|
156
|
+
}] } });
|
|
157
|
+
const n = class n {
|
|
158
|
+
constructor() {
|
|
159
|
+
this.signout = new o();
|
|
160
|
+
}
|
|
161
|
+
/** The underlying `<zitadel-session>` custom element, or `null` before view init. */
|
|
162
|
+
get element() {
|
|
163
|
+
return this.elementRef?.nativeElement ?? null;
|
|
164
|
+
}
|
|
165
|
+
onSignout(r) {
|
|
166
|
+
this.signout.emit(r.detail);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
n.ɵfac = t.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: t, type: n, deps: [], target: t.ɵɵFactoryTarget.Component }), n.ɵcmp = t.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: n, isStandalone: !0, selector: "zitadel-auth-session", inputs: { project: "project", projectId: "projectId", proxyPath: "proxyPath", postSignOutUrl: "postSignOutUrl", heading: "heading", logoutLabel: "logoutLabel", variant: "variant", theme: "theme", suppressHeader: "suppressHeader" }, outputs: { signout: "signout" }, viewQueries: [{ propertyName: "elementRef", first: !0, predicate: ["el"], descendants: !0 }], ngImport: t, template: `<zitadel-session
|
|
170
|
+
#el
|
|
171
|
+
[project]="project"
|
|
172
|
+
[projectId]="projectId"
|
|
173
|
+
[proxyPath]="proxyPath"
|
|
174
|
+
[attr.post-sign-out-url]="postSignOutUrl"
|
|
175
|
+
[attr.heading]="heading"
|
|
176
|
+
[attr.logout-label]="logoutLabel"
|
|
177
|
+
[attr.variant]="variant ?? null"
|
|
178
|
+
[attr.theme]="theme ?? null"
|
|
179
|
+
[suppressHeader]="suppressHeader"
|
|
180
|
+
(zitadel-signout)="onSignout($event)"
|
|
181
|
+
></zitadel-session>`, isInline: !0 });
|
|
182
|
+
let c = n;
|
|
183
|
+
t.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: t, type: c, decorators: [{
|
|
184
|
+
type: m,
|
|
185
|
+
args: [{
|
|
186
|
+
selector: "zitadel-auth-session",
|
|
187
|
+
standalone: !0,
|
|
188
|
+
schemas: [d],
|
|
189
|
+
template: `<zitadel-session
|
|
190
|
+
#el
|
|
191
|
+
[project]="project"
|
|
192
|
+
[projectId]="projectId"
|
|
193
|
+
[proxyPath]="proxyPath"
|
|
194
|
+
[attr.post-sign-out-url]="postSignOutUrl"
|
|
195
|
+
[attr.heading]="heading"
|
|
196
|
+
[attr.logout-label]="logoutLabel"
|
|
197
|
+
[attr.variant]="variant ?? null"
|
|
198
|
+
[attr.theme]="theme ?? null"
|
|
199
|
+
[suppressHeader]="suppressHeader"
|
|
200
|
+
(zitadel-signout)="onSignout($event)"
|
|
201
|
+
></zitadel-session>`
|
|
202
|
+
}]
|
|
203
|
+
}], propDecorators: { project: [{
|
|
204
|
+
type: e
|
|
205
|
+
}], projectId: [{
|
|
206
|
+
type: e
|
|
207
|
+
}], proxyPath: [{
|
|
208
|
+
type: e
|
|
209
|
+
}], postSignOutUrl: [{
|
|
210
|
+
type: e
|
|
211
|
+
}], heading: [{
|
|
212
|
+
type: e
|
|
213
|
+
}], logoutLabel: [{
|
|
214
|
+
type: e
|
|
215
|
+
}], variant: [{
|
|
216
|
+
type: e
|
|
217
|
+
}], theme: [{
|
|
218
|
+
type: e
|
|
219
|
+
}], suppressHeader: [{
|
|
220
|
+
type: e
|
|
221
|
+
}], signout: [{
|
|
222
|
+
type: p
|
|
223
|
+
}], elementRef: [{
|
|
224
|
+
type: g,
|
|
225
|
+
args: ["el"]
|
|
226
|
+
}] } });
|
|
227
|
+
function y(s) {
|
|
228
|
+
return Object.freeze({
|
|
229
|
+
proxyPath: s.proxyPath ?? "/__nextgen",
|
|
230
|
+
projectId: s.projectId,
|
|
231
|
+
url: s.url
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
export {
|
|
235
|
+
i as ZitadelLoginComponent,
|
|
236
|
+
u as ZitadelLogoutComponent,
|
|
237
|
+
c as ZitadelSessionComponent,
|
|
238
|
+
I as businessLocales,
|
|
239
|
+
y as configureZitadel
|
|
240
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK configuration for the Angular wrapper.
|
|
3
|
+
*
|
|
4
|
+
* `@zitadel/api` is published with subpath-only `exports` and no main entry,
|
|
5
|
+
* which ng-packagr's module resolution cannot follow. For the client-side SPA
|
|
6
|
+
* (prop-based) flow the widget only needs a plain handle — `{ projectId,
|
|
7
|
+
* proxyPath }` — which it reads directly. So this package builds that handle
|
|
8
|
+
* locally rather than importing `configureZitadel` from `@zitadel/api`, keeping
|
|
9
|
+
* the Angular library self-contained.
|
|
10
|
+
*/
|
|
11
|
+
/** Frozen project handle passed to the widgets via the `project` input. */
|
|
12
|
+
export interface ZitadelProject {
|
|
13
|
+
readonly proxyPath: string;
|
|
14
|
+
readonly projectId: string;
|
|
15
|
+
readonly url?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Input options for {@link configureZitadel}. */
|
|
18
|
+
export interface ZitadelConfig {
|
|
19
|
+
/** Proxy path for API requests. Defaults to `"/__nextgen"`. */
|
|
20
|
+
proxyPath?: string;
|
|
21
|
+
/** Project id passed to flow creation. */
|
|
22
|
+
projectId: string;
|
|
23
|
+
/** Full backend URL (server-side only; optional for client SPAs). */
|
|
24
|
+
url?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Builds the project handle to pass to `<zitadel-auth-login [project]>`.
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* const project = configureZitadel({ projectId: "…", proxyPath: "/__nextgen" });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function configureZitadel(config: ZitadelConfig): ZitadelProject;
|
|
34
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,cAAc,CAMtE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ZitadelLogin as ZitadelLoginElement } from "@zitadel/components";
|
|
2
|
+
import type { CreateFlowBodyPurpose, ZitadelFlowCompleteDetail, ZitadelFlowErrorDetail, ZitadelFlowInputDetail, ZitadelFlowStepDetail } from "@zitadel/sdk-core/types";
|
|
3
|
+
import { EventEmitter } from "@angular/core";
|
|
4
|
+
import type { ZitadelProject } from "./config";
|
|
5
|
+
import "@zitadel/components";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Angular wrapper for the `<zitadel-login>` Lit web component.
|
|
9
|
+
*
|
|
10
|
+
* Uses a distinct selector (`zitadel-auth-login`) and renders the real custom
|
|
11
|
+
* element in its template under `CUSTOM_ELEMENTS_SCHEMA`. The `project` handle
|
|
12
|
+
* (from `configureZitadel(...)`) is bound as a DOM **property** via `[project]`,
|
|
13
|
+
* as are the discrete `projectId` / `proxyPath` the element reads when no handle
|
|
14
|
+
* is supplied; `purpose` / `post-sign-in-url` are bound as attributes the Lit
|
|
15
|
+
* element reads. The widget's `zitadel-*` events are re-emitted with their
|
|
16
|
+
* detail as the `flowStep` / `flowInput` / `flowComplete` / `flowError` outputs.
|
|
17
|
+
*
|
|
18
|
+
* The underlying `<zitadel-login>` custom element is exposed via the
|
|
19
|
+
* {@link element} getter so a consumer holding the component (e.g. via
|
|
20
|
+
* `@ViewChild(ZitadelLoginComponent)`) can reach the real DOM element — the
|
|
21
|
+
* Angular analogue of React's `forwardRef`.
|
|
22
|
+
*
|
|
23
|
+
* ```html
|
|
24
|
+
* <zitadel-auth-login [project]="project" purpose="login" postSignInUrl="/"
|
|
25
|
+
* (flowComplete)="onComplete($event)" />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare class ZitadelLoginComponent {
|
|
29
|
+
project?: ZitadelProject;
|
|
30
|
+
projectId?: string;
|
|
31
|
+
proxyPath?: string;
|
|
32
|
+
purpose: CreateFlowBodyPurpose;
|
|
33
|
+
flowName?: string;
|
|
34
|
+
postSignInUrl?: string;
|
|
35
|
+
locales?: Record<string, Partial<Record<string, string>>>;
|
|
36
|
+
lang?: string;
|
|
37
|
+
variant?: "widget" | "page";
|
|
38
|
+
theme?: "light" | "dark" | "auto";
|
|
39
|
+
suppressHeader?: boolean;
|
|
40
|
+
flowStep: EventEmitter<ZitadelFlowStepDetail>;
|
|
41
|
+
flowInput: EventEmitter<ZitadelFlowInputDetail>;
|
|
42
|
+
flowComplete: EventEmitter<ZitadelFlowCompleteDetail>;
|
|
43
|
+
flowError: EventEmitter<ZitadelFlowErrorDetail>;
|
|
44
|
+
private elementRef?;
|
|
45
|
+
/** The underlying `<zitadel-login>` custom element, or `null` before view init. */
|
|
46
|
+
get element(): ZitadelLoginElement | null;
|
|
47
|
+
onFlowStep(event: Event): void;
|
|
48
|
+
onFlowInput(event: Event): void;
|
|
49
|
+
onFlowComplete(event: Event): void;
|
|
50
|
+
onFlowError(event: Event): void;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ZitadelLoginComponent, never>;
|
|
52
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ZitadelLoginComponent, "zitadel-auth-login", never, { "project": { "alias": "project"; "required": false; }; "projectId": { "alias": "projectId"; "required": false; }; "proxyPath": { "alias": "proxyPath"; "required": false; }; "purpose": { "alias": "purpose"; "required": false; }; "flowName": { "alias": "flowName"; "required": false; }; "postSignInUrl": { "alias": "postSignInUrl"; "required": false; }; "locales": { "alias": "locales"; "required": false; }; "lang": { "alias": "lang"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "suppressHeader": { "alias": "suppressHeader"; "required": false; }; }, { "flowStep": "flowStep"; "flowInput": "flowInput"; "flowComplete": "flowComplete"; "flowError": "flowError"; }, never, never, true, never>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=zitadel-login.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zitadel-login.component.d.ts","sourceRoot":"","sources":["../../../src/lib/zitadel-login.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAGL,YAAY,EAIb,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,qBAAqB,CAAC;;AAE7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAuBa,qBAAqB;IACvB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,qBAAqB,CAAW;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,cAAc,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,sCAA6C;IACrD,SAAS,uCAA8C;IACvD,YAAY,0CAAiD;IAC7D,SAAS,uCAA8C;IAEhD,OAAO,CAAC,UAAU,CAAC,CAAkC;IAEtE,mFAAmF;IACnF,IAAI,OAAO,IAAI,mBAAmB,GAAG,IAAI,CAExC;IAED,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI9B,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI/B,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAIlC,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;yCApCpB,qBAAqB;2CAArB,qBAAqB;CAuCjC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ZitadelLogout as ZitadelLogoutElement } from "@zitadel/components";
|
|
2
|
+
import type { ZitadelSignoutDetail } from "@zitadel/sdk-core/types";
|
|
3
|
+
import { EventEmitter } from "@angular/core";
|
|
4
|
+
import type { ZitadelProject } from "./config";
|
|
5
|
+
import "@zitadel/components";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Angular wrapper for the `<zitadel-logout>` Lit web component. See
|
|
9
|
+
* {@link ZitadelLoginComponent} for the strategy. The widget's
|
|
10
|
+
* `zitadel-signout` event is re-emitted with its detail as the `signout`
|
|
11
|
+
* output. The underlying `<zitadel-logout>` custom element is exposed via the
|
|
12
|
+
* {@link element} getter (the Angular analogue of React's `forwardRef`).
|
|
13
|
+
*
|
|
14
|
+
* ```html
|
|
15
|
+
* <zitadel-auth-logout [project]="project" postSignOutUrl="/login"
|
|
16
|
+
* (signout)="onSignout($event)" />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class ZitadelLogoutComponent {
|
|
20
|
+
project?: ZitadelProject;
|
|
21
|
+
projectId?: string;
|
|
22
|
+
proxyPath?: string;
|
|
23
|
+
postSignOutUrl?: string;
|
|
24
|
+
theme?: "light" | "dark" | "auto";
|
|
25
|
+
signout: EventEmitter<ZitadelSignoutDetail>;
|
|
26
|
+
private elementRef?;
|
|
27
|
+
/** The underlying `<zitadel-logout>` custom element, or `null` before view init. */
|
|
28
|
+
get element(): ZitadelLogoutElement | null;
|
|
29
|
+
onSignout(event: Event): void;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ZitadelLogoutComponent, never>;
|
|
31
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ZitadelLogoutComponent, "zitadel-auth-logout", never, { "project": { "alias": "project"; "required": false; }; "projectId": { "alias": "projectId"; "required": false; }; "proxyPath": { "alias": "proxyPath"; "required": false; }; "postSignOutUrl": { "alias": "postSignOutUrl"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; }, { "signout": "signout"; }, never, never, true, never>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=zitadel-logout.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zitadel-logout.component.d.ts","sourceRoot":"","sources":["../../../src/lib/zitadel-logout.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,EAGL,YAAY,EAIb,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,qBAAqB,CAAC;;AAE7B;;;;;;;;;;;GAWG;AACH,qBAca,sBAAsB;IACxB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,OAAO,qCAA4C;IAE5C,OAAO,CAAC,UAAU,CAAC,CAAmC;IAEvE,oFAAoF;IACpF,IAAI,OAAO,IAAI,oBAAoB,GAAG,IAAI,CAEzC;IAED,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;yCAflB,sBAAsB;2CAAtB,sBAAsB;CAkBlC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ZitadelSession as ZitadelSessionElement } from "@zitadel/components";
|
|
2
|
+
import type { ZitadelSignoutDetail } from "@zitadel/sdk-core/types";
|
|
3
|
+
import { EventEmitter } from "@angular/core";
|
|
4
|
+
import type { ZitadelProject } from "./config";
|
|
5
|
+
import "@zitadel/components";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Angular wrapper for the `<zitadel-session>` Lit web component — the
|
|
9
|
+
* post-sign-in "signed in as" card. See {@link ZitadelLoginComponent} for the
|
|
10
|
+
* strategy. The widget's `zitadel-signout` event is re-emitted with its detail
|
|
11
|
+
* as the `signout` output. The underlying `<zitadel-session>` custom element is
|
|
12
|
+
* exposed via the {@link element} getter.
|
|
13
|
+
*
|
|
14
|
+
* ```html
|
|
15
|
+
* <zitadel-auth-session [project]="project" postSignOutUrl="/login"
|
|
16
|
+
* (signout)="onSignout($event)" />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class ZitadelSessionComponent {
|
|
20
|
+
project?: ZitadelProject;
|
|
21
|
+
projectId?: string;
|
|
22
|
+
proxyPath?: string;
|
|
23
|
+
postSignOutUrl?: string;
|
|
24
|
+
heading?: string;
|
|
25
|
+
logoutLabel?: string;
|
|
26
|
+
variant?: "widget" | "page";
|
|
27
|
+
theme?: "light" | "dark" | "auto";
|
|
28
|
+
suppressHeader?: boolean;
|
|
29
|
+
signout: EventEmitter<ZitadelSignoutDetail>;
|
|
30
|
+
private elementRef?;
|
|
31
|
+
/** The underlying `<zitadel-session>` custom element, or `null` before view init. */
|
|
32
|
+
get element(): ZitadelSessionElement | null;
|
|
33
|
+
onSignout(event: Event): void;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ZitadelSessionComponent, never>;
|
|
35
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ZitadelSessionComponent, "zitadel-auth-session", never, { "project": { "alias": "project"; "required": false; }; "projectId": { "alias": "projectId"; "required": false; }; "proxyPath": { "alias": "proxyPath"; "required": false; }; "postSignOutUrl": { "alias": "postSignOutUrl"; "required": false; }; "heading": { "alias": "heading"; "required": false; }; "logoutLabel": { "alias": "logoutLabel"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "suppressHeader": { "alias": "suppressHeader"; "required": false; }; }, { "signout": "signout"; }, never, never, true, never>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=zitadel-session.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zitadel-session.component.d.ts","sourceRoot":"","sources":["../../../src/lib/zitadel-session.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,EAGL,YAAY,EAIb,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,qBAAqB,CAAC;;AAE7B;;;;;;;;;;;GAWG;AACH,qBAkBa,uBAAuB;IACzB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,cAAc,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,qCAA4C;IAE5C,OAAO,CAAC,UAAU,CAAC,CAAoC;IAExE,qFAAqF;IACrF,IAAI,OAAO,IAAI,qBAAqB,GAAG,IAAI,CAE1C;IAED,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;yCAnBlB,uBAAuB;2CAAvB,uBAAuB;CAsBnC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ZitadelLoginComponent } from "./lib/zitadel-login.component";
|
|
2
|
+
export { ZitadelLogoutComponent } from "./lib/zitadel-logout.component";
|
|
3
|
+
export { ZitadelSessionComponent } from "./lib/zitadel-session.component";
|
|
4
|
+
export { configureZitadel } from "./lib/config";
|
|
5
|
+
export type { ZitadelConfig, ZitadelProject } from "./lib/config";
|
|
6
|
+
export type * from "@zitadel/sdk-core/types";
|
|
7
|
+
export { businessLocales } from "@zitadel/components";
|
|
8
|
+
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGlE,mBAAmB,yBAAyB,CAAC;AAI7C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../../src/test-setup.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,41 +1,74 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zitadel/sdk-angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0-alpha.20",
|
|
4
4
|
"description": "Angular components for the Zitadel auth UI (client-side SPA).",
|
|
5
5
|
"homepage": "https://github.com/zitadel/nextgen/tree/main/packages/sdk-angular#readme",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/zitadel/nextgen/issues"
|
|
8
8
|
},
|
|
9
|
-
"license": "MIT",
|
|
10
9
|
"repository": {
|
|
11
10
|
"type": "git",
|
|
12
11
|
"url": "git+https://github.com/zitadel/nextgen.git",
|
|
13
12
|
"directory": "packages/sdk-angular"
|
|
14
13
|
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"module": "./dist/index.js",
|
|
20
|
+
"types": "./dist/types/public-api.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/types/public-api.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
15
27
|
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
17
|
-
"directory": "dist"
|
|
28
|
+
"access": "public"
|
|
18
29
|
},
|
|
19
30
|
"dependencies": {
|
|
20
31
|
"tslib": "^2.6.0",
|
|
21
|
-
"@zitadel/api": "
|
|
22
|
-
"@zitadel/components": "
|
|
32
|
+
"@zitadel/api": "1.0.0-alpha.20",
|
|
33
|
+
"@zitadel/components": "1.0.0-alpha.20",
|
|
34
|
+
"@zitadel/sdk-core": "1.0.0-alpha.20"
|
|
23
35
|
},
|
|
24
36
|
"peerDependencies": {
|
|
25
37
|
"@angular/common": ">=17",
|
|
26
38
|
"@angular/core": ">=17"
|
|
27
39
|
},
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@analogjs/vite-plugin-angular": "^2.6.1",
|
|
42
|
+
"@analogjs/vitest-angular": "^2.6.1",
|
|
43
|
+
"@angular/build": "^22.0.5",
|
|
44
|
+
"@angular/common": "^22.0.5",
|
|
45
|
+
"@angular/compiler": "^22.0.5",
|
|
46
|
+
"@angular/compiler-cli": "^22.0.5",
|
|
47
|
+
"@angular/core": "^22.0.5",
|
|
48
|
+
"@angular/platform-browser": "^22.0.5",
|
|
49
|
+
"@angular/router": "^22.0.5",
|
|
50
|
+
"@eslint/js": "^9.0.0",
|
|
51
|
+
"@eslint/json": "^0.11.0",
|
|
52
|
+
"@eslint/markdown": "^6.0.0",
|
|
53
|
+
"@testing-library/angular": "^19.4.1",
|
|
54
|
+
"eslint": "^9.0.0",
|
|
55
|
+
"eslint-config-prettier": "^10.0.0",
|
|
56
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
57
|
+
"eslint-plugin-import": "^2.31.0",
|
|
58
|
+
"eslint-plugin-perfectionist": "^4.0.0",
|
|
59
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
60
|
+
"jsdom": "^29.0.2",
|
|
61
|
+
"prettier": "^3.0.0",
|
|
62
|
+
"typescript": "^6.0.3",
|
|
63
|
+
"typescript-eslint": "^8.0.0",
|
|
64
|
+
"vite": "^7.3.5",
|
|
65
|
+
"vitest": "^3.0.0",
|
|
66
|
+
"zone.js": "~0.16.0"
|
|
38
67
|
},
|
|
39
|
-
"
|
|
40
|
-
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "vite build && ngc -p tsconfig.lib.json",
|
|
70
|
+
"typecheck": "tsc --noEmit -p tsconfig.spec.json",
|
|
71
|
+
"test": "vitest run",
|
|
72
|
+
"lint": "eslint ."
|
|
73
|
+
}
|
|
41
74
|
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
|
|
3
|
-
import '@zitadel/components';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Angular wrapper for the `<zitadel-login>` Lit web component.
|
|
7
|
-
*
|
|
8
|
-
* Uses a distinct selector (`zitadel-auth-login`) and renders the real custom
|
|
9
|
-
* element in its template under `CUSTOM_ELEMENTS_SCHEMA`. The `project` handle
|
|
10
|
-
* (from `configureZitadel(...)`) is bound as a DOM **property** via `[project]`;
|
|
11
|
-
* `purpose` / `post-sign-in-url` are bound as attributes the Lit element reads.
|
|
12
|
-
*
|
|
13
|
-
* ```html
|
|
14
|
-
* <zitadel-auth-login [project]="project" purpose="login" postSignInUrl="/" />
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
class ZitadelLoginComponent {
|
|
18
|
-
project;
|
|
19
|
-
purpose = 'login';
|
|
20
|
-
postSignInUrl;
|
|
21
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ZitadelLoginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: ZitadelLoginComponent, isStandalone: true, selector: "zitadel-auth-login", inputs: { project: "project", purpose: "purpose", postSignInUrl: "postSignInUrl" }, ngImport: i0, template: `<zitadel-login
|
|
23
|
-
[project]="project"
|
|
24
|
-
[attr.purpose]="purpose"
|
|
25
|
-
[attr.post-sign-in-url]="postSignInUrl"
|
|
26
|
-
></zitadel-login>`, isInline: true });
|
|
27
|
-
}
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ZitadelLoginComponent, decorators: [{
|
|
29
|
-
type: Component,
|
|
30
|
-
args: [{
|
|
31
|
-
selector: 'zitadel-auth-login',
|
|
32
|
-
standalone: true,
|
|
33
|
-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
34
|
-
template: `<zitadel-login
|
|
35
|
-
[project]="project"
|
|
36
|
-
[attr.purpose]="purpose"
|
|
37
|
-
[attr.post-sign-in-url]="postSignInUrl"
|
|
38
|
-
></zitadel-login>`,
|
|
39
|
-
}]
|
|
40
|
-
}], propDecorators: { project: [{
|
|
41
|
-
type: Input
|
|
42
|
-
}], purpose: [{
|
|
43
|
-
type: Input
|
|
44
|
-
}], postSignInUrl: [{
|
|
45
|
-
type: Input
|
|
46
|
-
}] } });
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Angular wrapper for the `<zitadel-logout>` Lit web component. See
|
|
50
|
-
* {@link ZitadelLoginComponent} for the strategy.
|
|
51
|
-
*
|
|
52
|
-
* ```html
|
|
53
|
-
* <zitadel-auth-logout [project]="project" postSignOutUrl="/login" />
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
class ZitadelLogoutComponent {
|
|
57
|
-
project;
|
|
58
|
-
postSignOutUrl;
|
|
59
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ZitadelLogoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
60
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: ZitadelLogoutComponent, isStandalone: true, selector: "zitadel-auth-logout", inputs: { project: "project", postSignOutUrl: "postSignOutUrl" }, ngImport: i0, template: `<zitadel-logout
|
|
61
|
-
[project]="project"
|
|
62
|
-
[attr.post-sign-out-url]="postSignOutUrl"
|
|
63
|
-
></zitadel-logout>`, isInline: true });
|
|
64
|
-
}
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ZitadelLogoutComponent, decorators: [{
|
|
66
|
-
type: Component,
|
|
67
|
-
args: [{
|
|
68
|
-
selector: 'zitadel-auth-logout',
|
|
69
|
-
standalone: true,
|
|
70
|
-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
71
|
-
template: `<zitadel-logout
|
|
72
|
-
[project]="project"
|
|
73
|
-
[attr.post-sign-out-url]="postSignOutUrl"
|
|
74
|
-
></zitadel-logout>`,
|
|
75
|
-
}]
|
|
76
|
-
}], propDecorators: { project: [{
|
|
77
|
-
type: Input
|
|
78
|
-
}], postSignOutUrl: [{
|
|
79
|
-
type: Input
|
|
80
|
-
}] } });
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* SDK configuration for the Angular wrapper.
|
|
84
|
-
*
|
|
85
|
-
* `@zitadel/api` is published with subpath-only `exports` and no main entry,
|
|
86
|
-
* which ng-packagr's module resolution cannot follow. For the client-side SPA
|
|
87
|
-
* (prop-based) flow the widget only needs a plain handle — `{ projectId,
|
|
88
|
-
* proxyPath }` — which it reads directly. So this package builds that handle
|
|
89
|
-
* locally rather than importing `configureZitadel` from `@zitadel/api`, keeping
|
|
90
|
-
* the Angular library self-contained.
|
|
91
|
-
*/
|
|
92
|
-
/**
|
|
93
|
-
* Builds the project handle to pass to `<zitadel-auth-login [project]>`.
|
|
94
|
-
*
|
|
95
|
-
* ```ts
|
|
96
|
-
* const project = configureZitadel({ projectId: "…", proxyPath: "/__nextgen" });
|
|
97
|
-
* ```
|
|
98
|
-
*/
|
|
99
|
-
function configureZitadel(config) {
|
|
100
|
-
return Object.freeze({
|
|
101
|
-
proxyPath: config.proxyPath ?? '/__nextgen',
|
|
102
|
-
projectId: config.projectId,
|
|
103
|
-
url: config.url,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Generated bundle index. Do not edit.
|
|
109
|
-
*/
|
|
110
|
-
|
|
111
|
-
export { ZitadelLoginComponent, ZitadelLogoutComponent, configureZitadel };
|
|
112
|
-
//# sourceMappingURL=zitadel-sdk-angular.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zitadel-sdk-angular.mjs","sources":["../../src/lib/zitadel-login.component.ts","../../src/lib/zitadel-logout.component.ts","../../src/lib/config.ts","../../src/zitadel-sdk-angular.ts"],"sourcesContent":["import { Component, Input, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\n\nimport type { ZitadelProject } from './config';\n\n// Registers <zitadel-login> / <zitadel-logout> with the browser.\nimport '@zitadel/components';\n\n/**\n * Angular wrapper for the `<zitadel-login>` Lit web component.\n *\n * Uses a distinct selector (`zitadel-auth-login`) and renders the real custom\n * element in its template under `CUSTOM_ELEMENTS_SCHEMA`. The `project` handle\n * (from `configureZitadel(...)`) is bound as a DOM **property** via `[project]`;\n * `purpose` / `post-sign-in-url` are bound as attributes the Lit element reads.\n *\n * ```html\n * <zitadel-auth-login [project]=\"project\" purpose=\"login\" postSignInUrl=\"/\" />\n * ```\n */\n@Component({\n selector: 'zitadel-auth-login',\n standalone: true,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `<zitadel-login\n [project]=\"project\"\n [attr.purpose]=\"purpose\"\n [attr.post-sign-in-url]=\"postSignInUrl\"\n ></zitadel-login>`,\n})\nexport class ZitadelLoginComponent {\n @Input() project?: ZitadelProject;\n @Input() purpose = 'login';\n @Input() postSignInUrl?: string;\n}\n","import { Component, Input, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\n\nimport type { ZitadelProject } from './config';\n\nimport '@zitadel/components';\n\n/**\n * Angular wrapper for the `<zitadel-logout>` Lit web component. See\n * {@link ZitadelLoginComponent} for the strategy.\n *\n * ```html\n * <zitadel-auth-logout [project]=\"project\" postSignOutUrl=\"/login\" />\n * ```\n */\n@Component({\n selector: 'zitadel-auth-logout',\n standalone: true,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `<zitadel-logout\n [project]=\"project\"\n [attr.post-sign-out-url]=\"postSignOutUrl\"\n ></zitadel-logout>`,\n})\nexport class ZitadelLogoutComponent {\n @Input() project?: ZitadelProject;\n @Input() postSignOutUrl?: string;\n}\n","/**\n * SDK configuration for the Angular wrapper.\n *\n * `@zitadel/api` is published with subpath-only `exports` and no main entry,\n * which ng-packagr's module resolution cannot follow. For the client-side SPA\n * (prop-based) flow the widget only needs a plain handle — `{ projectId,\n * proxyPath }` — which it reads directly. So this package builds that handle\n * locally rather than importing `configureZitadel` from `@zitadel/api`, keeping\n * the Angular library self-contained.\n */\n\n/** Frozen project handle passed to the widgets via the `project` input. */\nexport interface ZitadelProject {\n readonly proxyPath: string;\n readonly projectId: string;\n readonly url?: string;\n}\n\n/** Input options for {@link configureZitadel}. */\nexport interface ZitadelConfig {\n /** Proxy path for API requests. Defaults to `\"/__nextgen\"`. */\n proxyPath?: string;\n /** Project id passed to flow creation. */\n projectId: string;\n /** Full backend URL (server-side only; optional for client SPAs). */\n url?: string;\n}\n\n/**\n * Builds the project handle to pass to `<zitadel-auth-login [project]>`.\n *\n * ```ts\n * const project = configureZitadel({ projectId: \"…\", proxyPath: \"/__nextgen\" });\n * ```\n */\nexport function configureZitadel(config: ZitadelConfig): ZitadelProject {\n return Object.freeze({\n proxyPath: config.proxyPath ?? '/__nextgen',\n projectId: config.projectId,\n url: config.url,\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAOA;;;;;;;;;;;AAWG;MAWU,qBAAqB,CAAA;AACvB,IAAA,OAAO;IACP,OAAO,GAAG,OAAO;AACjB,IAAA,aAAa;uGAHX,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,EAAA,aAAA,EAAA,eAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EANtB,CAAA;;;;AAIQ,mBAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAVjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACjC,oBAAA,QAAQ,EAAE,CAAA;;;;AAIQ,mBAAA,CAAA;AACnB,iBAAA;;sBAEE;;sBACA;;sBACA;;;AC1BH;;;;;;;AAOG;MAUU,sBAAsB,CAAA;AACxB,IAAA,OAAO;AACP,IAAA,cAAc;uGAFZ,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EALvB,CAAA;;;AAGS,oBAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAER,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBATlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACjC,oBAAA,QAAQ,EAAE,CAAA;;;AAGS,oBAAA,CAAA;AACpB,iBAAA;;sBAEE;;sBACA;;;ACzBH;;;;;;;;;AASG;AAmBH;;;;;;AAMG;AACG,SAAU,gBAAgB,CAAC,MAAqB,EAAA;IACpD,OAAO,MAAM,CAAC,MAAM,CAAC;AACnB,QAAA,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,YAAY;QAC3C,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,GAAG,EAAE,MAAM,CAAC,GAAG;AAChB,KAAA,CAAC;AACJ;;ACzCA;;AAEG;;;;"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* SDK configuration for the Angular wrapper.
|
|
5
|
-
*
|
|
6
|
-
* `@zitadel/api` is published with subpath-only `exports` and no main entry,
|
|
7
|
-
* which ng-packagr's module resolution cannot follow. For the client-side SPA
|
|
8
|
-
* (prop-based) flow the widget only needs a plain handle — `{ projectId,
|
|
9
|
-
* proxyPath }` — which it reads directly. So this package builds that handle
|
|
10
|
-
* locally rather than importing `configureZitadel` from `@zitadel/api`, keeping
|
|
11
|
-
* the Angular library self-contained.
|
|
12
|
-
*/
|
|
13
|
-
/** Frozen project handle passed to the widgets via the `project` input. */
|
|
14
|
-
interface ZitadelProject {
|
|
15
|
-
readonly proxyPath: string;
|
|
16
|
-
readonly projectId: string;
|
|
17
|
-
readonly url?: string;
|
|
18
|
-
}
|
|
19
|
-
/** Input options for {@link configureZitadel}. */
|
|
20
|
-
interface ZitadelConfig {
|
|
21
|
-
/** Proxy path for API requests. Defaults to `"/__nextgen"`. */
|
|
22
|
-
proxyPath?: string;
|
|
23
|
-
/** Project id passed to flow creation. */
|
|
24
|
-
projectId: string;
|
|
25
|
-
/** Full backend URL (server-side only; optional for client SPAs). */
|
|
26
|
-
url?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Builds the project handle to pass to `<zitadel-auth-login [project]>`.
|
|
30
|
-
*
|
|
31
|
-
* ```ts
|
|
32
|
-
* const project = configureZitadel({ projectId: "…", proxyPath: "/__nextgen" });
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
declare function configureZitadel(config: ZitadelConfig): ZitadelProject;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Angular wrapper for the `<zitadel-login>` Lit web component.
|
|
39
|
-
*
|
|
40
|
-
* Uses a distinct selector (`zitadel-auth-login`) and renders the real custom
|
|
41
|
-
* element in its template under `CUSTOM_ELEMENTS_SCHEMA`. The `project` handle
|
|
42
|
-
* (from `configureZitadel(...)`) is bound as a DOM **property** via `[project]`;
|
|
43
|
-
* `purpose` / `post-sign-in-url` are bound as attributes the Lit element reads.
|
|
44
|
-
*
|
|
45
|
-
* ```html
|
|
46
|
-
* <zitadel-auth-login [project]="project" purpose="login" postSignInUrl="/" />
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
declare class ZitadelLoginComponent {
|
|
50
|
-
project?: ZitadelProject;
|
|
51
|
-
purpose: string;
|
|
52
|
-
postSignInUrl?: string;
|
|
53
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ZitadelLoginComponent, never>;
|
|
54
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ZitadelLoginComponent, "zitadel-auth-login", never, { "project": { "alias": "project"; "required": false; }; "purpose": { "alias": "purpose"; "required": false; }; "postSignInUrl": { "alias": "postSignInUrl"; "required": false; }; }, {}, never, never, true, never>;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Angular wrapper for the `<zitadel-logout>` Lit web component. See
|
|
59
|
-
* {@link ZitadelLoginComponent} for the strategy.
|
|
60
|
-
*
|
|
61
|
-
* ```html
|
|
62
|
-
* <zitadel-auth-logout [project]="project" postSignOutUrl="/login" />
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
declare class ZitadelLogoutComponent {
|
|
66
|
-
project?: ZitadelProject;
|
|
67
|
-
postSignOutUrl?: string;
|
|
68
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ZitadelLogoutComponent, never>;
|
|
69
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ZitadelLogoutComponent, "zitadel-auth-logout", never, { "project": { "alias": "project"; "required": false; }; "postSignOutUrl": { "alias": "postSignOutUrl"; "required": false; }; }, {}, never, never, true, never>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export { ZitadelLoginComponent, ZitadelLogoutComponent, configureZitadel };
|
|
73
|
-
export type { ZitadelConfig, ZitadelProject };
|