@ogcio/analytics-sdk 0.0.1-beta.2 → 0.0.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/base-client.d.ts +2 -7
- package/dist/base/base-client.d.ts.map +1 -1
- package/dist/base/base-client.js +3 -15
- package/dist/base/base-client.js.map +1 -0
- package/{types.d.ts → dist/browser-types.d.ts} +1 -1
- package/dist/index.d.ts +403 -1139
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +319 -254
- package/dist/index.js.map +1 -0
- package/dist/matomo/helpers.d.ts +8 -1
- package/dist/matomo/helpers.d.ts.map +1 -1
- package/dist/matomo/helpers.js +2 -1
- package/dist/matomo/helpers.js.map +1 -0
- package/dist/matomo/types.d.ts +2 -1
- package/dist/matomo/types.d.ts.map +1 -1
- package/dist/matomo/types.js +1 -0
- package/dist/matomo/types.js.map +1 -0
- package/dist/schema.d.ts +84 -444
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +1 -0
- package/dist/schema.js.map +1 -0
- package/dist/support-files/auth/index.js +1 -0
- package/dist/support-files/auth/index.js.map +1 -0
- package/dist/support-files/auth/types.d.ts +1 -1
- package/dist/support-files/auth/types.d.ts.map +1 -1
- package/dist/support-files/auth/types.js +1 -0
- package/dist/support-files/auth/types.js.map +1 -0
- package/dist/support-files/building-blocks-sdk.d.ts +1 -1
- package/dist/support-files/building-blocks-sdk.d.ts.map +1 -1
- package/dist/support-files/building-blocks-sdk.js +1 -0
- package/dist/support-files/building-blocks-sdk.js.map +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +22 -11
- package/examples/environment.d.ts +0 -11
- package/examples/index.ts +0 -201
- package/examples/tsconfig.json +0 -15
- package/src/base/base-client.ts +0 -172
- package/src/index.test.ts +0 -92
- package/src/index.ts +0 -543
- package/src/matomo/helpers.ts +0 -115
- package/src/matomo/types.ts +0 -64
- package/src/schema.ts +0 -1491
- package/src/support-files/auth/index.ts +0 -116
- package/src/support-files/auth/types.ts +0 -38
- package/src/support-files/building-blocks-sdk.ts +0 -32
- package/src/utils/index.test.ts +0 -46
- package/src/utils/index.ts +0 -20
- package/test-report.xml +0 -181
- package/tsconfig.json +0 -18
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { SERVICE_NAME } from "../../base/base-client.js";
|
|
2
|
-
import type {
|
|
3
|
-
GetAccessTokenParams,
|
|
4
|
-
GetOrganizationTokenParams,
|
|
5
|
-
M2MTokenFnConfig,
|
|
6
|
-
TokenFunction,
|
|
7
|
-
TokenResponseBody,
|
|
8
|
-
} from "./types.js";
|
|
9
|
-
|
|
10
|
-
const fetchToken = async (params: {
|
|
11
|
-
logtoOidcEndpoint: string;
|
|
12
|
-
applicationId: string;
|
|
13
|
-
applicationSecret: string;
|
|
14
|
-
scopes: string[];
|
|
15
|
-
specificBodyFields: { [x: string]: string };
|
|
16
|
-
}) => {
|
|
17
|
-
const body = {
|
|
18
|
-
...params.specificBodyFields,
|
|
19
|
-
scope: params.scopes.join(" "),
|
|
20
|
-
grant_type: "client_credentials",
|
|
21
|
-
};
|
|
22
|
-
const logtoOidcEndpoint = params.logtoOidcEndpoint.endsWith("/")
|
|
23
|
-
? params.logtoOidcEndpoint
|
|
24
|
-
: `${params.logtoOidcEndpoint}/`;
|
|
25
|
-
const Authorization = `Basic ${Buffer.from(
|
|
26
|
-
`${params.applicationId}:${params.applicationSecret}`,
|
|
27
|
-
).toString("base64")}`;
|
|
28
|
-
|
|
29
|
-
const response = await fetch(`${logtoOidcEndpoint}token`, {
|
|
30
|
-
method: "POST",
|
|
31
|
-
headers: {
|
|
32
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
33
|
-
Authorization,
|
|
34
|
-
},
|
|
35
|
-
body: new URLSearchParams(body).toString(),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
if (response.status !== 200) {
|
|
39
|
-
throw new Error("Unauthorized");
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return response.json() as Promise<TokenResponseBody>;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const getAccessToken = async (
|
|
46
|
-
params: GetAccessTokenParams,
|
|
47
|
-
scopes: string[],
|
|
48
|
-
) => {
|
|
49
|
-
const scopesToUse = params.scopes || scopes;
|
|
50
|
-
|
|
51
|
-
const tokenResponse = await fetchToken({
|
|
52
|
-
...params,
|
|
53
|
-
scopes: scopesToUse,
|
|
54
|
-
specificBodyFields: { resource: params.resource },
|
|
55
|
-
});
|
|
56
|
-
return tokenResponse.access_token;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const getOrganizationToken = async (
|
|
60
|
-
params: GetOrganizationTokenParams,
|
|
61
|
-
scopes: string[],
|
|
62
|
-
) => {
|
|
63
|
-
const logtoUserScopes = await importUserScopes();
|
|
64
|
-
|
|
65
|
-
const { UserScope } = logtoUserScopes;
|
|
66
|
-
|
|
67
|
-
const scopesToUse = params.scopes || scopes;
|
|
68
|
-
|
|
69
|
-
const tokenResponse = await fetchToken({
|
|
70
|
-
...params,
|
|
71
|
-
scopes: [
|
|
72
|
-
UserScope.OrganizationRoles,
|
|
73
|
-
UserScope.Organizations,
|
|
74
|
-
...scopesToUse,
|
|
75
|
-
],
|
|
76
|
-
specificBodyFields: {
|
|
77
|
-
organization_id: params.organizationId,
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
return tokenResponse.access_token;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const importUserScopes = async () => {
|
|
84
|
-
try {
|
|
85
|
-
const { UserScope } = await import("@logto/node");
|
|
86
|
-
|
|
87
|
-
return { UserScope };
|
|
88
|
-
} catch {
|
|
89
|
-
throw new Error("@logto/node package is not installed!");
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export const getM2MTokenFn = (
|
|
94
|
-
m2mTokenConfig: M2MTokenFnConfig,
|
|
95
|
-
): TokenFunction => {
|
|
96
|
-
const { services } = m2mTokenConfig;
|
|
97
|
-
|
|
98
|
-
const tokenFn = (serviceName: SERVICE_NAME) => {
|
|
99
|
-
const serviceParams = services[serviceName];
|
|
100
|
-
|
|
101
|
-
if (!serviceParams) {
|
|
102
|
-
throw new Error(`Missing m2m config for ${serviceName}`);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const { getAccessTokenParams, getOrganizationTokenParams } = serviceParams;
|
|
106
|
-
if (getAccessTokenParams) {
|
|
107
|
-
return getAccessToken(getAccessTokenParams, []);
|
|
108
|
-
}
|
|
109
|
-
if (getOrganizationTokenParams) {
|
|
110
|
-
return getOrganizationToken(getOrganizationTokenParams, []);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
throw new Error(`wrong m2m config for ${serviceName}`);
|
|
114
|
-
};
|
|
115
|
-
return tokenFn;
|
|
116
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { SERVICE_NAME } from "../../base/base-client.js";
|
|
2
|
-
|
|
3
|
-
export type TokenFunction = (
|
|
4
|
-
serviceName: SERVICE_NAME,
|
|
5
|
-
) => Promise<string> | string;
|
|
6
|
-
|
|
7
|
-
export type M2MParams = {
|
|
8
|
-
getOrganizationTokenParams?: GetOrganizationTokenParams;
|
|
9
|
-
getAccessTokenParams?: GetAccessTokenParams;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type M2MTokenFnConfig = {
|
|
13
|
-
services: {
|
|
14
|
-
[key in SERVICE_NAME]?: M2MParams;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export interface TokenResponseBody {
|
|
19
|
-
access_token: string;
|
|
20
|
-
expires_in: number;
|
|
21
|
-
token_type: string;
|
|
22
|
-
scope: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface GetTokenBaseParams {
|
|
26
|
-
logtoOidcEndpoint: string;
|
|
27
|
-
applicationId: string;
|
|
28
|
-
applicationSecret: string;
|
|
29
|
-
scopes?: string[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface GetAccessTokenParams extends GetTokenBaseParams {
|
|
33
|
-
resource: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface GetOrganizationTokenParams extends GetTokenBaseParams {
|
|
37
|
-
organizationId: string;
|
|
38
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Analytics } from "../index.js";
|
|
2
|
-
import { SERVICE_NAME } from "../base/base-client.js";
|
|
3
|
-
|
|
4
|
-
type ServiceClients = {
|
|
5
|
-
analytics: typeof Analytics;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type TokenFunction = (
|
|
9
|
-
serviceName: SERVICE_NAME,
|
|
10
|
-
) => Promise<string> | string;
|
|
11
|
-
|
|
12
|
-
export type BuildingBlockSDKParams = {
|
|
13
|
-
services: {
|
|
14
|
-
[key in keyof ServiceClients]?: ConstructorParameters<
|
|
15
|
-
ServiceClients[key]
|
|
16
|
-
>[0];
|
|
17
|
-
};
|
|
18
|
-
getTokenFn?: TokenFunction;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const getBuildingBlockSDK = (params: BuildingBlockSDKParams) => {
|
|
22
|
-
const { services, getTokenFn } = params;
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
analytics: new Analytics({
|
|
26
|
-
...services.analytics,
|
|
27
|
-
getTokenFn,
|
|
28
|
-
}),
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default getBuildingBlockSDK;
|
package/src/utils/index.test.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import t from "tap";
|
|
2
|
-
import { ensureTrailingSlash } from "./index.js";
|
|
3
|
-
|
|
4
|
-
t.test("ensureTrailingSlash", (t) => {
|
|
5
|
-
t.test("should add a trailing slash if not present", (t) => {
|
|
6
|
-
const input = "https://example.com";
|
|
7
|
-
const expected = "https://example.com/";
|
|
8
|
-
|
|
9
|
-
const result = ensureTrailingSlash(input);
|
|
10
|
-
|
|
11
|
-
t.equal(result, expected, "Adds trailing slash");
|
|
12
|
-
t.end();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
t.test("should not add a trailing slash if already present", (t) => {
|
|
16
|
-
const input = "https://example.com/";
|
|
17
|
-
const expected = "https://example.com/";
|
|
18
|
-
|
|
19
|
-
const result = ensureTrailingSlash(input);
|
|
20
|
-
|
|
21
|
-
t.equal(result, expected, "Keeps existing trailing slash");
|
|
22
|
-
t.end();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
t.test("should handle empty string", (t) => {
|
|
26
|
-
const input = "";
|
|
27
|
-
const expected = "/";
|
|
28
|
-
|
|
29
|
-
const result = ensureTrailingSlash(input);
|
|
30
|
-
|
|
31
|
-
t.equal(result, expected, "Adds trailing slash to empty string");
|
|
32
|
-
t.end();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
t.test("should not add a trailing slash if already present", (t) => {
|
|
36
|
-
const input = "https://example.com/";
|
|
37
|
-
const expected = "https://example.com/";
|
|
38
|
-
|
|
39
|
-
const result = ensureTrailingSlash(input);
|
|
40
|
-
|
|
41
|
-
t.equal(result, expected, "Keeps existing trailing slash");
|
|
42
|
-
t.end();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
t.end();
|
|
46
|
-
});
|
package/src/utils/index.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export function ensureTrailingSlash(url: string) {
|
|
2
|
-
return url.endsWith("/") ? url : `${url}/`;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Get an environment variable using process.env, if in browser, return undefined
|
|
7
|
-
*/
|
|
8
|
-
export const getEnvVariable = (key: string): string | undefined => {
|
|
9
|
-
if (typeof process !== "undefined" && process.env) {
|
|
10
|
-
// Node.js environment
|
|
11
|
-
return process.env[key];
|
|
12
|
-
} else {
|
|
13
|
-
// Browser environment
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function isBrowser(): boolean {
|
|
19
|
-
return typeof window !== "undefined" && window.document !== undefined;
|
|
20
|
-
}
|
package/test-report.xml
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
-
<testsuites id="20241030_131304618" name="TAP Tests" tests="35" failures="0" assertions="23" skipped="0" time="1.039021">
|
|
3
|
-
<properties>
|
|
4
|
-
<property name="ok" value="true" />
|
|
5
|
-
<property name="plan"><![CDATA[
|
|
6
|
-
start: 1
|
|
7
|
-
end: 2
|
|
8
|
-
skipAll: false
|
|
9
|
-
skipReason: ""
|
|
10
|
-
comment: ""
|
|
11
|
-
]]></property>
|
|
12
|
-
</properties>
|
|
13
|
-
<testsuite name="src/index.test.ts" tests="19" failures="0" assertions="14" skipped="0" time="0.948131">
|
|
14
|
-
<properties>
|
|
15
|
-
<property name="ok" value="true" />
|
|
16
|
-
<property name="plan"><![CDATA[
|
|
17
|
-
start: 1
|
|
18
|
-
end: 1
|
|
19
|
-
skipAll: false
|
|
20
|
-
skipReason: ""
|
|
21
|
-
comment: ""
|
|
22
|
-
]]></property>
|
|
23
|
-
</properties>
|
|
24
|
-
<testsuite name="Analytics - Dry Run and Opt Out" tests="17" failures="0" assertions="13" skipped="0" time="0.026081">
|
|
25
|
-
<properties>
|
|
26
|
-
<property name="ok" value="true" />
|
|
27
|
-
<property name="plan"><![CDATA[
|
|
28
|
-
start: 1
|
|
29
|
-
end: 3
|
|
30
|
-
skipAll: false
|
|
31
|
-
skipReason: ""
|
|
32
|
-
comment: ""
|
|
33
|
-
]]></property>
|
|
34
|
-
</properties>
|
|
35
|
-
<testsuite name="Analytics Config" tests="5" failures="0" assertions="4" skipped="0" time="0.009041">
|
|
36
|
-
<properties>
|
|
37
|
-
<property name="ok" value="true" />
|
|
38
|
-
<property name="plan"><![CDATA[
|
|
39
|
-
start: 1
|
|
40
|
-
end: 4
|
|
41
|
-
skipAll: false
|
|
42
|
-
skipReason: ""
|
|
43
|
-
comment: ""
|
|
44
|
-
]]></property>
|
|
45
|
-
</properties>
|
|
46
|
-
|
|
47
|
-
<testcase id="1" name="Dry run should be set to true" classname="src/index.test.ts > Analytics - Dry Run and Opt Out > Analytics Config" />
|
|
48
|
-
<testcase id="2" name="Opt out should be set to false" classname="src/index.test.ts > Analytics - Dry Run and Opt Out > Analytics Config" />
|
|
49
|
-
<testcase id="3" name="Dry run should be set to false" classname="src/index.test.ts > Analytics - Dry Run and Opt Out > Analytics Config" />
|
|
50
|
-
<testcase id="4" name="Opt out should be set to true" classname="src/index.test.ts > Analytics - Dry Run and Opt Out > Analytics Config" />
|
|
51
|
-
</testsuite>
|
|
52
|
-
|
|
53
|
-
<testsuite name="Dry Run" tests="4" failures="0" assertions="3" skipped="0" time="0.013317">
|
|
54
|
-
<properties>
|
|
55
|
-
<property name="ok" value="true" />
|
|
56
|
-
<property name="plan"><![CDATA[
|
|
57
|
-
start: 1
|
|
58
|
-
end: 3
|
|
59
|
-
skipAll: false
|
|
60
|
-
skipReason: ""
|
|
61
|
-
comment: ""
|
|
62
|
-
]]></property>
|
|
63
|
-
</properties>
|
|
64
|
-
|
|
65
|
-
<testcase id="1" name="No data should be returned in dry run mode" classname="src/index.test.ts > Analytics - Dry Run and Opt Out > Dry Run" />
|
|
66
|
-
<testcase id="2" name="No error should be returned in dry run mode" classname="src/index.test.ts > Analytics - Dry Run and Opt Out > Dry Run" />
|
|
67
|
-
<testcase id="3" name="Console warning should be logged" classname="src/index.test.ts > Analytics - Dry Run and Opt Out > Dry Run" />
|
|
68
|
-
</testsuite>
|
|
69
|
-
|
|
70
|
-
<testsuite name="Opt Out" tests="4" failures="0" assertions="3" skipped="0" time="0.001899">
|
|
71
|
-
<properties>
|
|
72
|
-
<property name="ok" value="true" />
|
|
73
|
-
<property name="plan"><![CDATA[
|
|
74
|
-
start: 1
|
|
75
|
-
end: 3
|
|
76
|
-
skipAll: false
|
|
77
|
-
skipReason: ""
|
|
78
|
-
comment: ""
|
|
79
|
-
]]></property>
|
|
80
|
-
</properties>
|
|
81
|
-
|
|
82
|
-
<testcase id="1" name="No data should be returned when opted out" classname="src/index.test.ts > Analytics - Dry Run and Opt Out > Opt Out" />
|
|
83
|
-
<testcase id="2" name="No error should be returned when opted out" classname="src/index.test.ts > Analytics - Dry Run and Opt Out > Opt Out" />
|
|
84
|
-
<testcase id="3" name="Console warning should be logged" classname="src/index.test.ts > Analytics - Dry Run and Opt Out > Opt Out" />
|
|
85
|
-
</testsuite>
|
|
86
|
-
<testcase id="1" name="Analytics Config" classname="src/index.test.ts > Analytics - Dry Run and Opt Out" time="0.009041" />
|
|
87
|
-
<testcase id="2" name="Dry Run" classname="src/index.test.ts > Analytics - Dry Run and Opt Out" time="0.013317" />
|
|
88
|
-
<testcase id="3" name="Opt Out" classname="src/index.test.ts > Analytics - Dry Run and Opt Out" time="0.001899" />
|
|
89
|
-
</testsuite>
|
|
90
|
-
<testcase id="1" name="Analytics - Dry Run and Opt Out" classname="src/index.test.ts" time="0.026081" />
|
|
91
|
-
</testsuite>
|
|
92
|
-
|
|
93
|
-
<testsuite name="src/utils/index.test.ts" tests="15" failures="0" assertions="9" skipped="0" time="0.597372">
|
|
94
|
-
<properties>
|
|
95
|
-
<property name="ok" value="true" />
|
|
96
|
-
<property name="plan"><![CDATA[
|
|
97
|
-
start: 1
|
|
98
|
-
end: 1
|
|
99
|
-
skipAll: false
|
|
100
|
-
skipReason: ""
|
|
101
|
-
comment: ""
|
|
102
|
-
]]></property>
|
|
103
|
-
</properties>
|
|
104
|
-
<testsuite name="ensureTrailingSlash" tests="13" failures="0" assertions="8" skipped="0" time="0.004302">
|
|
105
|
-
<properties>
|
|
106
|
-
<property name="ok" value="true" />
|
|
107
|
-
<property name="plan"><![CDATA[
|
|
108
|
-
start: 1
|
|
109
|
-
end: 4
|
|
110
|
-
skipAll: false
|
|
111
|
-
skipReason: ""
|
|
112
|
-
comment: ""
|
|
113
|
-
]]></property>
|
|
114
|
-
</properties>
|
|
115
|
-
<testsuite name="should add a trailing slash if not present" tests="2" failures="0" assertions="1" skipped="0" time="0.001184">
|
|
116
|
-
<properties>
|
|
117
|
-
<property name="ok" value="true" />
|
|
118
|
-
<property name="plan"><![CDATA[
|
|
119
|
-
start: 1
|
|
120
|
-
end: 1
|
|
121
|
-
skipAll: false
|
|
122
|
-
skipReason: ""
|
|
123
|
-
comment: ""
|
|
124
|
-
]]></property>
|
|
125
|
-
</properties>
|
|
126
|
-
|
|
127
|
-
<testcase id="1" name="Adds trailing slash" classname="src/utils/index.test.ts > ensureTrailingSlash > should add a trailing slash if not present" />
|
|
128
|
-
</testsuite>
|
|
129
|
-
|
|
130
|
-
<testsuite name="should not add a trailing slash if already present" tests="2" failures="0" assertions="1" skipped="0" time="0.000165">
|
|
131
|
-
<properties>
|
|
132
|
-
<property name="ok" value="true" />
|
|
133
|
-
<property name="plan"><![CDATA[
|
|
134
|
-
start: 1
|
|
135
|
-
end: 1
|
|
136
|
-
skipAll: false
|
|
137
|
-
skipReason: ""
|
|
138
|
-
comment: ""
|
|
139
|
-
]]></property>
|
|
140
|
-
</properties>
|
|
141
|
-
|
|
142
|
-
<testcase id="1" name="Keeps existing trailing slash" classname="src/utils/index.test.ts > ensureTrailingSlash > should not add a trailing slash if already present" />
|
|
143
|
-
</testsuite>
|
|
144
|
-
|
|
145
|
-
<testsuite name="should handle empty string" tests="2" failures="0" assertions="1" skipped="0" time="0.000154">
|
|
146
|
-
<properties>
|
|
147
|
-
<property name="ok" value="true" />
|
|
148
|
-
<property name="plan"><![CDATA[
|
|
149
|
-
start: 1
|
|
150
|
-
end: 1
|
|
151
|
-
skipAll: false
|
|
152
|
-
skipReason: ""
|
|
153
|
-
comment: ""
|
|
154
|
-
]]></property>
|
|
155
|
-
</properties>
|
|
156
|
-
|
|
157
|
-
<testcase id="1" name="Adds trailing slash to empty string" classname="src/utils/index.test.ts > ensureTrailingSlash > should handle empty string" />
|
|
158
|
-
</testsuite>
|
|
159
|
-
|
|
160
|
-
<testsuite name="should not add a trailing slash if already present" tests="2" failures="0" assertions="1" skipped="0" time="0.000143">
|
|
161
|
-
<properties>
|
|
162
|
-
<property name="ok" value="true" />
|
|
163
|
-
<property name="plan"><![CDATA[
|
|
164
|
-
start: 1
|
|
165
|
-
end: 1
|
|
166
|
-
skipAll: false
|
|
167
|
-
skipReason: ""
|
|
168
|
-
comment: ""
|
|
169
|
-
]]></property>
|
|
170
|
-
</properties>
|
|
171
|
-
|
|
172
|
-
<testcase id="1" name="Keeps existing trailing slash" classname="src/utils/index.test.ts > ensureTrailingSlash > should not add a trailing slash if already present" />
|
|
173
|
-
</testsuite>
|
|
174
|
-
<testcase id="1" name="should add a trailing slash if not present" classname="src/utils/index.test.ts > ensureTrailingSlash" time="0.001184" />
|
|
175
|
-
<testcase id="2" name="should not add a trailing slash if already present" classname="src/utils/index.test.ts > ensureTrailingSlash" time="0.000165" />
|
|
176
|
-
<testcase id="3" name="should handle empty string" classname="src/utils/index.test.ts > ensureTrailingSlash" time="0.000154" />
|
|
177
|
-
<testcase id="4" name="should not add a trailing slash if already present" classname="src/utils/index.test.ts > ensureTrailingSlash" time="0.000143" />
|
|
178
|
-
</testsuite>
|
|
179
|
-
<testcase id="1" name="ensureTrailingSlash" classname="src/utils/index.test.ts" time="0.004302" />
|
|
180
|
-
</testsuite>
|
|
181
|
-
</testsuites>
|
package/tsconfig.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"preserveSymlinks": true,
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"module": "NodeNext",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"moduleResolution": "NodeNext",
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"strict": true,
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"declaration": true,
|
|
13
|
-
"declarationMap": true,
|
|
14
|
-
"experimentalDecorators": true
|
|
15
|
-
},
|
|
16
|
-
"include": ["src/**/*", "types.d.ts"],
|
|
17
|
-
"exclude": ["examples", "dist", "src/**/*.test.ts"]
|
|
18
|
-
}
|