kinde-testkit 0.4.0 → 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.
- package/CHANGELOG.md +18 -0
- package/README.md +235 -11
- package/dist/cli.js +2160 -267
- package/dist/cypress-support.d.ts +98 -0
- package/dist/cypress-support.js +119 -0
- package/dist/cypress-support.js.map +1 -0
- package/dist/cypress.cjs +4249 -0
- package/dist/cypress.cjs.map +1 -0
- package/dist/cypress.d.cts +118 -0
- package/dist/cypress.d.ts +118 -0
- package/dist/cypress.js +3324 -0
- package/dist/cypress.js.map +1 -0
- package/dist/index.cjs +3270 -314
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +326 -2
- package/dist/index.d.ts +326 -2
- package/dist/index.js +1954 -150
- package/dist/index.js.map +1 -1
- package/dist/jest.cjs +4318 -0
- package/dist/jest.cjs.map +1 -0
- package/dist/jest.d.cts +567 -0
- package/dist/jest.d.ts +567 -0
- package/dist/jest.js +3392 -0
- package/dist/jest.js.map +1 -0
- package/dist/vitest.d.ts +236 -1
- package/dist/vitest.js +1853 -155
- package/dist/vitest.js.map +1 -1
- package/package.json +36 -3
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
interface TestkitSeed {
|
|
2
|
+
issuer?: string;
|
|
3
|
+
audience?: string | string[];
|
|
4
|
+
clientId?: string;
|
|
5
|
+
users?: Array<{
|
|
6
|
+
id: string;
|
|
7
|
+
email?: string | null;
|
|
8
|
+
emailVerified?: boolean;
|
|
9
|
+
givenName?: string | null;
|
|
10
|
+
familyName?: string | null;
|
|
11
|
+
picture?: string | null;
|
|
12
|
+
claims?: Record<string, unknown>;
|
|
13
|
+
properties?: Record<string, string | number | boolean>;
|
|
14
|
+
}>;
|
|
15
|
+
organizations?: Array<{
|
|
16
|
+
code: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
}>;
|
|
20
|
+
memberships?: Array<{
|
|
21
|
+
user: string;
|
|
22
|
+
organization: string;
|
|
23
|
+
roles?: string[];
|
|
24
|
+
permissions?: string[];
|
|
25
|
+
}>;
|
|
26
|
+
webhooks?: Array<{
|
|
27
|
+
url: string;
|
|
28
|
+
events?: string[];
|
|
29
|
+
}>;
|
|
30
|
+
roles?: Array<{
|
|
31
|
+
key: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
permissions?: string[];
|
|
35
|
+
isDefault?: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
featureFlags?: Array<{
|
|
38
|
+
key: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
type?: "boolean" | "string" | "integer";
|
|
41
|
+
value: boolean | string | number;
|
|
42
|
+
organizations?: Record<string, boolean | string | number>;
|
|
43
|
+
}>;
|
|
44
|
+
plans?: Array<{
|
|
45
|
+
key: string;
|
|
46
|
+
name?: string;
|
|
47
|
+
subscribers?: string[];
|
|
48
|
+
entitlements?: Array<{
|
|
49
|
+
featureKey: string;
|
|
50
|
+
featureName?: string;
|
|
51
|
+
priceName?: string;
|
|
52
|
+
fixedCharge?: number | null;
|
|
53
|
+
unitAmount?: number | null;
|
|
54
|
+
limitMax?: number | null;
|
|
55
|
+
limitMin?: number | null;
|
|
56
|
+
}>;
|
|
57
|
+
}>;
|
|
58
|
+
permissions?: Array<{
|
|
59
|
+
key: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
}>;
|
|
63
|
+
applications?: Array<{
|
|
64
|
+
clientId: string;
|
|
65
|
+
clientSecret?: string;
|
|
66
|
+
name?: string;
|
|
67
|
+
organization?: string;
|
|
68
|
+
scopes?: string[];
|
|
69
|
+
permissions?: string[];
|
|
70
|
+
audience?: string | string[];
|
|
71
|
+
}>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface WebhookOptions {
|
|
75
|
+
retryDelaysMs?: number[];
|
|
76
|
+
timeoutMs?: number;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface StartKindeTestkitOptions {
|
|
80
|
+
port?: number;
|
|
81
|
+
host?: string;
|
|
82
|
+
issuer?: string;
|
|
83
|
+
audience?: string | string[];
|
|
84
|
+
clientId?: string;
|
|
85
|
+
/** A seed object, or the path of a JSON, YAML, JavaScript or TypeScript seed file. */
|
|
86
|
+
seed?: TestkitSeed | string;
|
|
87
|
+
allowPublic?: boolean;
|
|
88
|
+
/** Write this run's authentication coverage to a folder when the testkit closes. */
|
|
89
|
+
coverage?: boolean | {
|
|
90
|
+
directory?: string;
|
|
91
|
+
};
|
|
92
|
+
webhooks?: WebhookOptions;
|
|
93
|
+
https?: boolean | {
|
|
94
|
+
certDirectory?: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface SetupKindeTestkitOptions {
|
|
99
|
+
/**
|
|
100
|
+
* Start a testkit inside the Cypress process. Your app must use the same issuer,
|
|
101
|
+
* so keep the default port 4400 or set KINDE_ISSUER_URL to match.
|
|
102
|
+
* Leave this out to use an issuer you started yourself with `kinde-testkit start`.
|
|
103
|
+
*/
|
|
104
|
+
start?: StartKindeTestkitOptions;
|
|
105
|
+
/** The issuer to use when you started it yourself. Default: KINDE_ISSUER_URL, then http://localhost:4400. */
|
|
106
|
+
url?: string;
|
|
107
|
+
}
|
|
108
|
+
interface CypressConfig {
|
|
109
|
+
env: Record<string, unknown>;
|
|
110
|
+
}
|
|
111
|
+
type On = (event: "after:run", handler: (results: any) => void | Promise<void>) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Call from setupNodeEvents in cypress.config.ts. Starts the testkit when asked and tells the
|
|
114
|
+
* kinde-testkit Cypress commands where it is, through Cypress.env("KINDE_TESTKIT_URL").
|
|
115
|
+
*/
|
|
116
|
+
declare function setupKindeTestkit<C extends CypressConfig>(on: On, config: C, options?: SetupKindeTestkitOptions): Promise<C>;
|
|
117
|
+
|
|
118
|
+
export { type SetupKindeTestkitOptions, setupKindeTestkit };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
interface TestkitSeed {
|
|
2
|
+
issuer?: string;
|
|
3
|
+
audience?: string | string[];
|
|
4
|
+
clientId?: string;
|
|
5
|
+
users?: Array<{
|
|
6
|
+
id: string;
|
|
7
|
+
email?: string | null;
|
|
8
|
+
emailVerified?: boolean;
|
|
9
|
+
givenName?: string | null;
|
|
10
|
+
familyName?: string | null;
|
|
11
|
+
picture?: string | null;
|
|
12
|
+
claims?: Record<string, unknown>;
|
|
13
|
+
properties?: Record<string, string | number | boolean>;
|
|
14
|
+
}>;
|
|
15
|
+
organizations?: Array<{
|
|
16
|
+
code: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
}>;
|
|
20
|
+
memberships?: Array<{
|
|
21
|
+
user: string;
|
|
22
|
+
organization: string;
|
|
23
|
+
roles?: string[];
|
|
24
|
+
permissions?: string[];
|
|
25
|
+
}>;
|
|
26
|
+
webhooks?: Array<{
|
|
27
|
+
url: string;
|
|
28
|
+
events?: string[];
|
|
29
|
+
}>;
|
|
30
|
+
roles?: Array<{
|
|
31
|
+
key: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
permissions?: string[];
|
|
35
|
+
isDefault?: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
featureFlags?: Array<{
|
|
38
|
+
key: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
type?: "boolean" | "string" | "integer";
|
|
41
|
+
value: boolean | string | number;
|
|
42
|
+
organizations?: Record<string, boolean | string | number>;
|
|
43
|
+
}>;
|
|
44
|
+
plans?: Array<{
|
|
45
|
+
key: string;
|
|
46
|
+
name?: string;
|
|
47
|
+
subscribers?: string[];
|
|
48
|
+
entitlements?: Array<{
|
|
49
|
+
featureKey: string;
|
|
50
|
+
featureName?: string;
|
|
51
|
+
priceName?: string;
|
|
52
|
+
fixedCharge?: number | null;
|
|
53
|
+
unitAmount?: number | null;
|
|
54
|
+
limitMax?: number | null;
|
|
55
|
+
limitMin?: number | null;
|
|
56
|
+
}>;
|
|
57
|
+
}>;
|
|
58
|
+
permissions?: Array<{
|
|
59
|
+
key: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
}>;
|
|
63
|
+
applications?: Array<{
|
|
64
|
+
clientId: string;
|
|
65
|
+
clientSecret?: string;
|
|
66
|
+
name?: string;
|
|
67
|
+
organization?: string;
|
|
68
|
+
scopes?: string[];
|
|
69
|
+
permissions?: string[];
|
|
70
|
+
audience?: string | string[];
|
|
71
|
+
}>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface WebhookOptions {
|
|
75
|
+
retryDelaysMs?: number[];
|
|
76
|
+
timeoutMs?: number;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface StartKindeTestkitOptions {
|
|
80
|
+
port?: number;
|
|
81
|
+
host?: string;
|
|
82
|
+
issuer?: string;
|
|
83
|
+
audience?: string | string[];
|
|
84
|
+
clientId?: string;
|
|
85
|
+
/** A seed object, or the path of a JSON, YAML, JavaScript or TypeScript seed file. */
|
|
86
|
+
seed?: TestkitSeed | string;
|
|
87
|
+
allowPublic?: boolean;
|
|
88
|
+
/** Write this run's authentication coverage to a folder when the testkit closes. */
|
|
89
|
+
coverage?: boolean | {
|
|
90
|
+
directory?: string;
|
|
91
|
+
};
|
|
92
|
+
webhooks?: WebhookOptions;
|
|
93
|
+
https?: boolean | {
|
|
94
|
+
certDirectory?: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface SetupKindeTestkitOptions {
|
|
99
|
+
/**
|
|
100
|
+
* Start a testkit inside the Cypress process. Your app must use the same issuer,
|
|
101
|
+
* so keep the default port 4400 or set KINDE_ISSUER_URL to match.
|
|
102
|
+
* Leave this out to use an issuer you started yourself with `kinde-testkit start`.
|
|
103
|
+
*/
|
|
104
|
+
start?: StartKindeTestkitOptions;
|
|
105
|
+
/** The issuer to use when you started it yourself. Default: KINDE_ISSUER_URL, then http://localhost:4400. */
|
|
106
|
+
url?: string;
|
|
107
|
+
}
|
|
108
|
+
interface CypressConfig {
|
|
109
|
+
env: Record<string, unknown>;
|
|
110
|
+
}
|
|
111
|
+
type On = (event: "after:run", handler: (results: any) => void | Promise<void>) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Call from setupNodeEvents in cypress.config.ts. Starts the testkit when asked and tells the
|
|
114
|
+
* kinde-testkit Cypress commands where it is, through Cypress.env("KINDE_TESTKIT_URL").
|
|
115
|
+
*/
|
|
116
|
+
declare function setupKindeTestkit<C extends CypressConfig>(on: On, config: C, options?: SetupKindeTestkitOptions): Promise<C>;
|
|
117
|
+
|
|
118
|
+
export { type SetupKindeTestkitOptions, setupKindeTestkit };
|