@kagal/acme 0.1.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/dist/types.mjs ADDED
@@ -0,0 +1,48 @@
1
+ export { A as AccountStatuses, a as AuthorizationStatuses, C as ChallengeStatuses, I as IdentifierTypes, O as OrderStatuses, b as accountStatuses, c as authorizationStatuses, d as challengeStatuses, i as identifierTypes, o as orderStatuses } from './shared/acme.BvAs3CeC.mjs';
2
+
3
+ const challengeTypes = [
4
+ "dns-01",
5
+ "http-01",
6
+ "tls-alpn-01"
7
+ ];
8
+ const ChallengeTypes = new Set(challengeTypes);
9
+
10
+ const errorTypes = [
11
+ // RFC 8555 §6.7
12
+ "urn:ietf:params:acme:error:accountDoesNotExist",
13
+ "urn:ietf:params:acme:error:alreadyRevoked",
14
+ "urn:ietf:params:acme:error:badCSR",
15
+ "urn:ietf:params:acme:error:badNonce",
16
+ "urn:ietf:params:acme:error:badPublicKey",
17
+ "urn:ietf:params:acme:error:badRevocationReason",
18
+ "urn:ietf:params:acme:error:badSignatureAlgorithm",
19
+ "urn:ietf:params:acme:error:caa",
20
+ "urn:ietf:params:acme:error:compound",
21
+ "urn:ietf:params:acme:error:connection",
22
+ "urn:ietf:params:acme:error:dns",
23
+ "urn:ietf:params:acme:error:externalAccountRequired",
24
+ "urn:ietf:params:acme:error:incorrectResponse",
25
+ "urn:ietf:params:acme:error:invalidContact",
26
+ "urn:ietf:params:acme:error:malformed",
27
+ "urn:ietf:params:acme:error:orderNotReady",
28
+ "urn:ietf:params:acme:error:rateLimited",
29
+ "urn:ietf:params:acme:error:rejectedIdentifier",
30
+ "urn:ietf:params:acme:error:serverInternal",
31
+ "urn:ietf:params:acme:error:tls",
32
+ "urn:ietf:params:acme:error:unauthorized",
33
+ "urn:ietf:params:acme:error:unsupportedContact",
34
+ "urn:ietf:params:acme:error:unsupportedIdentifier",
35
+ "urn:ietf:params:acme:error:userActionRequired",
36
+ // RFC 9773 §7.4
37
+ "urn:ietf:params:acme:error:alreadyReplaced",
38
+ // draft-ietf-acme-profiles §6
39
+ "urn:ietf:params:acme:error:invalidProfile"
40
+ ];
41
+ const ErrorTypes = new Set(errorTypes);
42
+
43
+ function narrow(set, value) {
44
+ return set.has(value) ? value : void 0;
45
+ }
46
+
47
+ export { ChallengeTypes, ErrorTypes, challengeTypes, errorTypes, narrow };
48
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","sources":["../src/types/constants/challenge-type.ts","../src/types/constants/error-type.ts","../src/types/utils.ts"],"sourcesContent":["// ACME challenge type constants (RFC 8555 + RFC 8737)\n\n/** Challenge type values. */\nexport const challengeTypes = [\n 'dns-01',\n 'http-01',\n 'tls-alpn-01',\n] as const;\n\n/**\n * Challenge type union.\n *\n * @see {@link https://datatracker.ietf.org/doc/html/rfc8555#section-8}\n * @see {@link https://datatracker.ietf.org/doc/html/rfc8737}\n */\nexport type ChallengeType = (typeof challengeTypes)[number];\n\n/** Runtime set of valid challenge types. */\nexport const ChallengeTypes: ReadonlySet<ChallengeType> = new Set(challengeTypes);\n","/** ACME error type URNs. */\nexport const errorTypes = [\n // RFC 8555 §6.7\n 'urn:ietf:params:acme:error:accountDoesNotExist',\n 'urn:ietf:params:acme:error:alreadyRevoked',\n 'urn:ietf:params:acme:error:badCSR',\n 'urn:ietf:params:acme:error:badNonce',\n 'urn:ietf:params:acme:error:badPublicKey',\n 'urn:ietf:params:acme:error:badRevocationReason',\n 'urn:ietf:params:acme:error:badSignatureAlgorithm',\n 'urn:ietf:params:acme:error:caa',\n 'urn:ietf:params:acme:error:compound',\n 'urn:ietf:params:acme:error:connection',\n 'urn:ietf:params:acme:error:dns',\n 'urn:ietf:params:acme:error:externalAccountRequired',\n 'urn:ietf:params:acme:error:incorrectResponse',\n 'urn:ietf:params:acme:error:invalidContact',\n 'urn:ietf:params:acme:error:malformed',\n 'urn:ietf:params:acme:error:orderNotReady',\n 'urn:ietf:params:acme:error:rateLimited',\n 'urn:ietf:params:acme:error:rejectedIdentifier',\n 'urn:ietf:params:acme:error:serverInternal',\n 'urn:ietf:params:acme:error:tls',\n 'urn:ietf:params:acme:error:unauthorized',\n 'urn:ietf:params:acme:error:unsupportedContact',\n 'urn:ietf:params:acme:error:unsupportedIdentifier',\n 'urn:ietf:params:acme:error:userActionRequired',\n // RFC 9773 §7.4\n 'urn:ietf:params:acme:error:alreadyReplaced',\n // draft-ietf-acme-profiles §6\n 'urn:ietf:params:acme:error:invalidProfile',\n] as const;\n\n/**\n * ACME error type union.\n *\n * @see {@link https://datatracker.ietf.org/doc/html/rfc8555#section-6.7}\n * @see {@link https://datatracker.ietf.org/doc/html/rfc9773#section-7.4}\n * @see {@link https://datatracker.ietf.org/doc/draft-ietf-acme-profiles/}\n */\nexport type ErrorType = (typeof errorTypes)[number];\n\n/** Runtime set of valid ACME error types. */\nexport const ErrorTypes: ReadonlySet<ErrorType> = new Set(errorTypes);\n","// Type-narrowing utilities\n\n/**\n * Narrows `value` to `T` if it belongs to `set`,\n * otherwise `undefined`.\n *\n * @param set - ReadonlySet to check membership against\n * @param value - string to narrow\n * @returns the value as `T`, or `undefined`\n *\n * @example\n * ```typescript\n * const status = narrow(OrderStatuses, raw);\n * // ^? OrderStatus | undefined\n * ```\n */\nexport function narrow<T extends string>(\n set: ReadonlySet<T>,\n value: string,\n): T | undefined {\n return set.has(value as T) ? value as T : undefined;\n}\n"],"names":[],"mappings":";;AAGO,MAAM,cAAA,GAAiB;AAAA,EAC5B,QAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF;AAWO,MAAM,cAAA,GAA6C,IAAI,GAAA,CAAI,cAAc;;ACjBzE,MAAM,UAAA,GAAa;AAAA;AAAA,EAExB,gDAAA;AAAA,EACA,2CAAA;AAAA,EACA,mCAAA;AAAA,EACA,qCAAA;AAAA,EACA,yCAAA;AAAA,EACA,gDAAA;AAAA,EACA,kDAAA;AAAA,EACA,gCAAA;AAAA,EACA,qCAAA;AAAA,EACA,uCAAA;AAAA,EACA,gCAAA;AAAA,EACA,oDAAA;AAAA,EACA,8CAAA;AAAA,EACA,2CAAA;AAAA,EACA,sCAAA;AAAA,EACA,0CAAA;AAAA,EACA,wCAAA;AAAA,EACA,+CAAA;AAAA,EACA,2CAAA;AAAA,EACA,gCAAA;AAAA,EACA,yCAAA;AAAA,EACA,+CAAA;AAAA,EACA,kDAAA;AAAA,EACA,+CAAA;AAAA;AAAA,EAEA,4CAAA;AAAA;AAAA,EAEA;AACF;AAYO,MAAM,UAAA,GAAqC,IAAI,GAAA,CAAI,UAAU;;AC3B7D,SAAS,MAAA,CACd,KACA,KAAA,EACe;AACf,EAAA,OAAO,GAAA,CAAI,GAAA,CAAI,KAAU,CAAA,GAAI,KAAA,GAAa,MAAA;AAC5C;;;;"}
@@ -0,0 +1 @@
1
+ export { VERSION } from './index.mjs';
@@ -0,0 +1 @@
1
+ export { VERSION } from './index.js';
package/dist/utils.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export { VERSION } from './index.mjs';
2
+ //# sourceMappingURL=utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "@kagal/acme",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Platform-neutral ACME protocol library (RFC 8555)",
6
+ "author": "Alejandro Mery <amery@apptly.co>",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/kagal-dev/pki/tree/main/packages/@kagal-acme#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/kagal-dev/pki.git",
12
+ "directory": "packages/@kagal-acme"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/kagal-dev/pki/issues"
16
+ },
17
+ "keywords": [
18
+ "acme",
19
+ "certificate",
20
+ "kagal",
21
+ "letsencrypt",
22
+ "pki",
23
+ "rfc8555",
24
+ "typescript",
25
+ "webcrypto",
26
+ "x509"
27
+ ],
28
+ "main": "./dist/index.mjs",
29
+ "module": "./dist/index.mjs",
30
+ "types": "./dist/index.d.mts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.mts",
34
+ "default": "./dist/index.mjs"
35
+ },
36
+ "./client": {
37
+ "types": "./dist/client.d.mts",
38
+ "default": "./dist/client.mjs"
39
+ },
40
+ "./schema": {
41
+ "types": "./dist/schema.d.mts",
42
+ "default": "./dist/schema.mjs"
43
+ },
44
+ "./server": {
45
+ "types": "./dist/server.d.mts",
46
+ "default": "./dist/server.mjs"
47
+ },
48
+ "./types": {
49
+ "types": "./dist/types.d.mts",
50
+ "default": "./dist/types.mjs"
51
+ },
52
+ "./utils": {
53
+ "types": "./dist/utils.d.mts",
54
+ "default": "./dist/utils.mjs"
55
+ }
56
+ },
57
+ "files": [
58
+ "dist"
59
+ ],
60
+ "dependencies": {
61
+ "valibot": "^1.3.1"
62
+ },
63
+ "devDependencies": {
64
+ "@kagal/cross-test": "^0.1.2",
65
+ "@poupe/eslint-config": "~0.9.1",
66
+ "@types/node": "^20.19.37",
67
+ "@vitest/coverage-istanbul": "^4.1.4",
68
+ "eslint": "^9.39.4",
69
+ "npm-run-all2": "^8.0.4",
70
+ "publint": "^0.3.18",
71
+ "rimraf": "^6.1.3",
72
+ "typescript": "~5.9.3",
73
+ "unbuild": "3.6.1",
74
+ "vitest": "^4.1.4"
75
+ },
76
+ "engines": {
77
+ "node": ">= 20.20.1",
78
+ "pnpm": ">= 10.32.1"
79
+ },
80
+ "publishConfig": {
81
+ "access": "public"
82
+ },
83
+ "scripts": {
84
+ "build": "unbuild",
85
+ "clean": "rimraf dist node_modules",
86
+ "dev": "vitest",
87
+ "dev:prepare": "unbuild --stub",
88
+ "lint": "eslint --fix .",
89
+ "lint:check": "eslint .",
90
+ "lint:pkg-pr-new": "eslint --fix package.json",
91
+ "precommit": "run-s build lint type-check test",
92
+ "publint": "publint",
93
+ "publish:maybe": "npm view ${npm_package_name}@${npm_package_version} version 2>/dev/null && echo \"${npm_package_name}@${npm_package_version} already published\" || pnpm publish",
94
+ "test": "vitest run",
95
+ "test:coverage": "vitest run --coverage",
96
+ "test:watch": "vitest",
97
+ "type-check": "run-s type-check:main type-check:tools type-check:tests",
98
+ "type-check:main": "tsc --noEmit -p tsconfig.json",
99
+ "type-check:tests": "tsc --noEmit -p tsconfig.tests.json",
100
+ "type-check:tools": "tsc --noEmit -p tsconfig.tools.json"
101
+ }
102
+ }