@tryvitris/website-admin-contracts 0.1.0-alpha.1 → 1.0.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.
@@ -0,0 +1,103 @@
1
+ /** Installation choices, supplied by trusted source rather than browser input. */
2
+ export interface StripeBillingConfig {
3
+ accountId: string;
4
+ mode: 'test' | 'live';
5
+ currency: string;
6
+ prices: string[];
7
+ portalConfigurationId?: string;
8
+ allowLiveWrites?: boolean;
9
+ grants?: BillingAccountGrant[];
10
+ }
11
+ export interface BillingAccountGrant {
12
+ id: string;
13
+ tokenHash: string;
14
+ customerId: string;
15
+ installationId: string;
16
+ siteId: string;
17
+ adminOrigin: string;
18
+ manage: boolean;
19
+ enabled: boolean;
20
+ }
21
+ export interface BillingAccountConfig {
22
+ sellerOrigin: string;
23
+ sellerInstallationId: string;
24
+ sellerSiteId: string;
25
+ grantId: string;
26
+ customerId: string;
27
+ mode: 'test' | 'live';
28
+ }
29
+ export interface StripeCustomer {
30
+ id: string;
31
+ name: string;
32
+ email: string;
33
+ stripeId: string;
34
+ createdAt: number;
35
+ }
36
+ export interface StripePrice {
37
+ id: string;
38
+ name: string;
39
+ amount: number;
40
+ currency: string;
41
+ interval: 'month' | 'year' | null;
42
+ intervalCount: number;
43
+ }
44
+ export interface StripeRecord {
45
+ id: string;
46
+ customerId: string;
47
+ kind: 'invoice' | 'subscription' | 'checkout' | 'payment';
48
+ status: string;
49
+ amount: number;
50
+ paid: number;
51
+ remaining: number;
52
+ currency: string;
53
+ label: string;
54
+ date: number | null;
55
+ cancelAtPeriodEnd: boolean;
56
+ cancelAt?: number | null;
57
+ priceIds: string[];
58
+ }
59
+ export interface StripeInvoiceDraft {
60
+ id: string;
61
+ customerId: string;
62
+ description: string;
63
+ lines: {
64
+ description: string;
65
+ quantity: number;
66
+ unitAmount: number;
67
+ }[];
68
+ dueDays: number;
69
+ revision: number;
70
+ state: 'draft' | 'issuing' | 'issued';
71
+ stripeId: string | null;
72
+ }
73
+ export interface StripeBillingView {
74
+ provider: 'stripe';
75
+ simulated: false;
76
+ audience: 'seller' | 'customer';
77
+ installationId: string;
78
+ siteId: string;
79
+ mode: 'test' | 'live';
80
+ currency: string;
81
+ business: string;
82
+ setup: {
83
+ configured: boolean;
84
+ verified: boolean;
85
+ webhookConfigured: boolean;
86
+ liveWritesAllowed: boolean;
87
+ verifiedAt: number | null;
88
+ };
89
+ customers: StripeCustomer[];
90
+ records: StripeRecord[];
91
+ drafts: StripeInvoiceDraft[];
92
+ prices: StripePrice[];
93
+ operations: {
94
+ id: string;
95
+ kind: string;
96
+ state: string;
97
+ createdAt: number;
98
+ }[];
99
+ sync: {
100
+ pending: number;
101
+ failed: number;
102
+ };
103
+ }
File without changes
package/package.json CHANGED
@@ -1,32 +1,36 @@
1
- {
2
- "name": "@tryvitris/website-admin-contracts",
3
- "version": "0.1.0-alpha.1",
4
- "type": "module",
5
- "license": "MIT",
6
- "description": "Validated installation and module contracts for Cloudflare business admin apps",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "default": "./dist/index.js"
11
- }
12
- },
13
- "files": [
14
- "dist"
15
- ],
16
- "publishConfig": {
17
- "access": "public",
18
- "tag": "alpha"
19
- },
20
- "engines": {
21
- "node": ">=24"
22
- },
23
- "repository": {
24
- "type": "git",
25
- "url": "git+https://github.com/jackperrotta/website-admin-harness.git",
26
- "directory": "packages/contracts"
27
- },
28
- "homepage": "https://github.com/jackperrotta/website-admin-harness#readme",
29
- "bugs": {
30
- "url": "https://github.com/jackperrotta/website-admin-harness/issues"
31
- }
32
- }
1
+ {
2
+ "name": "@tryvitris/website-admin-contracts",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "description": "Validated installation and module contracts for Cloudflare business admin apps",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./scheduling": {
13
+ "types": "./dist/scheduling.d.ts",
14
+ "default": "./dist/scheduling.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "publishConfig": {
21
+ "access": "public",
22
+ "tag": "latest"
23
+ },
24
+ "engines": {
25
+ "node": ">=24"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/jackperrotta/website-admin-harness.git",
30
+ "directory": "packages/contracts"
31
+ },
32
+ "homepage": "https://github.com/jackperrotta/website-admin-harness#readme",
33
+ "bugs": {
34
+ "url": "https://github.com/jackperrotta/website-admin-harness/issues"
35
+ }
36
+ }