@zitadel/sdk-angular 0.1.0-alpha.0 → 0.1.0-alpha.11

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 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
package/dist/index.js ADDED
@@ -0,0 +1,140 @@
1
+ import * as t from "@angular/core";
2
+ import { EventEmitter as l, ViewChild as u, Output as n, Input as o, CUSTOM_ELEMENTS_SCHEMA as c, Component as d } from "@angular/core";
3
+ import "@zitadel/components";
4
+ const r = class r {
5
+ constructor() {
6
+ this.purpose = "login", this.flowStep = new l(), this.flowInput = new l(), this.flowComplete = new l(), this.flowError = new l();
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(e) {
13
+ this.flowStep.emit(e.detail);
14
+ }
15
+ onFlowInput(e) {
16
+ this.flowInput.emit(e.detail);
17
+ }
18
+ onFlowComplete(e) {
19
+ this.flowComplete.emit(e.detail);
20
+ }
21
+ onFlowError(e) {
22
+ this.flowError.emit(e.detail);
23
+ }
24
+ };
25
+ r.ɵfac = t.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: t, type: r, deps: [], target: t.ɵɵFactoryTarget.Component }), r.ɵcmp = t.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: r, isStandalone: !0, selector: "zitadel-auth-login", inputs: { project: "project", projectId: "projectId", proxyPath: "proxyPath", purpose: "purpose", postSignInUrl: "postSignInUrl" }, 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
+ [attr.purpose]="purpose"
31
+ [attr.post-sign-in-url]="postSignInUrl"
32
+ (zitadel-flow-step)="onFlowStep($event)"
33
+ (zitadel-flow-input)="onFlowInput($event)"
34
+ (zitadel-flow-complete)="onFlowComplete($event)"
35
+ (zitadel-flow-error)="onFlowError($event)"
36
+ ></zitadel-login>`, isInline: !0 });
37
+ let s = r;
38
+ t.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: t, type: s, decorators: [{
39
+ type: d,
40
+ args: [{
41
+ selector: "zitadel-auth-login",
42
+ standalone: !0,
43
+ schemas: [c],
44
+ template: `<zitadel-login
45
+ #el
46
+ [project]="project"
47
+ [projectId]="projectId"
48
+ [proxyPath]="proxyPath"
49
+ [attr.purpose]="purpose"
50
+ [attr.post-sign-in-url]="postSignInUrl"
51
+ (zitadel-flow-step)="onFlowStep($event)"
52
+ (zitadel-flow-input)="onFlowInput($event)"
53
+ (zitadel-flow-complete)="onFlowComplete($event)"
54
+ (zitadel-flow-error)="onFlowError($event)"
55
+ ></zitadel-login>`
56
+ }]
57
+ }], propDecorators: { project: [{
58
+ type: o
59
+ }], projectId: [{
60
+ type: o
61
+ }], proxyPath: [{
62
+ type: o
63
+ }], purpose: [{
64
+ type: o
65
+ }], postSignInUrl: [{
66
+ type: o
67
+ }], flowStep: [{
68
+ type: n
69
+ }], flowInput: [{
70
+ type: n
71
+ }], flowComplete: [{
72
+ type: n
73
+ }], flowError: [{
74
+ type: n
75
+ }], elementRef: [{
76
+ type: u,
77
+ args: ["el"]
78
+ }] } });
79
+ const p = class p {
80
+ constructor() {
81
+ this.signout = new l();
82
+ }
83
+ /** The underlying `<zitadel-logout>` custom element, or `null` before view init. */
84
+ get element() {
85
+ return this.elementRef?.nativeElement ?? null;
86
+ }
87
+ onSignout(e) {
88
+ this.signout.emit(e.detail);
89
+ }
90
+ };
91
+ p.ɵfac = t.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: t, type: p, deps: [], target: t.ɵɵFactoryTarget.Component }), p.ɵcmp = t.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: p, isStandalone: !0, selector: "zitadel-auth-logout", inputs: { project: "project", projectId: "projectId", proxyPath: "proxyPath", postSignOutUrl: "postSignOutUrl" }, outputs: { signout: "signout" }, viewQueries: [{ propertyName: "elementRef", first: !0, predicate: ["el"], descendants: !0 }], ngImport: t, template: `<zitadel-logout
92
+ #el
93
+ [project]="project"
94
+ [projectId]="projectId"
95
+ [proxyPath]="proxyPath"
96
+ [attr.post-sign-out-url]="postSignOutUrl"
97
+ (zitadel-signout)="onSignout($event)"
98
+ ></zitadel-logout>`, isInline: !0 });
99
+ let a = p;
100
+ t.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: t, type: a, decorators: [{
101
+ type: d,
102
+ args: [{
103
+ selector: "zitadel-auth-logout",
104
+ standalone: !0,
105
+ schemas: [c],
106
+ template: `<zitadel-logout
107
+ #el
108
+ [project]="project"
109
+ [projectId]="projectId"
110
+ [proxyPath]="proxyPath"
111
+ [attr.post-sign-out-url]="postSignOutUrl"
112
+ (zitadel-signout)="onSignout($event)"
113
+ ></zitadel-logout>`
114
+ }]
115
+ }], propDecorators: { project: [{
116
+ type: o
117
+ }], projectId: [{
118
+ type: o
119
+ }], proxyPath: [{
120
+ type: o
121
+ }], postSignOutUrl: [{
122
+ type: o
123
+ }], signout: [{
124
+ type: n
125
+ }], elementRef: [{
126
+ type: u,
127
+ args: ["el"]
128
+ }] } });
129
+ function w(i) {
130
+ return Object.freeze({
131
+ proxyPath: i.proxyPath ?? "/__nextgen",
132
+ projectId: i.projectId,
133
+ url: i.url
134
+ });
135
+ }
136
+ export {
137
+ s as ZitadelLoginComponent,
138
+ a as ZitadelLogoutComponent,
139
+ w as configureZitadel
140
+ };
@@ -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,48 @@
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
+ postSignInUrl?: string;
34
+ flowStep: EventEmitter<ZitadelFlowStepDetail>;
35
+ flowInput: EventEmitter<ZitadelFlowInputDetail>;
36
+ flowComplete: EventEmitter<ZitadelFlowCompleteDetail>;
37
+ flowError: EventEmitter<ZitadelFlowErrorDetail>;
38
+ private elementRef?;
39
+ /** The underlying `<zitadel-login>` custom element, or `null` before view init. */
40
+ get element(): ZitadelLoginElement | null;
41
+ onFlowStep(event: Event): void;
42
+ onFlowInput(event: Event): void;
43
+ onFlowComplete(event: Event): void;
44
+ onFlowError(event: Event): void;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<ZitadelLoginComponent, never>;
46
+ 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; }; "postSignInUrl": { "alias": "postSignInUrl"; "required": false; }; }, { "flowStep": "flowStep"; "flowInput": "flowInput"; "flowComplete": "flowComplete"; "flowError": "flowError"; }, never, never, true, never>;
47
+ }
48
+ //# 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,qBAiBa,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,aAAa,CAAC,EAAE,MAAM,CAAC;IACtB,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;yCA9BpB,qBAAqB;2CAArB,qBAAqB;CAiCjC"}
@@ -0,0 +1,32 @@
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
+ signout: EventEmitter<ZitadelSignoutDetail>;
25
+ private elementRef?;
26
+ /** The underlying `<zitadel-logout>` custom element, or `null` before view init. */
27
+ get element(): ZitadelLogoutElement | null;
28
+ onSignout(event: Event): void;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<ZitadelLogoutComponent, never>;
30
+ 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; }; }, { "signout": "signout"; }, never, never, true, never>;
31
+ }
32
+ //# 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,qBAaa,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;IACvB,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;yCAdlB,sBAAsB;2CAAtB,sBAAsB;CAiBlC"}
@@ -0,0 +1,6 @@
1
+ export { ZitadelLoginComponent } from "./lib/zitadel-login.component";
2
+ export { ZitadelLogoutComponent } from "./lib/zitadel-logout.component";
3
+ export { configureZitadel } from "./lib/config";
4
+ export type { ZitadelConfig, ZitadelProject } from "./lib/config";
5
+ export type * from "@zitadel/sdk-core/types";
6
+ //# 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,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGlE,mBAAmB,yBAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=test-setup.d.ts.map
@@ -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,73 @@
1
1
  {
2
2
  "name": "@zitadel/sdk-angular",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.11",
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": "0.1.0-alpha.0",
22
- "@zitadel/components": "0.1.0-alpha.0"
32
+ "@zitadel/api": "0.1.0-alpha.11",
33
+ "@zitadel/components": "0.1.0-alpha.11",
34
+ "@zitadel/sdk-core": "0.1.0-alpha.11"
23
35
  },
24
36
  "peerDependencies": {
25
37
  "@angular/common": ">=17",
26
38
  "@angular/core": ">=17"
27
39
  },
28
- "module": "fesm2022/zitadel-sdk-angular.mjs",
29
- "typings": "types/zitadel-sdk-angular.d.ts",
30
- "exports": {
31
- "./package.json": {
32
- "default": "./package.json"
33
- },
34
- ".": {
35
- "types": "./types/zitadel-sdk-angular.d.ts",
36
- "default": "./fesm2022/zitadel-sdk-angular.mjs"
37
- }
40
+ "devDependencies": {
41
+ "@analogjs/vite-plugin-angular": "^2.6.1",
42
+ "@analogjs/vitest-angular": "^2.6.1",
43
+ "@angular/build": "^22.0.0",
44
+ "@angular/common": "^22.0.0",
45
+ "@angular/compiler": "^22.0.0",
46
+ "@angular/compiler-cli": "^22.0.0",
47
+ "@angular/core": "^22.0.0",
48
+ "@angular/platform-browser": "^22.0.1",
49
+ "@eslint/js": "^9.0.0",
50
+ "@eslint/json": "^0.11.0",
51
+ "@eslint/markdown": "^6.0.0",
52
+ "@testing-library/angular": "^19.4.1",
53
+ "eslint": "^9.0.0",
54
+ "eslint-config-prettier": "^10.0.0",
55
+ "eslint-import-resolver-typescript": "^3.7.0",
56
+ "eslint-plugin-import": "^2.31.0",
57
+ "eslint-plugin-perfectionist": "^4.0.0",
58
+ "eslint-plugin-prettier": "^5.0.0",
59
+ "jsdom": "^29.0.2",
60
+ "prettier": "^3.0.0",
61
+ "typescript": "^6.0.3",
62
+ "typescript-eslint": "^8.0.0",
63
+ "vite": "^7.3.5",
64
+ "vitest": "^3.0.0",
65
+ "zone.js": "~0.16.0"
38
66
  },
39
- "sideEffects": false,
40
- "type": "module"
67
+ "scripts": {
68
+ "build": "vite build && ngc -p tsconfig.lib.json",
69
+ "typecheck": "tsc --noEmit -p tsconfig.spec.json",
70
+ "test": "vitest run",
71
+ "lint": "eslint ."
72
+ }
41
73
  }
@@ -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 };