@qrauth/node 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/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # @qrauth/node
2
+
3
+ Official Node.js SDK for [QRAuth](https://qrauth.io) — cryptographic QR code verification and anti-fraud infrastructure.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @qrauth/node
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```typescript
14
+ import { QRAuth } from '@qrauth/node';
15
+
16
+ const qrauth = new QRAuth({
17
+ apiKey: process.env.QRAUTH_API_KEY!,
18
+ });
19
+
20
+ // Generate a verified QR code
21
+ const qr = await qrauth.create({
22
+ destination: 'https://parking.gr/pay',
23
+ location: { lat: 40.63, lng: 22.94 },
24
+ expiresIn: '1y',
25
+ });
26
+
27
+ console.log(qr.verification_url);
28
+ // → https://qrauth.io/v/xK9m2pQ7
29
+
30
+ // Verify a scanned QR code
31
+ const result = await qrauth.verify('xK9m2pQ7');
32
+ console.log(result.verified); // true
33
+ console.log(result.security.trustScore); // 94
34
+ ```
35
+
36
+ ## API
37
+
38
+ ### `new QRAuth(options)`
39
+
40
+ | Option | Type | Required | Description |
41
+ |-----------|----------|----------|-------------------------------------------------|
42
+ | `apiKey` | `string` | Yes | Your API key (starts with `qrauth_`) |
43
+ | `baseUrl` | `string` | No | API base URL. Defaults to `https://qrauth.io` |
44
+
45
+ ### `qrauth.create(options)`
46
+
47
+ Generate a cryptographically signed QR code.
48
+
49
+ ```typescript
50
+ const qr = await qrauth.create({
51
+ destination: 'https://example.com/pay',
52
+ label: 'Parking Meter #42',
53
+ location: { lat: 40.63, lng: 22.94, radiusM: 100 },
54
+ expiresIn: '30d',
55
+ });
56
+ ```
57
+
58
+ | Option | Type | Description |
59
+ |---------------|----------|------------------------------------------------------|
60
+ | `destination` | `string` | Target URL |
61
+ | `label` | `string` | Human-readable label |
62
+ | `location` | `object` | `{ lat, lng, radiusM? }` — geo-fence binding |
63
+ | `expiresIn` | `string` | Duration (`30s`, `5m`, `6h`, `30d`, `1y`) or ISO date |
64
+ | `contentType` | `string` | Content type: `url`, `event`, `coupon`, `vcard`, etc. |
65
+ | `content` | `object` | Structured content (for non-URL types) |
66
+
67
+ ### `qrauth.verify(token, options?)`
68
+
69
+ Verify a QR code and get its trust score.
70
+
71
+ ```typescript
72
+ const result = await qrauth.verify('xK9m2pQ7', {
73
+ clientLat: 40.63,
74
+ clientLng: 22.94,
75
+ });
76
+ ```
77
+
78
+ ### `qrauth.list(options?)`
79
+
80
+ List QR codes for your organization.
81
+
82
+ ```typescript
83
+ const { data, total } = await qrauth.list({
84
+ page: 1,
85
+ pageSize: 20,
86
+ status: 'ACTIVE',
87
+ });
88
+ ```
89
+
90
+ ### `qrauth.get(token)`
91
+
92
+ Get details of a specific QR code.
93
+
94
+ ### `qrauth.revoke(token)`
95
+
96
+ Revoke a QR code so it no longer verifies.
97
+
98
+ ### `qrauth.bulk(items)`
99
+
100
+ Create up to 100 QR codes in a single request.
101
+
102
+ ```typescript
103
+ const result = await qrauth.bulk([
104
+ { destination: 'https://example.com/1', label: 'Meter 1' },
105
+ { destination: 'https://example.com/2', label: 'Meter 2' },
106
+ ]);
107
+ ```
108
+
109
+ ## Error Handling
110
+
111
+ ```typescript
112
+ import { QRAuth, AuthenticationError, RateLimitError } from '@qrauth/node';
113
+
114
+ try {
115
+ await qrauth.create({ destination: 'https://example.com' });
116
+ } catch (err) {
117
+ if (err instanceof AuthenticationError) {
118
+ console.error('Bad API key');
119
+ } else if (err instanceof RateLimitError) {
120
+ console.error(`Rate limited. Retry after ${err.retryAfter}s`);
121
+ }
122
+ }
123
+ ```
124
+
125
+ ## License
126
+
127
+ MIT
@@ -0,0 +1,53 @@
1
+ import type { QRAuthOptions, CreateQRCodeOptions, QRCodeResponse, ListQRCodesOptions, QRCodeDetail, PaginatedResponse, VerifyOptions, VerificationResult, BulkCreateItem, BulkCreateResponse } from './types.js';
2
+ /**
3
+ * QRAuth Node.js SDK client.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * import { QRAuth } from '@qrauth/node';
8
+ *
9
+ * const qrauth = new QRAuth({ apiKey: process.env.QRAUTH_API_KEY! });
10
+ *
11
+ * const qr = await qrauth.create({
12
+ * destination: 'https://parking.gr/pay',
13
+ * location: { lat: 40.63, lng: 22.94 },
14
+ * expiresIn: '1y',
15
+ * });
16
+ *
17
+ * console.log(qr.verification_url);
18
+ * ```
19
+ */
20
+ export declare class QRAuth {
21
+ private readonly apiKey;
22
+ private readonly baseUrl;
23
+ constructor(options: QRAuthOptions);
24
+ /**
25
+ * Generate a cryptographically signed QR code.
26
+ */
27
+ create(options: CreateQRCodeOptions): Promise<QRCodeResponse>;
28
+ /**
29
+ * Verify a QR code token and get its trust score and metadata.
30
+ */
31
+ verify(token: string, options?: VerifyOptions): Promise<VerificationResult>;
32
+ /**
33
+ * List QR codes for your organization.
34
+ */
35
+ list(options?: ListQRCodesOptions): Promise<PaginatedResponse<QRCodeDetail>>;
36
+ /**
37
+ * Get details of a specific QR code by token.
38
+ */
39
+ get(token: string): Promise<QRCodeDetail>;
40
+ /**
41
+ * Revoke a QR code. It will no longer verify successfully.
42
+ */
43
+ revoke(token: string): Promise<{
44
+ message: string;
45
+ }>;
46
+ /**
47
+ * Generate multiple signed QR codes in a single request (max 100).
48
+ */
49
+ bulk(items: BulkCreateItem[]): Promise<BulkCreateResponse>;
50
+ private request;
51
+ private handleError;
52
+ }
53
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAIpB;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,aAAa;IAYlC;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC;IA4BnE;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAiBjF;;OAEG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAclF;;OAEG;IACG,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAQ/C;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAQzD;;OAEG;IACG,IAAI,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC;YAmBlD,OAAO;YA+BP,WAAW;CA0B1B"}
package/dist/client.js ADDED
@@ -0,0 +1,225 @@
1
+ import { QRAuthError, AuthenticationError, AuthorizationError, NotFoundError, RateLimitError, ValidationError, } from './errors.js';
2
+ const DEFAULT_BASE_URL = 'https://qrauth.io';
3
+ /**
4
+ * QRAuth Node.js SDK client.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { QRAuth } from '@qrauth/node';
9
+ *
10
+ * const qrauth = new QRAuth({ apiKey: process.env.QRAUTH_API_KEY! });
11
+ *
12
+ * const qr = await qrauth.create({
13
+ * destination: 'https://parking.gr/pay',
14
+ * location: { lat: 40.63, lng: 22.94 },
15
+ * expiresIn: '1y',
16
+ * });
17
+ *
18
+ * console.log(qr.verification_url);
19
+ * ```
20
+ */
21
+ export class QRAuth {
22
+ apiKey;
23
+ baseUrl;
24
+ constructor(options) {
25
+ if (!options.apiKey) {
26
+ throw new Error('QRAuth: apiKey is required');
27
+ }
28
+ this.apiKey = options.apiKey;
29
+ this.baseUrl = (options.baseUrl || DEFAULT_BASE_URL).replace(/\/+$/, '');
30
+ }
31
+ // -------------------------------------------------------------------------
32
+ // QR Code — create
33
+ // -------------------------------------------------------------------------
34
+ /**
35
+ * Generate a cryptographically signed QR code.
36
+ */
37
+ async create(options) {
38
+ const body = {
39
+ destinationUrl: options.destination,
40
+ };
41
+ if (options.label)
42
+ body.label = options.label;
43
+ if (options.contentType)
44
+ body.contentType = options.contentType;
45
+ if (options.content)
46
+ body.content = options.content;
47
+ if (options.location) {
48
+ body.location = {
49
+ lat: options.location.lat,
50
+ lng: options.location.lng,
51
+ radiusM: options.location.radiusM ?? 50,
52
+ };
53
+ }
54
+ if (options.expiresIn) {
55
+ body.expiresAt = parseDuration(options.expiresIn);
56
+ }
57
+ return this.request('POST', '/api/v1/qrcodes', body);
58
+ }
59
+ // -------------------------------------------------------------------------
60
+ // QR Code — verify
61
+ // -------------------------------------------------------------------------
62
+ /**
63
+ * Verify a QR code token and get its trust score and metadata.
64
+ */
65
+ async verify(token, options) {
66
+ const params = new URLSearchParams();
67
+ if (options?.clientLat !== undefined)
68
+ params.set('clientLat', String(options.clientLat));
69
+ if (options?.clientLng !== undefined)
70
+ params.set('clientLng', String(options.clientLng));
71
+ const qs = params.toString();
72
+ const path = `/api/v1/verify/${encodeURIComponent(token)}${qs ? `?${qs}` : ''}`;
73
+ return this.request('GET', path, undefined, {
74
+ Accept: 'application/json',
75
+ });
76
+ }
77
+ // -------------------------------------------------------------------------
78
+ // QR Code — list
79
+ // -------------------------------------------------------------------------
80
+ /**
81
+ * List QR codes for your organization.
82
+ */
83
+ async list(options) {
84
+ const params = new URLSearchParams();
85
+ if (options?.page)
86
+ params.set('page', String(options.page));
87
+ if (options?.pageSize)
88
+ params.set('pageSize', String(options.pageSize));
89
+ if (options?.status)
90
+ params.set('status', options.status);
91
+ const qs = params.toString();
92
+ return this.request('GET', `/api/v1/qrcodes${qs ? `?${qs}` : ''}`);
93
+ }
94
+ // -------------------------------------------------------------------------
95
+ // QR Code — get
96
+ // -------------------------------------------------------------------------
97
+ /**
98
+ * Get details of a specific QR code by token.
99
+ */
100
+ async get(token) {
101
+ return this.request('GET', `/api/v1/qrcodes/${encodeURIComponent(token)}`);
102
+ }
103
+ // -------------------------------------------------------------------------
104
+ // QR Code — revoke
105
+ // -------------------------------------------------------------------------
106
+ /**
107
+ * Revoke a QR code. It will no longer verify successfully.
108
+ */
109
+ async revoke(token) {
110
+ return this.request('DELETE', `/api/v1/qrcodes/${encodeURIComponent(token)}`);
111
+ }
112
+ // -------------------------------------------------------------------------
113
+ // QR Code — bulk create
114
+ // -------------------------------------------------------------------------
115
+ /**
116
+ * Generate multiple signed QR codes in a single request (max 100).
117
+ */
118
+ async bulk(items) {
119
+ const body = {
120
+ items: items.map((item) => ({
121
+ destinationUrl: item.destination,
122
+ label: item.label,
123
+ location: item.location
124
+ ? { lat: item.location.lat, lng: item.location.lng, radiusM: item.location.radiusM ?? 50 }
125
+ : undefined,
126
+ expiresAt: item.expiresIn ? parseDuration(item.expiresIn) : undefined,
127
+ })),
128
+ };
129
+ return this.request('POST', '/api/v1/qrcodes/bulk', body);
130
+ }
131
+ // -------------------------------------------------------------------------
132
+ // Internal HTTP client
133
+ // -------------------------------------------------------------------------
134
+ async request(method, path, body, extraHeaders) {
135
+ const url = `${this.baseUrl}${path}`;
136
+ const headers = {
137
+ 'X-API-Key': this.apiKey,
138
+ 'User-Agent': 'qrauth-node/0.1.0',
139
+ ...extraHeaders,
140
+ };
141
+ if (body !== undefined) {
142
+ headers['Content-Type'] = 'application/json';
143
+ }
144
+ const res = await fetch(url, {
145
+ method,
146
+ headers,
147
+ body: body !== undefined ? JSON.stringify(body) : undefined,
148
+ });
149
+ if (!res.ok) {
150
+ await this.handleError(res);
151
+ }
152
+ return res.json();
153
+ }
154
+ async handleError(res) {
155
+ let message;
156
+ try {
157
+ const body = await res.json();
158
+ message = body.message || body.error || res.statusText;
159
+ }
160
+ catch {
161
+ message = res.statusText;
162
+ }
163
+ switch (res.status) {
164
+ case 400:
165
+ throw new ValidationError(message);
166
+ case 401:
167
+ throw new AuthenticationError(message);
168
+ case 403:
169
+ throw new AuthorizationError(message);
170
+ case 404:
171
+ throw new NotFoundError(message);
172
+ case 429: {
173
+ const retryAfter = res.headers.get('retry-after');
174
+ throw new RateLimitError(message, retryAfter ? parseInt(retryAfter, 10) : undefined);
175
+ }
176
+ default:
177
+ throw new QRAuthError(message, res.status, 'API_ERROR');
178
+ }
179
+ }
180
+ }
181
+ // ---------------------------------------------------------------------------
182
+ // Duration parser
183
+ // ---------------------------------------------------------------------------
184
+ /**
185
+ * Parse a human-readable duration string into an ISO 8601 datetime string.
186
+ * Supports: `30s`, `5m`, `6h`, `30d`, `1y`, or raw ISO 8601 datetimes.
187
+ */
188
+ function parseDuration(input) {
189
+ // If it's already an ISO datetime, return as-is
190
+ if (input.includes('T') || input.includes('-')) {
191
+ return input;
192
+ }
193
+ const match = input.match(/^(\d+)(s|m|h|d|w|mo|y)$/);
194
+ if (!match) {
195
+ throw new Error(`Invalid duration: "${input}". Use formats like 30s, 5m, 6h, 30d, 1y or an ISO datetime.`);
196
+ }
197
+ const value = parseInt(match[1], 10);
198
+ const unit = match[2];
199
+ const now = new Date();
200
+ switch (unit) {
201
+ case 's':
202
+ now.setSeconds(now.getSeconds() + value);
203
+ break;
204
+ case 'm':
205
+ now.setMinutes(now.getMinutes() + value);
206
+ break;
207
+ case 'h':
208
+ now.setHours(now.getHours() + value);
209
+ break;
210
+ case 'd':
211
+ now.setDate(now.getDate() + value);
212
+ break;
213
+ case 'w':
214
+ now.setDate(now.getDate() + value * 7);
215
+ break;
216
+ case 'mo':
217
+ now.setMonth(now.getMonth() + value);
218
+ break;
219
+ case 'y':
220
+ now.setFullYear(now.getFullYear() + value);
221
+ break;
222
+ }
223
+ return now.toISOString();
224
+ }
225
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,eAAe,GAChB,MAAM,aAAa,CAAC;AAcrB,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,MAAM;IACA,MAAM,CAAS;IACf,OAAO,CAAS;IAEjC,YAAY,OAAsB;QAChC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,gBAAgB,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,4EAA4E;IAC5E,mBAAmB;IACnB,4EAA4E;IAE5E;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,OAA4B;QACvC,MAAM,IAAI,GAA4B;YACpC,cAAc,EAAE,OAAO,CAAC,WAAW;SACpC,CAAC;QAEF,IAAI,OAAO,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC9C,IAAI,OAAO,CAAC,WAAW;YAAE,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAChE,IAAI,OAAO,CAAC,OAAO;YAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAEpD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,IAAI,CAAC,QAAQ,GAAG;gBACd,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG;gB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AC,CAAC;YAC3C,MAAM;IACV,CAAC;IAED,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Base error class for all QRAuth SDK errors.
3
+ */
4
+ export declare class QRAuthError extends Error {
5
+ readonly statusCode: number;
6
+ readonly code: string;
7
+ constructor(message: string, statusCode: number, code: string);
8
+ }
9
+ export declare class AuthenticationError extends QRAuthError {
10
+ constructor(message?: string);
11
+ }
12
+ export declare class AuthorizationError extends QRAuthError {
13
+ constructor(message?: string);
14
+ }
15
+ export declare class NotFoundError extends QRAuthError {
16
+ constructor(message?: string);
17
+ }
18
+ export declare class RateLimitError extends QRAuthError {
19
+ readonly retryAfter?: number;
20
+ constructor(message?: string, retryAfter?: number);
21
+ }
22
+ export declare class QuotaExceededError extends QRAuthError {
23
+ constructor(message?: string);
24
+ }
25
+ export declare class ValidationError extends QRAuthError {
26
+ constructor(message?: string);
27
+ }
28
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,IAAI,EAAE,MAAM,CAAC;gBAEjB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAM9D;AAED,qBAAa,mBAAoB,SAAQ,WAAW;gBACtC,OAAO,SAA+B;CAInD;AAED,qBAAa,kBAAmB,SAAQ,WAAW;gBACrC,OAAO,SAA6B;CAIjD;AAED,qBAAa,aAAc,SAAQ,WAAW;gBAChC,OAAO,SAAuB;CAI3C;AAED,qBAAa,cAAe,SAAQ,WAAW;IAC7C,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;gBAExB,OAAO,SAAwB,EAAE,UAAU,CAAC,EAAE,MAAM;CAKjE;AAED,qBAAa,kBAAmB,SAAQ,WAAW;gBACrC,OAAO,SAAwB;CAI5C;AAED,qBAAa,eAAgB,SAAQ,WAAW;gBAClC,OAAO,SAAsB;CAI1C"}
package/dist/errors.js ADDED
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Base error class for all QRAuth SDK errors.
3
+ */
4
+ export class QRAuthError extends Error {
5
+ statusCode;
6
+ code;
7
+ constructor(message, statusCode, code) {
8
+ super(message);
9
+ this.name = 'QRAuthError';
10
+ this.statusCode = statusCode;
11
+ this.code = code;
12
+ }
13
+ }
14
+ export class AuthenticationError extends QRAuthError {
15
+ constructor(message = 'Invalid or missing API key') {
16
+ super(message, 401, 'AUTHENTICATION_ERROR');
17
+ this.name = 'AuthenticationError';
18
+ }
19
+ }
20
+ export class AuthorizationError extends QRAuthError {
21
+ constructor(message = 'Insufficient permissions') {
22
+ super(message, 403, 'AUTHORIZATION_ERROR');
23
+ this.name = 'AuthorizationError';
24
+ }
25
+ }
26
+ export class NotFoundError extends QRAuthError {
27
+ constructor(message = 'Resource not found') {
28
+ super(message, 404, 'NOT_FOUND');
29
+ this.name = 'NotFoundError';
30
+ }
31
+ }
32
+ export class RateLimitError extends QRAuthError {
33
+ retryAfter;
34
+ constructor(message = 'Rate limit exceeded', retryAfter) {
35
+ super(message, 429, 'RATE_LIMIT_EXCEEDED');
36
+ this.name = 'RateLimitError';
37
+ this.retryAfter = retryAfter;
38
+ }
39
+ }
40
+ export class QuotaExceededError extends QRAuthError {
41
+ constructor(message = 'Plan quota exceeded') {
42
+ super(message, 429, 'QUOTA_EXCEEDED');
43
+ this.name = 'QuotaExceededError';
44
+ }
45
+ }
46
+ export class ValidationError extends QRAuthError {
47
+ constructor(message = 'Validation failed') {
48
+ super(message, 400, 'VALIDATION_ERROR');
49
+ this.name = 'ValidationError';
50
+ }
51
+ }
52
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[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,GAAG,qBAAqB;QACzC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAC9C,YAAY,OAAO,GAAG,mBAAmB;QACvC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,kBAAkB,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export { QRAuth } from './client.js';
2
+ export type { QRAuthOptions, CreateQRCodeOptions, QRCodeResponse, ListQRCodesOptions, QRCodeDetail, PaginatedResponse, VerifyOptions, VerificationResult, BulkCreateItem, BulkCreateResponse, DomainWarning, } from './types.js';
3
+ export { QRAuthError, AuthenticationError, AuthorizationError, NotFoundError, RateLimitError, QuotaExceededError, ValidationError, } from './errors.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { QRAuth } from './client.js';
2
+ export { QRAuthError, AuthenticationError, AuthorizationError, NotFoundError, RateLimitError, QuotaExceededError, ValidationError, } from './errors.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAcrC,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,133 @@
1
+ export interface QRAuthOptions {
2
+ /** API key (starts with `qrauth_`). */
3
+ apiKey: string;
4
+ /** Base URL of the QRAuth API. Defaults to `https://qrauth.io`. */
5
+ baseUrl?: string;
6
+ }
7
+ export interface CreateQRCodeOptions {
8
+ /** The URL this QR code points to. Required for URL-type QR codes. */
9
+ destination: string;
10
+ /** Human-readable label. */
11
+ label?: string;
12
+ /** Physical location where the QR code will be deployed. */
13
+ location?: {
14
+ lat: number;
15
+ lng: number;
16
+ /** Geo-fence radius in metres. Default: 50. */
17
+ radiusM?: number;
18
+ };
19
+ /**
20
+ * Expiration as a duration string (e.g. `'1y'`, `'30d'`, `'6h'`) or
21
+ * an ISO 8601 datetime string. If omitted, the QR code never expires.
22
+ */
23
+ expiresIn?: string;
24
+ /** Content type (e.g. `'url'`, `'event'`, `'coupon'`). Defaults to `'url'`. */
25
+ contentType?: string;
26
+ /** Structured content payload (for non-URL content types). */
27
+ content?: Record<string, unknown>;
28
+ }
29
+ export interface QRCodeResponse {
30
+ token: string;
31
+ verification_url: string;
32
+ qr_image_url: string;
33
+ signature: string;
34
+ organization_id: string;
35
+ label: string | null;
36
+ created_at: string;
37
+ expires_at: string | null;
38
+ transparency_log_index: number | null;
39
+ domain_warnings?: DomainWarning[];
40
+ }
41
+ export interface DomainWarning {
42
+ similar_to: string;
43
+ verified_org: string;
44
+ similarity: number;
45
+ reason: string;
46
+ }
47
+ export interface ListQRCodesOptions {
48
+ page?: number;
49
+ pageSize?: number;
50
+ status?: 'ACTIVE' | 'EXPIRED' | 'REVOKED';
51
+ }
52
+ export interface QRCodeDetail {
53
+ token: string;
54
+ destinationUrl: string;
55
+ label: string | null;
56
+ status: string;
57
+ signature: string;
58
+ contentType: string;
59
+ content: Record<string, unknown> | null;
60
+ latitude: number | null;
61
+ longitude: number | null;
62
+ radiusM: number;
63
+ expiresAt: string | null;
64
+ createdAt: string;
65
+ updatedAt: string;
66
+ _count: {
67
+ scans: number;
68
+ };
69
+ }
70
+ export interface PaginatedResponse<T> {
71
+ data: T[];
72
+ total: number;
73
+ page: number;
74
+ pageSize: number;
75
+ totalPages: number;
76
+ }
77
+ export interface VerifyOptions {
78
+ /** Client latitude for geo-fence matching. */
79
+ clientLat?: number;
80
+ /** Client longitude for geo-fence matching. */
81
+ clientLng?: number;
82
+ }
83
+ export interface VerificationResult {
84
+ verified: boolean;
85
+ organization: {
86
+ id: string;
87
+ name: string;
88
+ slug: string;
89
+ trustLevel: string;
90
+ kycStatus: string;
91
+ domainVerified?: boolean;
92
+ };
93
+ destination_url: string;
94
+ location_match: {
95
+ matched: boolean;
96
+ distanceM: number | null;
97
+ registeredAddress: string | null;
98
+ };
99
+ security: {
100
+ signatureValid: boolean;
101
+ proxyDetected: boolean;
102
+ trustScore: number;
103
+ transparencyLogVerified: boolean;
104
+ };
105
+ domain_warning?: {
106
+ message: string;
107
+ similarDomain: string;
108
+ verifiedOrg: string;
109
+ };
110
+ scannedAt: string;
111
+ }
112
+ export interface BulkCreateItem {
113
+ destination: string;
114
+ label?: string;
115
+ location?: {
116
+ lat: number;
117
+ lng: number;
118
+ radiusM?: number;
119
+ };
120
+ expiresIn?: string;
121
+ }
122
+ export interface BulkCreateResponse {
123
+ total: number;
124
+ succeeded: number;
125
+ failed: number;
126
+ results: Array<{
127
+ index: number;
128
+ success: boolean;
129
+ data?: QRCodeResponse;
130
+ error?: string;
131
+ }>;
132
+ }
133
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA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,CAAC;IACF,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE;QACd,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;KAClC,CAAC;IACF,QAAQ,EAAE;QACR,cAAc,EAAE,OAAO,CAAC;QACxB,aAAa,EAAE,OAAO,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,uBAAuB,EAAE,OAAO,CAAC;KAClC,CAAC;IACF,cAAc,CAAC,EAAE;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,CAAC,EAAE,cAAc,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ"}
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Constructor options
3
+ // ---------------------------------------------------------------------------
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,sBAAsB;AACtB,8EAA8E"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@qrauth/node",
3
+ "version": "0.1.0",
4
+ "description": "Official Node.js SDK for QRAuth — cryptographic QR code verification",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc",
20
+ "dev": "tsc --watch",
21
+ "prepublishOnly": "npm run build"
22
+ },
23
+ "keywords": [
24
+ "qrauth",
25
+ "qr-code",
26
+ "verification",
27
+ "authentication",
28
+ "ecdsa",
29
+ "anti-fraud"
30
+ ],
31
+ "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/qrauth/qrauth"
35
+ },
36
+ "engines": {
37
+ "node": ">=18"
38
+ },
39
+ "devDependencies": {
40
+ "typescript": "^5.5.0"
41
+ }
42
+ }