@managesome/knotr-toolkit 0.1.1
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/constants/index.d.ts +103 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +92 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/marketplace.d.ts +130 -0
- package/dist/constants/marketplace.d.ts.map +1 -0
- package/dist/constants/marketplace.js +195 -0
- package/dist/constants/marketplace.js.map +1 -0
- package/dist/i18n/ar.json +368 -0
- package/dist/i18n/en.json +369 -0
- package/dist/i18n/index.d.ts +20 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +22 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/ur.json +368 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/types/account.d.ts +55 -0
- package/dist/types/account.d.ts.map +1 -0
- package/dist/types/account.js +3 -0
- package/dist/types/account.js.map +1 -0
- package/dist/types/admin.d.ts +70 -0
- package/dist/types/admin.d.ts.map +1 -0
- package/dist/types/admin.js +117 -0
- package/dist/types/admin.js.map +1 -0
- package/dist/types/api.d.ts +210 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +5 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/chat.d.ts +92 -0
- package/dist/types/chat.d.ts.map +1 -0
- package/dist/types/chat.js +8 -0
- package/dist/types/chat.js.map +1 -0
- package/dist/types/common.d.ts +50 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +3 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/company.d.ts +110 -0
- package/dist/types/company.d.ts.map +1 -0
- package/dist/types/company.js +3 -0
- package/dist/types/company.js.map +1 -0
- package/dist/types/flag.d.ts +67 -0
- package/dist/types/flag.d.ts.map +1 -0
- package/dist/types/flag.js +3 -0
- package/dist/types/flag.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +16 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/marketplace.d.ts +583 -0
- package/dist/types/marketplace.d.ts.map +1 -0
- package/dist/types/marketplace.js +3 -0
- package/dist/types/marketplace.js.map +1 -0
- package/dist/types/match.d.ts +71 -0
- package/dist/types/match.d.ts.map +1 -0
- package/dist/types/match.js +8 -0
- package/dist/types/match.js.map +1 -0
- package/dist/types/payment.d.ts +176 -0
- package/dist/types/payment.d.ts.map +1 -0
- package/dist/types/payment.js +112 -0
- package/dist/types/payment.js.map +1 -0
- package/dist/types/policy.d.ts +347 -0
- package/dist/types/policy.d.ts.map +1 -0
- package/dist/types/policy.js +52 -0
- package/dist/types/policy.js.map +1 -0
- package/dist/types/profile.d.ts +196 -0
- package/dist/types/profile.d.ts.map +1 -0
- package/dist/types/profile.js +3 -0
- package/dist/types/profile.js.map +1 -0
- package/dist/types/verification.d.ts +57 -0
- package/dist/types/verification.d.ts.map +1 -0
- package/dist/types/verification.js +3 -0
- package/dist/types/verification.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/types/match.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,GACX,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,WAAW,QAAS,SAAQ,eAAe;IAC/C,EAAE,EAAE,MAAM,CAAC;IAGX,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IAGxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,E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,GAAG,aAAa,GAAG,OAAO,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAGD,MAAM,WAAW,oBAAoB;IAEnC,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IAGtB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,uBAAuB,EAAE,oBAKrC,CAAC;AAGF,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.js","sourceRoot":"","sources":["../../src/types/match.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAqH3B,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,eAAe,EAAE,CAAC,EAAE,OAAO;IAC3B,aAAa,EAAE,EAAE,EAAE,mBAAmB;IACtC,iBAAiB,EAAE,EAAE,EAAE,wCAAwC;IAC/D,QAAQ,EAAE,EAAE;CACb,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { TimestampFields } from './common';
|
|
2
|
+
export type PaymentProvider = 'google_play' | 'apple_pay' | 'stripe' | 'stripe_connect';
|
|
3
|
+
export type StripeAccountStatus = 'not_connected' | 'pending' | 'active' | 'restricted' | 'disabled';
|
|
4
|
+
export interface StripeConnectAccount extends TimestampFields {
|
|
5
|
+
id: string;
|
|
6
|
+
companyId: string;
|
|
7
|
+
stripeAccountId: string;
|
|
8
|
+
stripeAccountType: 'express' | 'standard';
|
|
9
|
+
status: StripeAccountStatus;
|
|
10
|
+
onboardingComplete: boolean;
|
|
11
|
+
onboardingUrl?: string;
|
|
12
|
+
chargesEnabled: boolean;
|
|
13
|
+
payoutsEnabled: boolean;
|
|
14
|
+
payoutSchedule: 'instant' | 'daily' | 'weekly' | 'monthly';
|
|
15
|
+
defaultCurrency: string;
|
|
16
|
+
requiresVerification: boolean;
|
|
17
|
+
verificationDeadline?: Date;
|
|
18
|
+
disabledReason?: string;
|
|
19
|
+
email: string;
|
|
20
|
+
country: string;
|
|
21
|
+
businessType?: 'individual' | 'company' | 'non_profit';
|
|
22
|
+
}
|
|
23
|
+
export interface StripeConnectAccountCreateInput {
|
|
24
|
+
companyId: string;
|
|
25
|
+
email: string;
|
|
26
|
+
country: string;
|
|
27
|
+
businessType?: 'individual' | 'company' | 'non_profit';
|
|
28
|
+
}
|
|
29
|
+
export type PayoutStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'canceled';
|
|
30
|
+
export interface EscrowPayout extends TimestampFields {
|
|
31
|
+
id: string;
|
|
32
|
+
escrowId: string;
|
|
33
|
+
contractId: string;
|
|
34
|
+
companyId: string;
|
|
35
|
+
milestoneId?: string;
|
|
36
|
+
grossAmount: number;
|
|
37
|
+
platformFee: number;
|
|
38
|
+
tmcFee: number;
|
|
39
|
+
netAmount: number;
|
|
40
|
+
currency: string;
|
|
41
|
+
provider: 'stripe_connect' | 'manual';
|
|
42
|
+
stripeTransferId?: string;
|
|
43
|
+
stripePayoutId?: string;
|
|
44
|
+
status: PayoutStatus;
|
|
45
|
+
processedAt?: Date;
|
|
46
|
+
failureReason?: string;
|
|
47
|
+
description: string;
|
|
48
|
+
}
|
|
49
|
+
export interface StripePaymentRecord extends TimestampFields {
|
|
50
|
+
id: string;
|
|
51
|
+
accountId: string;
|
|
52
|
+
contractId?: string;
|
|
53
|
+
escrowId?: string;
|
|
54
|
+
stripePaymentIntentId: string;
|
|
55
|
+
stripeChargeId?: string;
|
|
56
|
+
stripeInvoiceId?: string;
|
|
57
|
+
amount: number;
|
|
58
|
+
currency: string;
|
|
59
|
+
status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'canceled' | 'refunded';
|
|
60
|
+
description: string;
|
|
61
|
+
metadata?: Record<string, string>;
|
|
62
|
+
refundedAmount?: number;
|
|
63
|
+
refundedAt?: Date;
|
|
64
|
+
refundReason?: string;
|
|
65
|
+
}
|
|
66
|
+
export type WebhookProvider = 'stripe' | 'google_play' | 'apple_app_store';
|
|
67
|
+
export interface WebhookEvent extends TimestampFields {
|
|
68
|
+
id: string;
|
|
69
|
+
provider: WebhookProvider;
|
|
70
|
+
eventId: string;
|
|
71
|
+
eventType: string;
|
|
72
|
+
processed: boolean;
|
|
73
|
+
processedAt?: Date;
|
|
74
|
+
processingError?: string;
|
|
75
|
+
retryCount: number;
|
|
76
|
+
payload: Record<string, unknown>;
|
|
77
|
+
}
|
|
78
|
+
export type SubscriptionPlan = 'free' | 'basic' | 'premium' | 'company_basic' | 'company_premium';
|
|
79
|
+
export type SubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'expired';
|
|
80
|
+
export type PurchaseType = 'subscription' | 'profile_pack' | 'donation';
|
|
81
|
+
export interface Subscription extends TimestampFields {
|
|
82
|
+
id: string;
|
|
83
|
+
accountId: string;
|
|
84
|
+
plan: SubscriptionPlan;
|
|
85
|
+
status: SubscriptionStatus;
|
|
86
|
+
trialStartedAt?: Date;
|
|
87
|
+
trialEndsAt?: Date;
|
|
88
|
+
isInTrial: boolean;
|
|
89
|
+
provider: PaymentProvider;
|
|
90
|
+
providerSubscriptionId: string;
|
|
91
|
+
providerCustomerId: string;
|
|
92
|
+
currentPeriodStart: Date;
|
|
93
|
+
currentPeriodEnd: Date;
|
|
94
|
+
canceledAt?: Date;
|
|
95
|
+
cancelReason?: string;
|
|
96
|
+
promoCodeId?: string;
|
|
97
|
+
discountPercent?: number;
|
|
98
|
+
discountEndsAt?: Date;
|
|
99
|
+
}
|
|
100
|
+
export interface Purchase extends TimestampFields {
|
|
101
|
+
id: string;
|
|
102
|
+
accountId: string;
|
|
103
|
+
type: PurchaseType;
|
|
104
|
+
productId: string;
|
|
105
|
+
productName: string;
|
|
106
|
+
provider: PaymentProvider;
|
|
107
|
+
providerTransactionId: string;
|
|
108
|
+
amount: number;
|
|
109
|
+
currency: string;
|
|
110
|
+
status: 'pending' | 'completed' | 'refunded' | 'failed';
|
|
111
|
+
profileCredits?: number;
|
|
112
|
+
donationMessage?: string;
|
|
113
|
+
isAnonymous?: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface PromoCode extends TimestampFields {
|
|
116
|
+
id: string;
|
|
117
|
+
code: string;
|
|
118
|
+
discountType: 'percent' | 'fixed' | 'trial_extension';
|
|
119
|
+
discountValue: number;
|
|
120
|
+
trialExtensionDays?: number;
|
|
121
|
+
validFrom: Date;
|
|
122
|
+
validUntil: Date;
|
|
123
|
+
isActive: boolean;
|
|
124
|
+
maxUses?: number;
|
|
125
|
+
currentUses: number;
|
|
126
|
+
maxUsesPerAccount: number;
|
|
127
|
+
applicablePlans?: SubscriptionPlan[];
|
|
128
|
+
newAccountsOnly: boolean;
|
|
129
|
+
minPurchaseAmount?: number;
|
|
130
|
+
campaign?: string;
|
|
131
|
+
createdBy: string;
|
|
132
|
+
}
|
|
133
|
+
export interface Donation extends TimestampFields {
|
|
134
|
+
id: string;
|
|
135
|
+
accountId?: string;
|
|
136
|
+
amount: number;
|
|
137
|
+
currency: string;
|
|
138
|
+
provider: PaymentProvider;
|
|
139
|
+
providerTransactionId: string;
|
|
140
|
+
status: 'pending' | 'completed' | 'refunded' | 'failed';
|
|
141
|
+
message?: string;
|
|
142
|
+
isAnonymous: boolean;
|
|
143
|
+
showInDonorList: boolean;
|
|
144
|
+
donorDisplayName?: string;
|
|
145
|
+
}
|
|
146
|
+
export interface PlanFeatures {
|
|
147
|
+
plan: SubscriptionPlan;
|
|
148
|
+
name: string;
|
|
149
|
+
description: string;
|
|
150
|
+
price: {
|
|
151
|
+
monthly: number;
|
|
152
|
+
yearly: number;
|
|
153
|
+
currency: string;
|
|
154
|
+
};
|
|
155
|
+
features: {
|
|
156
|
+
maxProfiles: number | 'unlimited';
|
|
157
|
+
maxActiveApproaches: number | 'unlimited';
|
|
158
|
+
prioritySupport: boolean;
|
|
159
|
+
advancedFilters: boolean;
|
|
160
|
+
profileBoost: boolean;
|
|
161
|
+
viewWhoLikedYou: boolean;
|
|
162
|
+
readReceipts: boolean;
|
|
163
|
+
analytics: boolean;
|
|
164
|
+
};
|
|
165
|
+
trialDays: number;
|
|
166
|
+
}
|
|
167
|
+
export declare const PLAN_FEATURES: Record<SubscriptionPlan, PlanFeatures>;
|
|
168
|
+
export interface ProfilePackProduct {
|
|
169
|
+
id: string;
|
|
170
|
+
name: string;
|
|
171
|
+
profileCredits: number;
|
|
172
|
+
price: number;
|
|
173
|
+
currency: string;
|
|
174
|
+
}
|
|
175
|
+
export declare const PROFILE_PACKS: ProfilePackProduct[];
|
|
176
|
+
//# sourceMappingURL=payment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../src/types/payment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAM3C,MAAM,MAAM,eAAe,GACvB,aAAa,GACb,WAAW,GACX,QAAQ,GACR,gBAAgB,CAAC;AAMrB,MAAM,MAAM,mBAAmB,GAC3B,eAAe,GACf,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,UAAU,CAAC;AAEf,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAGlB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,SAAS,GAAG,UAAU,CAAC;IAC1C,MAAM,EAAE,mBAAmB,CA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AE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,GAAG,WAAW,CAAC;QAClC,mBAAmB,EAAE,MAAM,GAAG,WAAW,CAAC;QAC1C,eAAe,EAAE,OAAO,CAAC;QACzB,eAAe,EAAE,OAAO,CAAC;QACzB,YAAY,EAAE,OAAO,CAAC;QACtB,eAAe,EAAE,OAAO,CAAC;QACzB,YAAY,EAAE,OAAO,CAAC;QACtB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,gBAAgB,EAAE,YAAY,CAsFhE,CAAC;AAGF,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,EAAE,kBAAkB,EAsB7C,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Payment, subscription, and donation types
|
|
2
|
+
export const PLAN_FEATURES = {
|
|
3
|
+
free: {
|
|
4
|
+
plan: 'free',
|
|
5
|
+
name: 'Free',
|
|
6
|
+
description: 'Basic features for families',
|
|
7
|
+
price: { monthly: 0, yearly: 0, currency: 'USD' },
|
|
8
|
+
features: {
|
|
9
|
+
maxProfiles: 3,
|
|
10
|
+
maxActiveApproaches: 1,
|
|
11
|
+
prioritySupport: false,
|
|
12
|
+
advancedFilters: false,
|
|
13
|
+
profileBoost: false,
|
|
14
|
+
viewWhoLikedYou: false,
|
|
15
|
+
readReceipts: false,
|
|
16
|
+
analytics: false,
|
|
17
|
+
},
|
|
18
|
+
trialDays: 0,
|
|
19
|
+
},
|
|
20
|
+
basic: {
|
|
21
|
+
plan: 'basic',
|
|
22
|
+
name: 'Basic',
|
|
23
|
+
description: 'More profiles and features',
|
|
24
|
+
price: { monthly: 9.99, yearly: 99.99, currency: 'USD' },
|
|
25
|
+
features: {
|
|
26
|
+
maxProfiles: 5,
|
|
27
|
+
maxActiveApproaches: 3,
|
|
28
|
+
prioritySupport: false,
|
|
29
|
+
advancedFilters: true,
|
|
30
|
+
profileBoost: false,
|
|
31
|
+
viewWhoLikedYou: true,
|
|
32
|
+
readReceipts: true,
|
|
33
|
+
analytics: false,
|
|
34
|
+
},
|
|
35
|
+
trialDays: 30,
|
|
36
|
+
},
|
|
37
|
+
premium: {
|
|
38
|
+
plan: 'premium',
|
|
39
|
+
name: 'Premium',
|
|
40
|
+
description: 'All features for serious matchmaking',
|
|
41
|
+
price: { monthly: 19.99, yearly: 199.99, currency: 'USD' },
|
|
42
|
+
features: {
|
|
43
|
+
maxProfiles: 10,
|
|
44
|
+
maxActiveApproaches: 5,
|
|
45
|
+
prioritySupport: true,
|
|
46
|
+
advancedFilters: true,
|
|
47
|
+
profileBoost: true,
|
|
48
|
+
viewWhoLikedYou: true,
|
|
49
|
+
readReceipts: true,
|
|
50
|
+
analytics: true,
|
|
51
|
+
},
|
|
52
|
+
trialDays: 30,
|
|
53
|
+
},
|
|
54
|
+
company_basic: {
|
|
55
|
+
plan: 'company_basic',
|
|
56
|
+
name: 'Company Basic',
|
|
57
|
+
description: 'For marriage consultancies',
|
|
58
|
+
price: { monthly: 49.99, yearly: 499.99, currency: 'USD' },
|
|
59
|
+
features: {
|
|
60
|
+
maxProfiles: 'unlimited',
|
|
61
|
+
maxActiveApproaches: 'unlimited',
|
|
62
|
+
prioritySupport: true,
|
|
63
|
+
advancedFilters: true,
|
|
64
|
+
profileBoost: false,
|
|
65
|
+
viewWhoLikedYou: true,
|
|
66
|
+
readReceipts: true,
|
|
67
|
+
analytics: true,
|
|
68
|
+
},
|
|
69
|
+
trialDays: 30,
|
|
70
|
+
},
|
|
71
|
+
company_premium: {
|
|
72
|
+
plan: 'company_premium',
|
|
73
|
+
name: 'Company Premium',
|
|
74
|
+
description: 'Full features for professionals',
|
|
75
|
+
price: { monthly: 99.99, yearly: 999.99, currency: 'USD' },
|
|
76
|
+
features: {
|
|
77
|
+
maxProfiles: 'unlimited',
|
|
78
|
+
maxActiveApproaches: 'unlimited',
|
|
79
|
+
prioritySupport: true,
|
|
80
|
+
advancedFilters: true,
|
|
81
|
+
profileBoost: true,
|
|
82
|
+
viewWhoLikedYou: true,
|
|
83
|
+
readReceipts: true,
|
|
84
|
+
analytics: true,
|
|
85
|
+
},
|
|
86
|
+
trialDays: 30,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
export const PROFILE_PACKS = [
|
|
90
|
+
{
|
|
91
|
+
id: 'pack_1',
|
|
92
|
+
name: '1 Extra Profile',
|
|
93
|
+
profileCredits: 1,
|
|
94
|
+
price: 4.99,
|
|
95
|
+
currency: 'USD',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'pack_3',
|
|
99
|
+
name: '3 Extra Profiles',
|
|
100
|
+
profileCredits: 3,
|
|
101
|
+
price: 12.99,
|
|
102
|
+
currency: 'USD',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'pack_5',
|
|
106
|
+
name: '5 Extra Profiles',
|
|
107
|
+
profileCredits: 5,
|
|
108
|
+
price: 19.99,
|
|
109
|
+
currency: 'USD',
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
//# sourceMappingURL=payment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../src/types/payment.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAkS5C,MAAM,CAAC,MAAM,aAAa,GAA2C;IACnE,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,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AE,QAAQ;QACZ,IAAI,EAAE,kBAAkB;QACxB,cAAc,EAAE,CAAC;QACjB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAK;KAChB;CACF,CAAC"}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import type { Gender } from './common';
|
|
2
|
+
import type { TrustLevel } from './company';
|
|
3
|
+
/** Policy decision outcomes */
|
|
4
|
+
export type PolicyDecision = 'ALLOW' | 'DENY' | 'ALLOW_WITH_CONDITIONS';
|
|
5
|
+
/** Soft warning that triggers obligations */
|
|
6
|
+
export type PolicySignal = 'WARN';
|
|
7
|
+
/** Combined outcome type */
|
|
8
|
+
export type PolicyOutcome = PolicyDecision | PolicySignal;
|
|
9
|
+
/** Risk tiers for step-up auth triggers */
|
|
10
|
+
export type RiskTier = 'low' | 'medium' | 'high' | 'critical';
|
|
11
|
+
/** Policy scope levels (hierarchy: platform > faith > organization > role > context) */
|
|
12
|
+
export type PolicyScope = 'platform' | 'faith' | 'organization' | 'role' | 'context';
|
|
13
|
+
/** Faith identifiers for multi-faith support */
|
|
14
|
+
export type FaithId = 'muslim' | 'christian' | 'jewish' | 'hindu' | 'sikh' | 'buddhist' | 'interfaith' | 'other';
|
|
15
|
+
/** Relationship stages in the matchmaking lifecycle */
|
|
16
|
+
export type RelationshipStage = 'discovery' | 'introduction' | 'negotiation' | 'contracted' | 'completed';
|
|
17
|
+
/** Policy categories for change control routing */
|
|
18
|
+
export type PolicyCategory = 'security' | 'business' | 'safety' | 'compliance';
|
|
19
|
+
/** Change request status */
|
|
20
|
+
export type ChangeRequestStatus = 'draft' | 'pending_approval' | 'approved' | 'rejected' | 'deployed' | 'rolled_back';
|
|
21
|
+
/** Condition operators */
|
|
22
|
+
export type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'exists' | 'regex' | 'contains' | 'startsWith' | 'endsWith';
|
|
23
|
+
/** Obligation types */
|
|
24
|
+
export type ObligationType = 'step_up_auth' | 'log' | 'notify' | 'require_approval' | 'rate_limit' | 'mask_pii' | 'delay';
|
|
25
|
+
/** Step-up auth methods */
|
|
26
|
+
export type StepUpAuthMethod = 'mfa' | 'reauthenticate' | 'guardian_approval' | 'admin_approval';
|
|
27
|
+
/** Auth strength levels */
|
|
28
|
+
export type AuthStrength = 'basic' | 'mfa' | 'step_up';
|
|
29
|
+
/** Device trust levels */
|
|
30
|
+
export type DeviceTrust = 'unknown' | 'recognized' | 'trusted';
|
|
31
|
+
/** Resource sensitivity levels */
|
|
32
|
+
export type ResourceSensitivity = 'public' | 'internal' | 'confidential' | 'restricted';
|
|
33
|
+
/** Actor types */
|
|
34
|
+
export type ActorType = 'user' | 'admin' | 'company' | 'system';
|
|
35
|
+
/** Client channels */
|
|
36
|
+
export type ClientChannel = 'mobile' | 'web' | 'admin' | 'company' | 'api';
|
|
37
|
+
/** Condition for policy evaluation */
|
|
38
|
+
export interface PolicyCondition {
|
|
39
|
+
/** Field path (dot notation) */
|
|
40
|
+
field: string;
|
|
41
|
+
/** Operator for comparison */
|
|
42
|
+
operator: ConditionOperator;
|
|
43
|
+
/** Value to compare against */
|
|
44
|
+
value: unknown;
|
|
45
|
+
/** Logical grouping with other conditions */
|
|
46
|
+
logic?: 'AND' | 'OR';
|
|
47
|
+
}
|
|
48
|
+
/** Obligation to be fulfilled when policy matches */
|
|
49
|
+
export interface PolicyObligation {
|
|
50
|
+
/** Type of obligation */
|
|
51
|
+
type: ObligationType;
|
|
52
|
+
/** Parameters for the obligation */
|
|
53
|
+
params?: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
/** Policy definition stored in registry */
|
|
56
|
+
export interface PolicyDefinition {
|
|
57
|
+
/** Unique policy identifier */
|
|
58
|
+
id: string;
|
|
59
|
+
/** Human-readable name */
|
|
60
|
+
name: string;
|
|
61
|
+
/** Semantic version (immutable once published) */
|
|
62
|
+
version: string;
|
|
63
|
+
/** Policy scope level */
|
|
64
|
+
scope: PolicyScope;
|
|
65
|
+
/** Scope qualifiers to narrow applicability */
|
|
66
|
+
scopeQualifiers?: {
|
|
67
|
+
faithId?: FaithId;
|
|
68
|
+
organizationId?: string;
|
|
69
|
+
roleId?: string;
|
|
70
|
+
};
|
|
71
|
+
/** Resource this policy applies to */
|
|
72
|
+
resource: {
|
|
73
|
+
/** Resource type (e.g., 'profile', 'contract', 'chat', 'payment') */
|
|
74
|
+
type: string;
|
|
75
|
+
/** Action being performed (e.g., 'view', 'create', 'message', 'approve') */
|
|
76
|
+
action: string;
|
|
77
|
+
};
|
|
78
|
+
/** Conditions that must be met for policy to apply */
|
|
79
|
+
conditions: PolicyCondition[];
|
|
80
|
+
/** Effect when conditions match */
|
|
81
|
+
effect: PolicyOutcome;
|
|
82
|
+
/** Obligations when effect is WARN or ALLOW_WITH_CONDITIONS */
|
|
83
|
+
obligations?: PolicyObligation[];
|
|
84
|
+
/** Priority (higher number wins on conflict) */
|
|
85
|
+
priority: number;
|
|
86
|
+
/** Policy category for change control routing */
|
|
87
|
+
category: PolicyCategory;
|
|
88
|
+
/** Whether policy is currently active */
|
|
89
|
+
isActive: boolean;
|
|
90
|
+
/** Metadata */
|
|
91
|
+
metadata: {
|
|
92
|
+
/** Owner team or individual */
|
|
93
|
+
owner: string;
|
|
94
|
+
/** Description of policy purpose */
|
|
95
|
+
description?: string;
|
|
96
|
+
/** Tags for filtering */
|
|
97
|
+
tags?: string[];
|
|
98
|
+
/** Creation timestamp */
|
|
99
|
+
createdAt: Date;
|
|
100
|
+
/** Last update timestamp */
|
|
101
|
+
updatedAt: Date;
|
|
102
|
+
/** When policy becomes effective */
|
|
103
|
+
effectiveFrom: Date;
|
|
104
|
+
/** When policy expires (optional) */
|
|
105
|
+
effectiveUntil?: Date;
|
|
106
|
+
/** Associated change request ID */
|
|
107
|
+
changeRequestId?: string;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/** Actor performing the action */
|
|
111
|
+
export interface PolicyActor {
|
|
112
|
+
/** Unique identifier */
|
|
113
|
+
id: string;
|
|
114
|
+
/** Type of actor */
|
|
115
|
+
type: ActorType;
|
|
116
|
+
/** Account ID (if applicable) */
|
|
117
|
+
accountId?: string;
|
|
118
|
+
/** Role identifier */
|
|
119
|
+
role?: string;
|
|
120
|
+
/** Explicit permissions */
|
|
121
|
+
permissions?: string[];
|
|
122
|
+
/** Organization the actor belongs to */
|
|
123
|
+
organizationId?: string;
|
|
124
|
+
/** Faith context */
|
|
125
|
+
faithId?: FaithId;
|
|
126
|
+
/** Gender */
|
|
127
|
+
gender?: Gender;
|
|
128
|
+
/** Trust level */
|
|
129
|
+
trustLevel?: TrustLevel;
|
|
130
|
+
/** Computed risk score (0-100) */
|
|
131
|
+
riskScore: number;
|
|
132
|
+
/** Computed risk tier */
|
|
133
|
+
riskTier: RiskTier;
|
|
134
|
+
/** Current authentication strength */
|
|
135
|
+
authStrength: AuthStrength;
|
|
136
|
+
}
|
|
137
|
+
/** Resource being accessed */
|
|
138
|
+
export interface PolicyResource {
|
|
139
|
+
/** Resource type */
|
|
140
|
+
type: string;
|
|
141
|
+
/** Resource ID (if applicable) */
|
|
142
|
+
id?: string;
|
|
143
|
+
/** Owner of the resource */
|
|
144
|
+
ownerId?: string;
|
|
145
|
+
/** Owner's gender */
|
|
146
|
+
ownerGender?: Gender;
|
|
147
|
+
/** Sensitivity classification */
|
|
148
|
+
sensitivity: ResourceSensitivity;
|
|
149
|
+
/** Faith context */
|
|
150
|
+
faithContext?: FaithId;
|
|
151
|
+
/** Organization the resource belongs to */
|
|
152
|
+
organizationId?: string;
|
|
153
|
+
}
|
|
154
|
+
/** Action being performed */
|
|
155
|
+
export interface PolicyAction {
|
|
156
|
+
/** Action verb (e.g., 'read', 'write', 'delete', 'approve') */
|
|
157
|
+
verb: string;
|
|
158
|
+
/** Target of the action (optional qualifier) */
|
|
159
|
+
target?: string;
|
|
160
|
+
/** Additional action metadata */
|
|
161
|
+
metadata?: Record<string, unknown>;
|
|
162
|
+
}
|
|
163
|
+
/** Environment context */
|
|
164
|
+
export interface PolicyEnvironment {
|
|
165
|
+
/** Request timestamp */
|
|
166
|
+
timestamp: Date;
|
|
167
|
+
/** Client IP address */
|
|
168
|
+
ip?: string;
|
|
169
|
+
/** Geographic location */
|
|
170
|
+
geo?: {
|
|
171
|
+
country: string;
|
|
172
|
+
region?: string;
|
|
173
|
+
city?: string;
|
|
174
|
+
};
|
|
175
|
+
/** Device identifier */
|
|
176
|
+
deviceId?: string;
|
|
177
|
+
/** Device trust level */
|
|
178
|
+
deviceTrust: DeviceTrust;
|
|
179
|
+
/** Client channel */
|
|
180
|
+
channel: ClientChannel;
|
|
181
|
+
/** User agent string */
|
|
182
|
+
userAgent?: string;
|
|
183
|
+
}
|
|
184
|
+
/** Relationship context for matchmaking scenarios */
|
|
185
|
+
export interface PolicyRelationship {
|
|
186
|
+
/** Current relationship stage */
|
|
187
|
+
stage: RelationshipStage;
|
|
188
|
+
/** Whether guardian has approved */
|
|
189
|
+
hasGuardianApproval: boolean;
|
|
190
|
+
/** Whether there is mutual interest */
|
|
191
|
+
hasMutualInterest: boolean;
|
|
192
|
+
/** Days since match was created */
|
|
193
|
+
daysSinceMatch?: number;
|
|
194
|
+
/** Match ID */
|
|
195
|
+
matchId?: string;
|
|
196
|
+
}
|
|
197
|
+
/** Complete request context for policy evaluation */
|
|
198
|
+
export interface PolicyRequestContext {
|
|
199
|
+
/** Request identifier for tracing */
|
|
200
|
+
requestId: string;
|
|
201
|
+
/** Actor performing the action */
|
|
202
|
+
actor: PolicyActor;
|
|
203
|
+
/** Resource being accessed */
|
|
204
|
+
resource: PolicyResource;
|
|
205
|
+
/** Action being performed */
|
|
206
|
+
action: PolicyAction;
|
|
207
|
+
/** Environment context */
|
|
208
|
+
environment: PolicyEnvironment;
|
|
209
|
+
/** Relationship context (if applicable) */
|
|
210
|
+
relationship?: PolicyRelationship;
|
|
211
|
+
}
|
|
212
|
+
/** Reason explaining a policy decision */
|
|
213
|
+
export interface PolicyReason {
|
|
214
|
+
/** Reason code for programmatic handling */
|
|
215
|
+
code: string;
|
|
216
|
+
/** Human-readable message */
|
|
217
|
+
message: string;
|
|
218
|
+
/** Policy that generated this reason */
|
|
219
|
+
policyId: string;
|
|
220
|
+
/** Evidence supporting the reason */
|
|
221
|
+
evidence?: Record<string, unknown>;
|
|
222
|
+
/** Severity level */
|
|
223
|
+
severity: 'info' | 'warning' | 'error';
|
|
224
|
+
}
|
|
225
|
+
/** Step-up auth requirements */
|
|
226
|
+
export interface StepUpAuthRequirement {
|
|
227
|
+
/** Whether step-up is required */
|
|
228
|
+
required: boolean;
|
|
229
|
+
/** Method for step-up */
|
|
230
|
+
method: StepUpAuthMethod;
|
|
231
|
+
/** Reason for requiring step-up */
|
|
232
|
+
reason: string;
|
|
233
|
+
/** Timeout in seconds before step-up expires */
|
|
234
|
+
timeoutSeconds: number;
|
|
235
|
+
}
|
|
236
|
+
/** Evaluation metadata */
|
|
237
|
+
export interface PolicyEvaluationMeta {
|
|
238
|
+
/** When evaluation occurred */
|
|
239
|
+
evaluatedAt: Date;
|
|
240
|
+
/** Duration of evaluation in milliseconds */
|
|
241
|
+
durationMs: number;
|
|
242
|
+
/** Number of policies evaluated */
|
|
243
|
+
policiesEvaluated: number;
|
|
244
|
+
/** Whether result was from cache */
|
|
245
|
+
cacheHit: boolean;
|
|
246
|
+
}
|
|
247
|
+
/** Complete policy decision response */
|
|
248
|
+
export interface PolicyDecisionResponse {
|
|
249
|
+
/** Request ID for correlation */
|
|
250
|
+
requestId: string;
|
|
251
|
+
/** Final decision */
|
|
252
|
+
decision: PolicyOutcome;
|
|
253
|
+
/** Explainability reasons (always populated) */
|
|
254
|
+
reasons: PolicyReason[];
|
|
255
|
+
/** IDs of policies that matched */
|
|
256
|
+
matchedPolicies: string[];
|
|
257
|
+
/** Obligations to be fulfilled */
|
|
258
|
+
obligations: PolicyObligation[];
|
|
259
|
+
/** Step-up auth requirements (if decision is WARN) */
|
|
260
|
+
stepUpAuth?: StepUpAuthRequirement;
|
|
261
|
+
/** Evaluation metadata */
|
|
262
|
+
evaluation: PolicyEvaluationMeta;
|
|
263
|
+
}
|
|
264
|
+
/** Single approval in the change request workflow */
|
|
265
|
+
export interface PolicyApproval {
|
|
266
|
+
/** Approver identifier */
|
|
267
|
+
approver: string;
|
|
268
|
+
/** Approver's role */
|
|
269
|
+
role: string;
|
|
270
|
+
/** Decision made */
|
|
271
|
+
decision: 'approve' | 'reject' | 'request_changes';
|
|
272
|
+
/** Optional comment */
|
|
273
|
+
comment?: string;
|
|
274
|
+
/** When decision was made */
|
|
275
|
+
decidedAt: Date;
|
|
276
|
+
}
|
|
277
|
+
/** Diff entry showing what changed */
|
|
278
|
+
export interface PolicyDiff {
|
|
279
|
+
/** Field that changed */
|
|
280
|
+
field: string;
|
|
281
|
+
/** Previous value */
|
|
282
|
+
oldValue: unknown;
|
|
283
|
+
/** New value */
|
|
284
|
+
newValue: unknown;
|
|
285
|
+
}
|
|
286
|
+
/** Change request for policy modifications */
|
|
287
|
+
export interface PolicyChangeRequest {
|
|
288
|
+
/** Change request ID */
|
|
289
|
+
id: string;
|
|
290
|
+
/** Policy being changed */
|
|
291
|
+
policyId: string;
|
|
292
|
+
/** Type of change */
|
|
293
|
+
changeType: 'create' | 'update' | 'deprecate' | 'delete';
|
|
294
|
+
/** Policy category (determines approval path) */
|
|
295
|
+
category: PolicyCategory;
|
|
296
|
+
/** Previous version (null for create) */
|
|
297
|
+
previousVersion?: string;
|
|
298
|
+
/** Proposed version */
|
|
299
|
+
proposedVersion: string;
|
|
300
|
+
/** Proposed policy definition (for create/update) */
|
|
301
|
+
proposedPolicy?: PolicyDefinition;
|
|
302
|
+
/** Diff of changes */
|
|
303
|
+
diff: PolicyDiff[];
|
|
304
|
+
/** Who requested the change */
|
|
305
|
+
requestedBy: string;
|
|
306
|
+
/** When change was requested */
|
|
307
|
+
requestedAt: Date;
|
|
308
|
+
/** Justification for the change */
|
|
309
|
+
justification: string;
|
|
310
|
+
/** Approval workflow state */
|
|
311
|
+
approvals: PolicyApproval[];
|
|
312
|
+
/** Number of required approvals (always 2) */
|
|
313
|
+
requiredApprovals: 2;
|
|
314
|
+
/** Current status */
|
|
315
|
+
status: ChangeRequestStatus;
|
|
316
|
+
/** Scheduled deployment time */
|
|
317
|
+
scheduledFor?: Date;
|
|
318
|
+
/** When change was deployed */
|
|
319
|
+
deployedAt?: Date;
|
|
320
|
+
/** Who deployed the change */
|
|
321
|
+
deployedBy?: string;
|
|
322
|
+
}
|
|
323
|
+
/** Risk tier configuration */
|
|
324
|
+
export interface RiskTierConfig {
|
|
325
|
+
/** Tier identifier */
|
|
326
|
+
tier: RiskTier;
|
|
327
|
+
/** Score range for this tier */
|
|
328
|
+
scoreRange: {
|
|
329
|
+
min: number;
|
|
330
|
+
max: number;
|
|
331
|
+
};
|
|
332
|
+
/** Whether step-up auth is required */
|
|
333
|
+
stepUpRequired: boolean;
|
|
334
|
+
/** Method for step-up (if required) */
|
|
335
|
+
stepUpMethod?: StepUpAuthMethod;
|
|
336
|
+
/** Timeout for step-up in seconds */
|
|
337
|
+
stepUpTimeoutSeconds: number;
|
|
338
|
+
/** Actions that trigger step-up at this tier */
|
|
339
|
+
triggerActions: string[];
|
|
340
|
+
}
|
|
341
|
+
/** Default risk tier configurations */
|
|
342
|
+
export declare const DEFAULT_RISK_TIERS: RiskTierConfig[];
|
|
343
|
+
/** Approval SLA by policy category (in hours) */
|
|
344
|
+
export declare const POLICY_APPROVAL_SLA: Record<PolicyCategory, number>;
|
|
345
|
+
/** Required approver roles by policy category */
|
|
346
|
+
export declare const POLICY_APPROVER_ROLES: Record<PolicyCategory, string[]>;
|
|
347
|
+
//# sourceMappingURL=policy.d.ts.map
|