@turystack/entity 0.0.3 → 0.0.5
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/entity/index.d.ts +1 -1
- package/dist/entity/index.d.ts.map +1 -1
- package/dist/entity/index.js +1 -1
- package/dist/entity/index.js.map +1 -1
- package/dist/exceptions/index.d.ts +1 -1
- package/dist/exceptions/index.d.ts.map +1 -1
- package/dist/exceptions/index.js +1 -58
- package/dist/exceptions/index.js.map +1 -1
- package/package.json +1 -1
package/dist/entity/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './entity.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
package/dist/entity/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './entity.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/entity/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './exceptions.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
package/dist/exceptions/index.js
CHANGED
|
@@ -1,59 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { createExceptions } from './exceptions.js';
|
|
3
|
-
describe('createExceptions', () => {
|
|
4
|
-
it('should create exceptions with not_found default', () => {
|
|
5
|
-
const exceptions = createExceptions((e) => ({
|
|
6
|
-
user: e.module('user', []),
|
|
7
|
-
}));
|
|
8
|
-
expect(exceptions.user.not_found).toBe('user.not_found');
|
|
9
|
-
});
|
|
10
|
-
it('should prefix custom codes with module name', () => {
|
|
11
|
-
const exceptions = createExceptions((e) => ({
|
|
12
|
-
billing: e.module('billing_threshold', [
|
|
13
|
-
'cannot_deactivate',
|
|
14
|
-
'currency_not_compatible',
|
|
15
|
-
]),
|
|
16
|
-
}));
|
|
17
|
-
expect(exceptions.billing.not_found).toBe('billing_threshold.not_found');
|
|
18
|
-
expect(exceptions.billing.cannot_deactivate).toBe('billing_threshold.cannot_deactivate');
|
|
19
|
-
expect(exceptions.billing.currency_not_compatible).toBe('billing_threshold.currency_not_compatible');
|
|
20
|
-
});
|
|
21
|
-
it('should support multiple modules', () => {
|
|
22
|
-
const exceptions = createExceptions((e) => ({
|
|
23
|
-
coupon: e.module('coupon', [
|
|
24
|
-
'code_already_exists',
|
|
25
|
-
'not_available',
|
|
26
|
-
]),
|
|
27
|
-
invoice: e.module('invoice', [
|
|
28
|
-
'not_expired',
|
|
29
|
-
'not_payable',
|
|
30
|
-
]),
|
|
31
|
-
}));
|
|
32
|
-
expect(exceptions.coupon.not_found).toBe('coupon.not_found');
|
|
33
|
-
expect(exceptions.coupon.code_already_exists).toBe('coupon.code_already_exists');
|
|
34
|
-
expect(exceptions.invoice.not_found).toBe('invoice.not_found');
|
|
35
|
-
expect(exceptions.invoice.not_payable).toBe('invoice.not_payable');
|
|
36
|
-
});
|
|
37
|
-
it('should match billing-service pattern', () => {
|
|
38
|
-
const exceptions = createExceptions((e) => ({
|
|
39
|
-
billingThreshold: e.module('billing_threshold', [
|
|
40
|
-
'cannot_deactivate',
|
|
41
|
-
'cannot_reactivate',
|
|
42
|
-
'currency_not_compatible',
|
|
43
|
-
'not_available',
|
|
44
|
-
]),
|
|
45
|
-
customer: e.module('customer', [
|
|
46
|
-
'no_active_subscription',
|
|
47
|
-
'no_had_subscription',
|
|
48
|
-
'organization_id_already_exists',
|
|
49
|
-
]),
|
|
50
|
-
voucher: e.module('voucher', []),
|
|
51
|
-
}));
|
|
52
|
-
expect(exceptions.billingThreshold.not_found).toBe('billing_threshold.not_found');
|
|
53
|
-
expect(exceptions.billingThreshold.cannot_deactivate).toBe('billing_threshold.cannot_deactivate');
|
|
54
|
-
expect(exceptions.customer.not_found).toBe('customer.not_found');
|
|
55
|
-
expect(exceptions.customer.organization_id_already_exists).toBe('customer.organization_id_already_exists');
|
|
56
|
-
expect(exceptions.voucher.not_found).toBe('voucher.not_found');
|
|
57
|
-
});
|
|
58
|
-
});
|
|
1
|
+
export * from './exceptions.js';
|
|
59
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|