@turnkey/http 2.1.0 → 2.2.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 +30 -0
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.d.ts +279 -495
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.d.ts.map +1 -1
- package/dist/__generated__/services/coordinator/public/v1/public_api.swagger.json +112 -188
- package/dist/__generated__/services/coordinator/public/v1/public_api.types.d.ts +52 -74
- package/dist/__generated__/services/coordinator/public/v1/public_api.types.d.ts.map +1 -1
- package/dist/esm/__generated__/barrel.js +4 -0
- package/dist/esm/__generated__/barrel.js.map +1 -0
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.client.js +1212 -0
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.client.js.map +1 -0
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.fetcher.js +1052 -0
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.fetcher.js.map +1 -0
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.swagger.json +5941 -0
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.types.js +6 -0
- package/dist/esm/__generated__/services/coordinator/public/v1/public_api.types.js.map +1 -0
- package/dist/esm/async.js +158 -0
- package/dist/esm/async.js.map +1 -0
- package/dist/esm/base.js +157 -0
- package/dist/esm/base.js.map +1 -0
- package/dist/esm/config.js +41 -0
- package/dist/esm/config.js.map +1 -0
- package/dist/esm/encoding.js +15 -0
- package/dist/esm/encoding.js.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/shared.js +15 -0
- package/dist/esm/shared.js.map +1 -0
- package/dist/esm/universal.js +10 -0
- package/dist/esm/universal.js.map +1 -0
- package/dist/esm/webauthn-json/api.js +24 -0
- package/dist/esm/webauthn-json/api.js.map +1 -0
- package/dist/esm/webauthn-json/base64url.js +32 -0
- package/dist/esm/webauthn-json/base64url.js.map +1 -0
- package/dist/esm/webauthn-json/convert.js +62 -0
- package/dist/esm/webauthn-json/convert.js.map +1 -0
- package/dist/esm/webauthn-json/index.js +13 -0
- package/dist/esm/webauthn-json/index.js.map +1 -0
- package/dist/esm/webauthn-json/json.js +2 -0
- package/dist/esm/webauthn-json/json.js.map +1 -0
- package/dist/esm/webauthn-json/schema-format.js +2 -0
- package/dist/esm/webauthn-json/schema-format.js.map +1 -0
- package/dist/esm/webauthn-json/schema.js +83 -0
- package/dist/esm/webauthn-json/schema.js.map +1 -0
- package/dist/esm/webauthn.js +90 -0
- package/dist/esm/webauthn.js.map +1 -0
- package/dist/webauthn.d.ts +1 -1
- package/dist/webauthn.d.ts.map +1 -1
- package/dist/webauthn.js.map +1 -1
- package/package.json +12 -2
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { convertValue as convert, copyValue as copy, derived, optional, required, } from "./convert";
|
|
2
|
+
// Shared by `create()` and `get()`.
|
|
3
|
+
const publicKeyCredentialDescriptorSchema = {
|
|
4
|
+
type: required(copy),
|
|
5
|
+
id: required(convert),
|
|
6
|
+
transports: optional(copy),
|
|
7
|
+
};
|
|
8
|
+
const simplifiedExtensionsSchema = {
|
|
9
|
+
appid: optional(copy),
|
|
10
|
+
appidExclude: optional(copy),
|
|
11
|
+
credProps: optional(copy),
|
|
12
|
+
};
|
|
13
|
+
const simplifiedClientExtensionResultsSchema = {
|
|
14
|
+
appid: optional(copy),
|
|
15
|
+
appidExclude: optional(copy),
|
|
16
|
+
credProps: optional(copy),
|
|
17
|
+
};
|
|
18
|
+
// `navigator.create()` request
|
|
19
|
+
export const credentialCreationOptions = {
|
|
20
|
+
publicKey: required({
|
|
21
|
+
rp: required(copy),
|
|
22
|
+
user: required({
|
|
23
|
+
id: required(convert),
|
|
24
|
+
name: required(copy),
|
|
25
|
+
displayName: required(copy),
|
|
26
|
+
}),
|
|
27
|
+
challenge: required(convert),
|
|
28
|
+
pubKeyCredParams: required(copy),
|
|
29
|
+
timeout: optional(copy),
|
|
30
|
+
excludeCredentials: optional([publicKeyCredentialDescriptorSchema]),
|
|
31
|
+
authenticatorSelection: optional(copy),
|
|
32
|
+
attestation: optional(copy),
|
|
33
|
+
extensions: optional(simplifiedExtensionsSchema),
|
|
34
|
+
}),
|
|
35
|
+
signal: optional(copy),
|
|
36
|
+
};
|
|
37
|
+
// `navigator.create()` response
|
|
38
|
+
export const publicKeyCredentialWithAttestation = {
|
|
39
|
+
type: required(copy),
|
|
40
|
+
id: required(copy),
|
|
41
|
+
rawId: required(convert),
|
|
42
|
+
authenticatorAttachment: optional(copy),
|
|
43
|
+
response: required({
|
|
44
|
+
clientDataJSON: required(convert),
|
|
45
|
+
attestationObject: required(convert),
|
|
46
|
+
transports: derived(copy, (response) => response.getTransports?.() || []),
|
|
47
|
+
}),
|
|
48
|
+
clientExtensionResults: derived(simplifiedClientExtensionResultsSchema, (pkc) => pkc.getClientExtensionResults()),
|
|
49
|
+
};
|
|
50
|
+
// `navigator.get()` request
|
|
51
|
+
export const credentialRequestOptions = {
|
|
52
|
+
mediation: optional(copy),
|
|
53
|
+
publicKey: required({
|
|
54
|
+
challenge: required(convert),
|
|
55
|
+
timeout: optional(copy),
|
|
56
|
+
rpId: optional(copy),
|
|
57
|
+
allowCredentials: optional([publicKeyCredentialDescriptorSchema]),
|
|
58
|
+
userVerification: optional(copy),
|
|
59
|
+
extensions: optional(simplifiedExtensionsSchema),
|
|
60
|
+
}),
|
|
61
|
+
signal: optional(copy),
|
|
62
|
+
};
|
|
63
|
+
// `navigator.get()` response
|
|
64
|
+
export const publicKeyCredentialWithAssertion = {
|
|
65
|
+
type: required(copy),
|
|
66
|
+
id: required(copy),
|
|
67
|
+
rawId: required(convert),
|
|
68
|
+
authenticatorAttachment: optional(copy),
|
|
69
|
+
response: required({
|
|
70
|
+
clientDataJSON: required(convert),
|
|
71
|
+
authenticatorData: required(convert),
|
|
72
|
+
signature: required(convert),
|
|
73
|
+
userHandle: required(convert),
|
|
74
|
+
}),
|
|
75
|
+
clientExtensionResults: derived(simplifiedClientExtensionResultsSchema, (pkc) => pkc.getClientExtensionResults()),
|
|
76
|
+
};
|
|
77
|
+
export const schema = {
|
|
78
|
+
credentialCreationOptions,
|
|
79
|
+
publicKeyCredentialWithAttestation,
|
|
80
|
+
credentialRequestOptions,
|
|
81
|
+
publicKeyCredentialWithAssertion,
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/webauthn-json/schema.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,IAAI,OAAO,EACvB,SAAS,IAAI,IAAI,EACjB,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,MAAM,WAAW,CAAC;AAEnB,oCAAoC;AAEpC,MAAM,mCAAmC,GAAW;IAClD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,0BAA0B,GAAW;IACzC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC;IACrB,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC;IAC5B,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,sCAAsC,GAAG;IAC7C,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC;IACrB,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC;IAC5B,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC;CAC1B,CAAC;AAEF,+BAA+B;AAE/B,MAAM,CAAC,MAAM,yBAAyB,GAAW;IAC/C,SAAS,EAAE,QAAQ,CAAC;QAClB,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC;QAClB,IAAI,EAAE,QAAQ,CAAC;YACb,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC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C;QAClB,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC;QAC5B,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;QACpB,gBAAgB,EAAE,QAAQ,CAAC,CAAC,mCAAmC,CAAC,CAAC;QACjE,gBAAgB,EAAE,QAAQ,CAAC,IAAI,CAAC;QAChC,UAAU,EAAE,QAAQ,CAAC,0BAA0B,CAAC;KACjD,CAAC;IACF,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC;CACvB,CAAC;AAEF,6BAA6B;AAE7B,MAAM,CAAC,MAAM,gCAAgC,GAAW;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;IACxB,uBAAuB,EAAE,QAAQ,CAAC,IAAI,CAAC;IACvC,QAAQ,EAAE,QAAQ,CAAC;QACjB,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC;QACjC,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC;QACpC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC;QAC5B,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC;KAC9B,CAAC;IACF,sBAAsB,EAAE,OAAO,CAC7B,sCAAsC,EACtC,CAAC,GAAwB,EAAE,EAAE,CAAC,GAAG,CAAC,yBAAyB,EAAE,CAC9D;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAA4B;IAC7C,yBAAyB;IACzB,kCAAkC;IAClC,wBAAwB;IACxB,gCAAgC;CACjC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { get as webauthnCredentialGet, create as webauthnCredentialCreate, } from "./webauthn-json";
|
|
2
|
+
const defaultTimeout = 5 * 60 * 1000; // five minutes
|
|
3
|
+
const defaultUserVerification = "preferred";
|
|
4
|
+
const defaultSigningOptions = {
|
|
5
|
+
publicKey: {
|
|
6
|
+
timeout: defaultTimeout,
|
|
7
|
+
userVerification: defaultUserVerification,
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
async function getCredentialRequestOptions(payload, tkSigningOptions = defaultSigningOptions) {
|
|
11
|
+
const challenge = await getChallengeFromPayload(payload);
|
|
12
|
+
const signingOptions = {
|
|
13
|
+
...tkSigningOptions,
|
|
14
|
+
publicKey: {
|
|
15
|
+
...defaultSigningOptions.publicKey,
|
|
16
|
+
...tkSigningOptions.publicKey,
|
|
17
|
+
challenge,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
return signingOptions;
|
|
21
|
+
}
|
|
22
|
+
async function getChallengeFromPayload(payload) {
|
|
23
|
+
const messageBuffer = new TextEncoder().encode(payload);
|
|
24
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", messageBuffer);
|
|
25
|
+
const hexString = Buffer.from(hashBuffer).toString("hex");
|
|
26
|
+
const hexBuffer = Buffer.from(hexString, "utf8");
|
|
27
|
+
return new Uint8Array(hexBuffer);
|
|
28
|
+
}
|
|
29
|
+
/* Pulled from https://www.w3.org/TR/webauthn-2/#enum-transport */
|
|
30
|
+
export function protocolTransportEnumToInternalEnum(protocolEnum) {
|
|
31
|
+
switch (protocolEnum) {
|
|
32
|
+
case "internal": {
|
|
33
|
+
return "AUTHENTICATOR_TRANSPORT_INTERNAL";
|
|
34
|
+
}
|
|
35
|
+
case "usb": {
|
|
36
|
+
return "AUTHENTICATOR_TRANSPORT_USB";
|
|
37
|
+
}
|
|
38
|
+
case "nfc": {
|
|
39
|
+
return "AUTHENTICATOR_TRANSPORT_NFC";
|
|
40
|
+
}
|
|
41
|
+
case "ble": {
|
|
42
|
+
return "AUTHENTICATOR_TRANSPORT_BLE";
|
|
43
|
+
}
|
|
44
|
+
case "hybrid": {
|
|
45
|
+
return "AUTHENTICATOR_TRANSPORT_HYBRID";
|
|
46
|
+
}
|
|
47
|
+
default: {
|
|
48
|
+
throw new Error("unsupported transport format");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function toInternalAttestation(attestation) {
|
|
53
|
+
return {
|
|
54
|
+
credentialId: attestation.rawId,
|
|
55
|
+
attestationObject: attestation.response.attestationObject,
|
|
56
|
+
clientDataJson: attestation.response.clientDataJSON,
|
|
57
|
+
transports: attestation.response.transports.map(protocolTransportEnumToInternalEnum),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export async function getWebAuthnAssertion(payload, options) {
|
|
61
|
+
const webAuthnSupported = hasWebAuthnSupport();
|
|
62
|
+
if (!webAuthnSupported) {
|
|
63
|
+
throw new Error("webauthn is not supported by this browser");
|
|
64
|
+
}
|
|
65
|
+
const signingOptions = await getCredentialRequestOptions(payload, options);
|
|
66
|
+
const clientGetResult = await webauthnCredentialGet(signingOptions);
|
|
67
|
+
const assertion = clientGetResult.toJSON();
|
|
68
|
+
const stamp = {
|
|
69
|
+
authenticatorData: assertion.response.authenticatorData,
|
|
70
|
+
clientDataJson: assertion.response.clientDataJSON,
|
|
71
|
+
credentialId: assertion.id,
|
|
72
|
+
signature: assertion.response.signature,
|
|
73
|
+
};
|
|
74
|
+
return JSON.stringify(stamp);
|
|
75
|
+
}
|
|
76
|
+
export async function getWebAuthnAttestation(options) {
|
|
77
|
+
const webAuthnSupported = hasWebAuthnSupport();
|
|
78
|
+
if (!webAuthnSupported) {
|
|
79
|
+
throw new Error("webauthn is not supported by this browser");
|
|
80
|
+
}
|
|
81
|
+
const res = await webauthnCredentialCreate(options);
|
|
82
|
+
return toInternalAttestation(res.toJSON());
|
|
83
|
+
}
|
|
84
|
+
// `hasWebAuthnSupport` checks for barebones webauthn support.
|
|
85
|
+
// For additional details and granular settings, see:
|
|
86
|
+
// https://web.dev/articles/passkey-form-autofill#feature-detection, https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential
|
|
87
|
+
function hasWebAuthnSupport() {
|
|
88
|
+
return !!window.PublicKeyCredential;
|
|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,CAAC,iBAAiB;QACvD,cAAc,EAAE,SAAS,CAAC,QAAQ,CAAC,cAAc;QACjD,YAAY,EAAE,SAAS,CAAC,EAAE;QAC1B,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS;KACxC,CAAC;IAEF,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAyC;IAEzC,MAAM,iBAAiB,GAAG,kBAAkB,EAAE,CAAC;IAE/C,IAAI,CAAC,iBAAiB,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAC9D;IAED,MAAM,GAAG,GAAG,MAAM,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAEpD,OAAO,qBAAqB,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,8DAA8D;AAC9D,qDAAqD;AACrD,yIAAyI;AACzI,SAAS,kBAAkB;IACzB,OAAO,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC;AACtC,CAAC"}
|
package/dist/webauthn.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { definitions } from "./__generated__/services/coordinator/public/v1/public_api.types";
|
|
2
2
|
type TAttestation = definitions["v1Attestation"];
|
|
3
3
|
type ExternalAuthenticatorTransports = AuthenticatorTransport | "hybrid";
|
|
4
|
-
type InternalAuthenticatorTransports = definitions["
|
|
4
|
+
type InternalAuthenticatorTransports = definitions["v1AuthenticatorTransport"];
|
|
5
5
|
export type TurnkeyPublicKeyCredentialRequestOptions = {
|
|
6
6
|
timeout?: number;
|
|
7
7
|
rpId?: string;
|
package/dist/webauthn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webauthn.d.ts","sourceRoot":"","sources":["../src/webauthn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,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AAE,gCAAgC,GACxC,OAAO,CAAC,YAAY,CAAC,CAUvB"}
|
package/dist/webauthn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webauthn.js","sourceRoot":"","sources":["../src/webauthn.ts"],"names":[],"mappings":";;;AAEA,mDAGyB;
|
|
1
|
+
{"version":3,"file":"webauthn.js","sourceRoot":"","sources":["../src/webauthn.ts"],"names":[],"mappings":";;;AAEA,mDAGyB;AASzB,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,eAAe;AACrD,MAAM,uBAAuB,GAAG,WAAW,CAAC;AAwB5C,MAAM,qBAAqB,GAAoC;IAC7D,SAAS,EAAE;QACT,OAAO,EAAE,cAAc;QACvB,gBAAgB,EAAE,uBAAuB;KAC1C;CACF,CAAC;AAEF,KAAK,UAAU,2BAA2B,CACxC,OAAe,EACf,mBAAoD,qBAAqB;IAEzE,MAAM,SAAS,GAAG,MAAM,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAEzD,MAAM,cAAc,GAA6B;QAC/C,GAAG,gBAAgB;QACnB,SAAS,EAAE;YACT,GAAG,qBAAqB,CAAC,SAAS;YAClC,GAAG,gBAAgB,CAAC,SAAS;YAC7B,SAAS;SACV;KACF,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,KAAK,UAAU,uBAAuB,CAAC,OAAe;IACpD,MAAM,aAAa,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxD,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACjD,OAA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KAAK,GAAmB;QAC5B,iBAAiB,EAAE,SAAS,CAAC,QAAQ,CAAC,iBAAiB;QACvD,cAAc,EAAE,SAAS,CAAC,QAAQ,CAAC,cAAc;QACjD,YAAY,EAAE,SAAS,CAAC,EAAE;QAC1B,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS;KACxC,CAAC;IAEF,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AArBD,oDAqBC;AAEM,KAAK,UAAU,sBAAsB,CAC1C,OAAyC;IAEzC,MAAM,iBAAiB,GAAG,kBAAkB,EAAE,CAAC;IAE/C,IAAI,CAAC,iBAAiB,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAC9D;IAED,MAAM,GAAG,GAAG,MAAM,IAAA,sBAAwB,EAAC,OAAO,CAAC,CAAC;IAEpD,OAAO,qBAAqB,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAC7C,CAAC;AAZD,wDAYC;AAED,8DAA8D;AAC9D,qDAAqD;AACrD,yIAAyI;AACzI,SAAS,kBAAkB;IACzB,OAAO,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC;AACtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turnkey/http",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
|
+
"module": "./dist/esm/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/esm/index.js",
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"default": "./dist/esm/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
5
14
|
"types": "./dist/index.d.ts",
|
|
6
15
|
"license": "Apache-2.0",
|
|
7
16
|
"description": "Typed HTTP client for interacting with Turnkey API",
|
|
@@ -37,8 +46,9 @@
|
|
|
37
46
|
"node": ">=16.0.0"
|
|
38
47
|
},
|
|
39
48
|
"scripts": {
|
|
40
|
-
"build": "tsc",
|
|
49
|
+
"build": "tsc -b ./tsconfig.esm.json ./tsconfig.json",
|
|
41
50
|
"clean": "rimraf ./dist ./.cache",
|
|
51
|
+
"pack": "npm pack && mv *.tgz /Users/jessecollier/git/test-app-1/",
|
|
42
52
|
"test": "jest",
|
|
43
53
|
"typecheck": "tsc -p tsconfig.typecheck.json"
|
|
44
54
|
}
|