@internetarchive/donation-monthly-portal 7.0.2 → 7.0.3

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.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { MonthlyGivingCircle } from './src/monthly-giving-circle';
2
2
  export type { APlanUpdate } from './src/monthly-giving-circle';
3
3
  export { Receipt } from './src/models/receipt';
4
+ export type { AReceipt } from './src/models/receipt';
4
5
  export { MonthlyPlan } from './src/models/plan';
6
+ export type { Plan, BtData } from './src/models/plan';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { MonthlyGivingCircle } from './src/monthly-giving-circle';\nexport type { APlanUpdate } from './src/monthly-giving-circle';\nexport { Receipt } from './src/models/receipt';\nexport { MonthlyPlan } from './src/models/plan';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { MonthlyGivingCircle } from './src/monthly-giving-circle';\nexport type { APlanUpdate } from './src/monthly-giving-circle';\nexport { Receipt } from './src/models/receipt';\nexport type { AReceipt } from './src/models/receipt';\nexport { MonthlyPlan } from './src/models/plan';\nexport type { Plan, BtData } from './src/models/plan';\n"]}
@@ -1,4 +1,4 @@
1
- declare type BtData = {
1
+ export declare type BtData = {
2
2
  billingDayOfMonth: number;
3
3
  nextBillingDate: {
4
4
  date: string;
@@ -19,8 +19,9 @@ declare type BtData = {
19
19
  expirationYear: string | null;
20
20
  paypalEmail?: string;
21
21
  venmoUsername?: string;
22
+ processorId?: string;
22
23
  };
23
- declare type Plan = {
24
+ export declare type Plan = {
24
25
  token: string;
25
26
  amount: number;
26
27
  currency: string;
@@ -49,4 +50,3 @@ export declare class MonthlyPlan {
49
50
  get isTest(): boolean;
50
51
  cancelPlan(): void;
51
52
  }
52
- export {};
@@ -1 +1 @@
1
- {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../src/models/plan.ts"],"names":[],"mappings":"AAoCA,MAAM,OAAO,WAAW;IAOtB,YAAY,IAAU;;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,KAAK,CAAC,CAAC,cAAc;IACxD,CAAC;IAED,IAAI,EAAE;QACJ,yBAAyB;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IACzB,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,SAAS,CAAC,SAAiB;QACzB,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,eAAe;QACjB,uBAAuB;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC;IAC3C,CAAC;IAED,kBAAkB,CAAC,OAAe;QAChC,uBAAuB;QACvB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC;QACzE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,GAAG,OAAO,CAAC;IAC9C,CAAC;IAED,IAAI,qBAAqB;QACvB,MAAM,eAAe,GAAG,IAAI,IAAI,CAC9B,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAClC,CAAC,kBAAkB,CAAC,SAAS,EAAE;YAC9B,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,OAAO;YACd,GAAG,EAAE,SAAS;SACf,CAAC,CAAC;QAEH,OAAO,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,WAAW,CAAC;IACxC,CAAC;IAED,IAAI,qBAAqB;QACvB,MAAM,eAAe,GAAG,IAAI,IAAI,CAC9B,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAClC,CAAC,kBAAkB,CAAC,SAAS,EAAE;YAC9B,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,OAAO;YACd,GAAG,EAAE,SAAS;SACf,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC;QAE3D,OAAO,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,WAAW,CAAC;IACxC,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC;IACxC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC/B,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;IAwBI","sourcesContent":["type BtData = {\n billingDayOfMonth: number;\n nextBillingDate: {\n date: string;\n timezone_type: number;\n timezone: string;\n oldDate?: string; // optional for updates ISO UTC date string\n };\n lastBillingDate: {\n date: string;\n timezone_type: number;\n timezone: string;\n };\n status: string; // active, inactive\n paymentMethodType: string; // cc, paypal, venmo, etc\n last4: string | null;\n cardType: string | null;\n expirationMonth: string | null;\n expirationYear: string | null;\n paypalEmail?: string;\n venmoUsername?: string;\n};\n\ntype Plan = {\n token: string;\n amount: number;\n currency: string;\n start_date: string; // UTC\n is_test: boolean;\n btdata: BtData;\n oldAmount?: number;\n oldDate?: string;\n oldPaymentMethod?: string;\n isCancelled?: boolean;\n};\n\nexport class MonthlyPlan {\n plan: Plan;\n\n currency: string;\n\n payment: BtData;\n\n constructor(plan: Plan) {\n this.plan = plan;\n this.payment = plan.btdata;\n this.currency = plan.currency ?? 'USD'; // not in data\n }\n\n get id(): string {\n // use token as unique id\n return this.plan.token;\n }\n\n get currencySymbol(): string {\n return this.currency === 'USD' ? '$' : '';\n }\n\n get amount(): number {\n return this.plan.amount;\n }\n\n setAmount(newAmount: number) {\n this.plan.oldAmount = this.plan.amount;\n this.plan.amount = newAmount;\n }\n\n get nextBillingDate(): string {\n // iso08601 date string\n return this.payment.nextBillingDate.date;\n }\n\n setNextBillingDate(newDate: string) {\n // iso08601 date string\n this.payment.nextBillingDate.oldDate = this.payment.nextBillingDate.date;\n this.payment.nextBillingDate.date = newDate;\n }\n\n get nextBillingDateLocale(): string {\n const nextBillingDate = new Date(\n this.payment.nextBillingDate.date\n ).toLocaleDateString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n\n return nextBillingDate ?? 'not found';\n }\n\n get lastBillingDateLocale(): string {\n const lastBillingDate = new Date(\n this.payment.lastBillingDate.date\n ).toLocaleDateString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n\n console.log('lastBillingDate from model', lastBillingDate);\n\n return lastBillingDate ?? 'not found';\n }\n\n get hasBeenCancelled(): boolean {\n return this.plan.isCancelled === true;\n }\n\n get isTest(): boolean {\n return this.plan.is_test;\n }\n\n cancelPlan(): void {\n this.plan.isCancelled = true;\n }\n}\n\n/*\n\n{\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtYWlsc3luYyIsImlhdCI6MTczODYxNTY3NS41ODA4MTcsIm5iZiI6MTczODYxNTYxNS41ODA4MTcsImV4cCI6MTczODYxNjI3NS41ODA4MTcsImtleSI6eyJwaWQiOiJkd2NrN20iLCJjaWQiOjgwMzUzOCwiYW1vdW50Ijo1LCJwYXltZW50TWV0aG9kVG9rZW4iOiJxMXllYndoaiIsImN1c3RvbWVySWQiOiI4NTQ2MTk4MzUifSwidXNlciI6IkBpc2EtYXQtdGhlLWFyY2hpdmUifQ.TYlkU1ZZLHmj2ahrkTV7JGLmpCPN4BcOeDFPiXVj0pM\",\n \"amount\": 5,\n \"currency\": \"USD\",\n \"start_date\": \"2022-12-09 00:00:00\",\n \"contribution_status_id\": 5,\n \"is_test\": true,\n \"btdata\": {\n \"billingDayOfMonth\": 9,\n \"nextBillingDate\": {\n \"date\": \"2025-02-09 00:00:00.000000\",\n \"timezone_type\": 3,\n \"timezone\": \"UTC\"\n },\n \"status\": \"Active\",\n \"paymentMethodType\": \"creditCard\",\n \"last4\": \"1111\",\n \"cardType\": \"Visa\",\n \"expirationMonth\": \"12\",\n \"expirationYear\": \"2023\"\n }\n}\n */\n"]}
1
+ {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../src/models/plan.ts"],"names":[],"mappings":"AAqCA,MAAM,OAAO,WAAW;IAOtB,YAAY,IAAU;;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,KAAK,CAAC,CAAC,cAAc;IACxD,CAAC;IAED,IAAI,EAAE;QACJ,yBAAyB;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IACzB,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,SAAS,CAAC,SAAiB;QACzB,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,eAAe;QACjB,uBAAuB;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC;IAC3C,CAAC;IAED,kBAAkB,CAAC,OAAe;QAChC,uBAAuB;QACvB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC;QACzE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,GAAG,OAAO,CAAC;IAC9C,CAAC;IAED,IAAI,qBAAqB;QACvB,MAAM,eAAe,GAAG,IAAI,IAAI,CAC9B,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAClC,CAAC,kBAAkB,CAAC,SAAS,EAAE;YAC9B,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,OAAO;YACd,GAAG,EAAE,SAAS;SACf,CAAC,CAAC;QAEH,OAAO,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,WAAW,CAAC;IACxC,CAAC;IAED,IAAI,qBAAqB;QACvB,MAAM,eAAe,GAAG,IAAI,IAAI,CAC9B,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAClC,CAAC,kBAAkB,CAAC,SAAS,EAAE;YAC9B,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,OAAO;YACd,GAAG,EAAE,SAAS;SACf,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC;QAE3D,OAAO,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,WAAW,CAAC;IACxC,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC;IACxC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC/B,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;IAwBI","sourcesContent":["export type BtData = {\n billingDayOfMonth: number;\n nextBillingDate: {\n date: string;\n timezone_type: number;\n timezone: string;\n oldDate?: string; // optional for updates ISO UTC date string\n };\n lastBillingDate: {\n date: string;\n timezone_type: number;\n timezone: string;\n };\n status: string; // active, inactive\n paymentMethodType: string; // cc, paypal, venmo, etc\n last4: string | null;\n cardType: string | null;\n expirationMonth: string | null;\n expirationYear: string | null;\n paypalEmail?: string;\n venmoUsername?: string;\n processorId?: string; // used when editing date\n};\n\nexport type Plan = {\n token: string;\n amount: number;\n currency: string;\n start_date: string; // UTC\n is_test: boolean;\n btdata: BtData;\n oldAmount?: number;\n oldDate?: string;\n oldPaymentMethod?: string;\n isCancelled?: boolean;\n};\n\nexport class MonthlyPlan {\n plan: Plan;\n\n currency: string;\n\n payment: BtData;\n\n constructor(plan: Plan) {\n this.plan = plan;\n this.payment = plan.btdata;\n this.currency = plan.currency ?? 'USD'; // not in data\n }\n\n get id(): string {\n // use token as unique id\n return this.plan.token;\n }\n\n get currencySymbol(): string {\n return this.currency === 'USD' ? '$' : '';\n }\n\n get amount(): number {\n return this.plan.amount;\n }\n\n setAmount(newAmount: number) {\n this.plan.oldAmount = this.plan.amount;\n this.plan.amount = newAmount;\n }\n\n get nextBillingDate(): string {\n // iso08601 date string\n return this.payment.nextBillingDate.date;\n }\n\n setNextBillingDate(newDate: string) {\n // iso08601 date string\n this.payment.nextBillingDate.oldDate = this.payment.nextBillingDate.date;\n this.payment.nextBillingDate.date = newDate;\n }\n\n get nextBillingDateLocale(): string {\n const nextBillingDate = new Date(\n this.payment.nextBillingDate.date\n ).toLocaleDateString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n\n return nextBillingDate ?? 'not found';\n }\n\n get lastBillingDateLocale(): string {\n const lastBillingDate = new Date(\n this.payment.lastBillingDate.date\n ).toLocaleDateString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n\n console.log('lastBillingDate from model', lastBillingDate);\n\n return lastBillingDate ?? 'not found';\n }\n\n get hasBeenCancelled(): boolean {\n return this.plan.isCancelled === true;\n }\n\n get isTest(): boolean {\n return this.plan.is_test;\n }\n\n cancelPlan(): void {\n this.plan.isCancelled = true;\n }\n}\n\n/*\n\n{\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtYWlsc3luYyIsImlhdCI6MTczODYxNTY3NS41ODA4MTcsIm5iZiI6MTczODYxNTYxNS41ODA4MTcsImV4cCI6MTczODYxNjI3NS41ODA4MTcsImtleSI6eyJwaWQiOiJkd2NrN20iLCJjaWQiOjgwMzUzOCwiYW1vdW50Ijo1LCJwYXltZW50TWV0aG9kVG9rZW4iOiJxMXllYndoaiIsImN1c3RvbWVySWQiOiI4NTQ2MTk4MzUifSwidXNlciI6IkBpc2EtYXQtdGhlLWFyY2hpdmUifQ.TYlkU1ZZLHmj2ahrkTV7JGLmpCPN4BcOeDFPiXVj0pM\",\n \"amount\": 5,\n \"currency\": \"USD\",\n \"start_date\": \"2022-12-09 00:00:00\",\n \"contribution_status_id\": 5,\n \"is_test\": true,\n \"btdata\": {\n \"billingDayOfMonth\": 9,\n \"nextBillingDate\": {\n \"date\": \"2025-02-09 00:00:00.000000\",\n \"timezone_type\": 3,\n \"timezone\": \"UTC\"\n },\n \"status\": \"Active\",\n \"paymentMethodType\": \"creditCard\",\n \"last4\": \"1111\",\n \"cardType\": \"Visa\",\n \"expirationMonth\": \"12\",\n \"expirationYear\": \"2023\"\n }\n}\n */\n"]}
@@ -1,4 +1,4 @@
1
- declare type AReceipt = {
1
+ export declare type AReceipt = {
2
2
  currency: string;
3
3
  net_amount: number;
4
4
  total_amount: number;
@@ -7,6 +7,7 @@ declare type AReceipt = {
7
7
  date: string;
8
8
  isTest: boolean;
9
9
  token: string;
10
+ id?: string;
10
11
  };
11
12
  export declare class Receipt {
12
13
  receipt: AReceipt;
@@ -18,4 +19,3 @@ export declare class Receipt {
18
19
  get date(): string;
19
20
  get currencySymbol(): string;
20
21
  }
21
- export {};
@@ -1 +1 @@
1
- {"version":3,"file":"receipt.js","sourceRoot":"","sources":["../../../src/models/receipt.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,OAAO;IAGlB,YAAY,OAAiB;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAI,eAAe;;QACjB,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;QACnE,MAAM,YAAY,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,mCAAI,gBAAgB,CAAC;QAC/D,IAAI,KAAK,EAAE;YACT,OAAO,GAAG,YAAY,IAAI,IAAI,CAAC,cAAc,GAAG,KAAK,EAAE,CAAC;SACzD;QACD,OAAO,wDAAwD,CAAC;IAClE,CAAC;IAED,IAAI,MAAM;;QACR,OAAO,CACL,MAAA,MAAA,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,mCAC9B,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,mCAC5B,wDAAwD,CACzD,CAAC;IACJ,CAAC;IAED,IAAI,MAAM;;QACR,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,MAAM,mCAAI,KAAK,CAAC;IACtC,CAAC;IAED,IAAI,EAAE;;QACJ,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,KAAK,mCAAI,gBAAgB,CAAC;IAChD,CAAC;IAED,IAAI,IAAI;;QACN,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,IAAI,mCAAI,eAAe,CAAC;IAC9C,CAAC;IAED,IAAI,cAAc;QAChB,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE;YACnC,OAAO,GAAG,CAAC;SACZ;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["type AReceipt = {\n currency: string;\n net_amount: number;\n total_amount: number;\n fee_amount: number;\n receive_date?: Date;\n date: string;\n isTest: boolean;\n token: string;\n};\nexport class Receipt {\n receipt: AReceipt;\n\n constructor(receipt: AReceipt) {\n this.receipt = receipt;\n }\n\n get amountFormatted(): string {\n const value = this.receipt.total_amount ?? this.receipt.net_amount;\n const currencyType = this.receipt.currency ?? 'CURR not found';\n if (value) {\n return `${currencyType} ${this.currencySymbol}${value}`;\n }\n return \"no amount found, can't find total_amount or net_amount\";\n }\n\n get amount(): string {\n return (\n `${this.receipt.total_amount}` ??\n `${this.receipt.net_amount}` ??\n \"no amount found, can't find total_amount or net_amount\"\n );\n }\n\n get isTest(): boolean {\n return this.receipt.isTest ?? false;\n }\n\n get id(): string {\n return this.receipt.token ?? 'no token found';\n }\n\n get date(): string {\n return this.receipt.date ?? 'no date found';\n }\n\n get currencySymbol(): string {\n if (this.receipt.currency === 'USD') {\n return '$';\n }\n\n return '';\n }\n}\n"]}
1
+ {"version":3,"file":"receipt.js","sourceRoot":"","sources":["../../../src/models/receipt.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,OAAO;IAGlB,YAAY,OAAiB;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAI,eAAe;;QACjB,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;QACnE,MAAM,YAAY,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,mCAAI,gBAAgB,CAAC;QAC/D,IAAI,KAAK,EAAE;YACT,OAAO,GAAG,YAAY,IAAI,IAAI,CAAC,cAAc,GAAG,KAAK,EAAE,CAAC;SACzD;QACD,OAAO,wDAAwD,CAAC;IAClE,CAAC;IAED,IAAI,MAAM;;QACR,OAAO,CACL,MAAA,MAAA,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,mCAC9B,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,mCAC5B,wDAAwD,CACzD,CAAC;IACJ,CAAC;IAED,IAAI,MAAM;;QACR,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,MAAM,mCAAI,KAAK,CAAC;IACtC,CAAC;IAED,IAAI,EAAE;;QACJ,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,KAAK,mCAAI,gBAAgB,CAAC;IAChD,CAAC;IAED,IAAI,IAAI;;QACN,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,IAAI,mCAAI,eAAe,CAAC;IAC9C,CAAC;IAED,IAAI,cAAc;QAChB,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE;YACnC,OAAO,GAAG,CAAC;SACZ;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["export type AReceipt = {\n currency: string;\n net_amount: number;\n total_amount: number;\n fee_amount: number;\n receive_date?: Date;\n date: string;\n isTest: boolean;\n token: string;\n id?: string;\n};\nexport class Receipt {\n receipt: AReceipt;\n\n constructor(receipt: AReceipt) {\n this.receipt = receipt;\n }\n\n get amountFormatted(): string {\n const value = this.receipt.total_amount ?? this.receipt.net_amount;\n const currencyType = this.receipt.currency ?? 'CURR not found';\n if (value) {\n return `${currencyType} ${this.currencySymbol}${value}`;\n }\n return \"no amount found, can't find total_amount or net_amount\";\n }\n\n get amount(): string {\n return (\n `${this.receipt.total_amount}` ??\n `${this.receipt.net_amount}` ??\n \"no amount found, can't find total_amount or net_amount\"\n );\n }\n\n get isTest(): boolean {\n return this.receipt.isTest ?? false;\n }\n\n get id(): string {\n return this.receipt.token ?? 'no token found';\n }\n\n get date(): string {\n return this.receipt.date ?? 'no date found';\n }\n\n get currencySymbol(): string {\n if (this.receipt.currency === 'USD') {\n return '$';\n }\n\n return '';\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/donation-monthly-portal",
3
- "version": "7.0.2",
3
+ "version": "7.0.3",
4
4
  "description": "The Internet Archive Monthly Portal",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "dist/index.js",
@@ -1,4 +1,4 @@
1
- type BtData = {
1
+ export type BtData = {
2
2
  billingDayOfMonth: number;
3
3
  nextBillingDate: {
4
4
  date: string;
@@ -19,9 +19,10 @@ type BtData = {
19
19
  expirationYear: string | null;
20
20
  paypalEmail?: string;
21
21
  venmoUsername?: string;
22
+ processorId?: string; // used when editing date
22
23
  };
23
24
 
24
- type Plan = {
25
+ export type Plan = {
25
26
  token: string;
26
27
  amount: number;
27
28
  currency: string;
@@ -1,4 +1,4 @@
1
- type AReceipt = {
1
+ export type AReceipt = {
2
2
  currency: string;
3
3
  net_amount: number;
4
4
  total_amount: number;
@@ -7,6 +7,7 @@ type AReceipt = {
7
7
  date: string;
8
8
  isTest: boolean;
9
9
  token: string;
10
+ id?: string;
10
11
  };
11
12
  export class Receipt {
12
13
  receipt: AReceipt;