syntro-sdk 1.0.0 → 1.0.2
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/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +8 -1
- package/dist/index.mjs +8 -1
- package/package.json +9 -3
- package/src/index.ts +8 -0
- package/src/types.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -61,6 +61,7 @@ interface VerifyPaymentResult {
|
|
|
61
61
|
}
|
|
62
62
|
interface VerifyPaymentOptions {
|
|
63
63
|
name?: string;
|
|
64
|
+
amount?: number;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
/**
|
|
@@ -226,6 +227,10 @@ declare class Syntro {
|
|
|
226
227
|
* if (paid) console.log('Customer paid!', transaction.amount);
|
|
227
228
|
*/
|
|
228
229
|
verifyPayment(customerEmail: string, options?: VerifyPaymentOptions): Promise<VerifyPaymentResult>;
|
|
230
|
+
/**
|
|
231
|
+
* Alias for verifyPayment.
|
|
232
|
+
*/
|
|
233
|
+
checkPaid(customerEmail: string, options?: VerifyPaymentOptions): Promise<VerifyPaymentResult>;
|
|
229
234
|
}
|
|
230
235
|
|
|
231
236
|
export { type AuthResult, type EventResult, type EventType, type MetadataResult, type PaymentResult, Syntro, type SyntroConfig, type SyntroEvent, type UserResult, type VerifyPaymentOptions, type VerifyPaymentResult, type VerifyResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ interface VerifyPaymentResult {
|
|
|
61
61
|
}
|
|
62
62
|
interface VerifyPaymentOptions {
|
|
63
63
|
name?: string;
|
|
64
|
+
amount?: number;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
/**
|
|
@@ -226,6 +227,10 @@ declare class Syntro {
|
|
|
226
227
|
* if (paid) console.log('Customer paid!', transaction.amount);
|
|
227
228
|
*/
|
|
228
229
|
verifyPayment(customerEmail: string, options?: VerifyPaymentOptions): Promise<VerifyPaymentResult>;
|
|
230
|
+
/**
|
|
231
|
+
* Alias for verifyPayment.
|
|
232
|
+
*/
|
|
233
|
+
checkPaid(customerEmail: string, options?: VerifyPaymentOptions): Promise<VerifyPaymentResult>;
|
|
229
234
|
}
|
|
230
235
|
|
|
231
236
|
export { type AuthResult, type EventResult, type EventType, type MetadataResult, type PaymentResult, Syntro, type SyntroConfig, type SyntroEvent, type UserResult, type VerifyPaymentOptions, type VerifyPaymentResult, type VerifyResult };
|
package/dist/index.js
CHANGED
|
@@ -292,12 +292,19 @@ var Syntro = class {
|
|
|
292
292
|
try {
|
|
293
293
|
return await this.get("/v1/billing/verify-payment", {
|
|
294
294
|
customerEmail,
|
|
295
|
-
...options?.name ? { name: options.name } : {}
|
|
295
|
+
...options?.name ? { name: options.name } : {},
|
|
296
|
+
...options?.amount !== void 0 ? { amount: options.amount } : {}
|
|
296
297
|
});
|
|
297
298
|
} catch (err) {
|
|
298
299
|
return { paid: false, error: err instanceof Error ? err.message : "Unknown error" };
|
|
299
300
|
}
|
|
300
301
|
}
|
|
302
|
+
/**
|
|
303
|
+
* Alias for verifyPayment.
|
|
304
|
+
*/
|
|
305
|
+
async checkPaid(customerEmail, options) {
|
|
306
|
+
return this.verifyPayment(customerEmail, options);
|
|
307
|
+
}
|
|
301
308
|
};
|
|
302
309
|
// Annotate the CommonJS export names for ESM import in node:
|
|
303
310
|
0 && (module.exports = {
|
package/dist/index.mjs
CHANGED
|
@@ -268,12 +268,19 @@ var Syntro = class {
|
|
|
268
268
|
try {
|
|
269
269
|
return await this.get("/v1/billing/verify-payment", {
|
|
270
270
|
customerEmail,
|
|
271
|
-
...options?.name ? { name: options.name } : {}
|
|
271
|
+
...options?.name ? { name: options.name } : {},
|
|
272
|
+
...options?.amount !== void 0 ? { amount: options.amount } : {}
|
|
272
273
|
});
|
|
273
274
|
} catch (err) {
|
|
274
275
|
return { paid: false, error: err instanceof Error ? err.message : "Unknown error" };
|
|
275
276
|
}
|
|
276
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Alias for verifyPayment.
|
|
280
|
+
*/
|
|
281
|
+
async checkPaid(customerEmail, options) {
|
|
282
|
+
return this.verifyPayment(customerEmail, options);
|
|
283
|
+
}
|
|
277
284
|
};
|
|
278
285
|
export {
|
|
279
286
|
Syntro
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syntro-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Official JavaScript/TypeScript SDK for Syntro BaaS",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,11 +17,17 @@
|
|
|
17
17
|
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
18
18
|
"test": "node dist/index.cjs"
|
|
19
19
|
},
|
|
20
|
-
"keywords": [
|
|
20
|
+
"keywords": [
|
|
21
|
+
"syntro",
|
|
22
|
+
"baas",
|
|
23
|
+
"sdk",
|
|
24
|
+
"analytics",
|
|
25
|
+
"auth"
|
|
26
|
+
],
|
|
21
27
|
"license": "MIT",
|
|
22
28
|
"devDependencies": {
|
|
23
29
|
"tsup": "^8.4.0",
|
|
24
30
|
"typescript": "^5.8.2",
|
|
25
31
|
"@types/node": "^22.14.0"
|
|
26
32
|
}
|
|
27
|
-
}
|
|
33
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -353,9 +353,17 @@ export class Syntro {
|
|
|
353
353
|
return await this.get<VerifyPaymentResult>('/v1/billing/verify-payment', {
|
|
354
354
|
customerEmail,
|
|
355
355
|
...(options?.name ? { name: options.name } : {}),
|
|
356
|
+
...(options?.amount !== undefined ? { amount: options.amount } : {}),
|
|
356
357
|
});
|
|
357
358
|
} catch (err) {
|
|
358
359
|
return { paid: false, error: err instanceof Error ? err.message : 'Unknown error' };
|
|
359
360
|
}
|
|
360
361
|
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Alias for verifyPayment.
|
|
365
|
+
*/
|
|
366
|
+
async checkPaid(customerEmail: string, options?: VerifyPaymentOptions): Promise<VerifyPaymentResult> {
|
|
367
|
+
return this.verifyPayment(customerEmail, options);
|
|
368
|
+
}
|
|
361
369
|
}
|