@cheqd/studio 3.17.0-develop.6 → 3.17.0-develop.7

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,48 @@
1
+ export declare const CURRENT_SUBSCRIPTION_STATUSES: readonly ["active", "trialing", "past_due", "unpaid", "paused"];
2
+ export type CurrentSubscriptionStatus = (typeof CURRENT_SUBSCRIPTION_STATUSES)[number];
3
+ export type MigrationAction = 'update' | 'create' | 'noop' | 'blocked';
4
+ export type MigrationTarget = 'basic' | 'build';
5
+ export interface MigrationSubscriptionItem {
6
+ id: string;
7
+ priceId: string;
8
+ productId: string;
9
+ }
10
+ export interface MigrationSubscription {
11
+ id: string;
12
+ customerId: string;
13
+ status: CurrentSubscriptionStatus;
14
+ created: number;
15
+ collectionMethod: 'charge_automatically' | 'send_invoice';
16
+ cancelAtPeriodEnd: boolean;
17
+ hasDiscount: boolean;
18
+ scheduleId?: string;
19
+ items: MigrationSubscriptionItem[];
20
+ }
21
+ export interface MigrationProducts {
22
+ explorerProductId: string;
23
+ basicProductId: string;
24
+ basicPriceId: string;
25
+ buildProductId: string;
26
+ buildPriceId: string;
27
+ }
28
+ export interface CustomerMigrationPlan {
29
+ customerId: string;
30
+ action: MigrationAction;
31
+ target: MigrationTarget;
32
+ targetProductId: string;
33
+ targetPriceId: string;
34
+ sourceSubscriptionId: string;
35
+ sourceSubscriptionItemId?: string;
36
+ sourceStatus: CurrentSubscriptionStatus;
37
+ currentProductIds: string[];
38
+ secondarySubscriptionIds: string[];
39
+ clearExistingDiscount: boolean;
40
+ reason: string;
41
+ }
42
+ export interface MigrationPlanningOptions {
43
+ clearExistingDiscounts?: boolean;
44
+ }
45
+ export declare function isCurrentSubscriptionStatus(status: string): status is CurrentSubscriptionStatus;
46
+ export declare function addOneCalendarMonth(date: Date): Date;
47
+ export declare function buildCustomerMigrationPlan(subscriptions: MigrationSubscription[], products: MigrationProducts, options?: MigrationPlanningOptions): CustomerMigrationPlan;
48
+ //# sourceMappingURL=subscription-migration-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-migration-plan.d.ts","sourceRoot":"","sources":["../../../src/services/admin/subscription-migration-plan.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,iEAAkE,CAAC;AAE7G,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AACvF,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AACvE,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhD,MAAM,WAAW,yBAAyB;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yBAAyB,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,sBAAsB,GAAG,cAAc,CAAC;IAC1D,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,yBAAyB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,YAAY,EAAE,yBAAyB,CAAC;IACxC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB;IACxC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACjC;AAuDD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,yBAAyB,CAE/F;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAiBpD;AAED,wBAAgB,0BAA0B,CACzC,aAAa,EAAE,qBAAqB,EAAE,EACtC,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE,wBAA6B,GACpC,qBAAqB,CA6EvB"}
@@ -0,0 +1,111 @@
1
+ export const CURRENT_SUBSCRIPTION_STATUSES = ['active', 'trialing', 'past_due', 'unpaid', 'paused'];
2
+ const STATUS_RANK = {
3
+ active: 0,
4
+ trialing: 1,
5
+ past_due: 2,
6
+ unpaid: 3,
7
+ paused: 4,
8
+ };
9
+ function targetAffinity(subscription, target, products) {
10
+ const targetProductId = target === 'basic' ? products.basicProductId : products.buildProductId;
11
+ const targetPriceId = target === 'basic' ? products.basicPriceId : products.buildPriceId;
12
+ if (subscription.items.some((item) => item.productId === targetProductId && item.priceId === targetPriceId)) {
13
+ return 0;
14
+ }
15
+ if (subscription.items.some((item) => item.productId === targetProductId)) {
16
+ return 1;
17
+ }
18
+ if (target === 'build' &&
19
+ subscription.items.some((item) => item.productId !== products.explorerProductId && item.productId !== products.basicProductId)) {
20
+ return 2;
21
+ }
22
+ return 3;
23
+ }
24
+ function selectCanonicalSubscription(subscriptions, target, products) {
25
+ return [...subscriptions].sort((left, right) => {
26
+ const affinityDifference = targetAffinity(left, target, products) - targetAffinity(right, target, products);
27
+ if (affinityDifference !== 0)
28
+ return affinityDifference;
29
+ const statusDifference = STATUS_RANK[left.status] - STATUS_RANK[right.status];
30
+ if (statusDifference !== 0)
31
+ return statusDifference;
32
+ if (left.created !== right.created)
33
+ return right.created - left.created;
34
+ return left.id.localeCompare(right.id);
35
+ })[0];
36
+ }
37
+ export function isCurrentSubscriptionStatus(status) {
38
+ return CURRENT_SUBSCRIPTION_STATUSES.some((candidate) => candidate === status);
39
+ }
40
+ export function addOneCalendarMonth(date) {
41
+ const year = date.getUTCFullYear();
42
+ const month = date.getUTCMonth();
43
+ const day = date.getUTCDate();
44
+ const lastDayOfTargetMonth = new Date(Date.UTC(year, month + 2, 0)).getUTCDate();
45
+ return new Date(Date.UTC(year, month + 1, Math.min(day, lastDayOfTargetMonth), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds()));
46
+ }
47
+ export function buildCustomerMigrationPlan(subscriptions, products, options = {}) {
48
+ if (subscriptions.length === 0) {
49
+ throw new Error('At least one current subscription is required');
50
+ }
51
+ const customerIds = new Set(subscriptions.map((subscription) => subscription.customerId));
52
+ if (customerIds.size !== 1) {
53
+ throw new Error('All subscriptions in a customer plan must belong to the same customer');
54
+ }
55
+ const currentProductIds = Array.from(new Set(subscriptions.flatMap((subscription) => subscription.items.map((item) => item.productId)))).sort();
56
+ const hasNonExplorerPlan = currentProductIds.some((productId) => productId !== products.explorerProductId && productId !== products.basicProductId);
57
+ const target = hasNonExplorerPlan ? 'build' : 'basic';
58
+ const targetProductId = target === 'basic' ? products.basicProductId : products.buildProductId;
59
+ const targetPriceId = target === 'basic' ? products.basicPriceId : products.buildPriceId;
60
+ const source = selectCanonicalSubscription(subscriptions, target, products);
61
+ const sourceItem = source.items[0];
62
+ const basePlan = {
63
+ customerId: source.customerId,
64
+ target,
65
+ targetProductId,
66
+ targetPriceId,
67
+ sourceSubscriptionId: source.id,
68
+ sourceSubscriptionItemId: sourceItem?.id,
69
+ sourceStatus: source.status,
70
+ currentProductIds,
71
+ secondarySubscriptionIds: subscriptions
72
+ .filter((subscription) => subscription.id !== source.id)
73
+ .map((subscription) => subscription.id)
74
+ .sort(),
75
+ clearExistingDiscount: false,
76
+ };
77
+ if (source.items.length !== 1) {
78
+ return { ...basePlan, action: 'blocked', reason: 'canonical_subscription_must_have_exactly_one_item' };
79
+ }
80
+ if (source.scheduleId) {
81
+ return { ...basePlan, action: 'blocked', reason: 'canonical_subscription_is_managed_by_a_schedule' };
82
+ }
83
+ const alreadyOnTarget = sourceItem.productId === targetProductId && sourceItem.priceId === targetPriceId;
84
+ if (alreadyOnTarget && source.status !== 'paused' && !source.cancelAtPeriodEnd) {
85
+ return { ...basePlan, action: 'noop', reason: 'already_on_target_monthly_price' };
86
+ }
87
+ if (source.hasDiscount && !options.clearExistingDiscounts) {
88
+ return { ...basePlan, action: 'blocked', reason: 'canonical_subscription_has_a_discount' };
89
+ }
90
+ if (source.status === 'paused') {
91
+ return {
92
+ ...basePlan,
93
+ action: 'create',
94
+ clearExistingDiscount: source.hasDiscount,
95
+ reason: 'replace_paused_subscription_with_trialing_subscription',
96
+ };
97
+ }
98
+ if (source.collectionMethod !== 'charge_automatically') {
99
+ return { ...basePlan, action: 'blocked', reason: 'canonical_subscription_does_not_charge_automatically' };
100
+ }
101
+ if (source.status === 'unpaid') {
102
+ return { ...basePlan, action: 'blocked', reason: 'canonical_subscription_is_unpaid' };
103
+ }
104
+ return {
105
+ ...basePlan,
106
+ action: 'update',
107
+ clearExistingDiscount: source.hasDiscount,
108
+ reason: alreadyOnTarget ? 'remove_scheduled_cancellation_and_start_trial' : 'move_to_target_monthly_price',
109
+ };
110
+ }
111
+ //# sourceMappingURL=subscription-migration-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-migration-plan.js","sourceRoot":"","sources":["../../../src/services/admin/subscription-migration-plan.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,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Y="sk_zzz..."
55
55
  STRIPE_BUILD_PLAN_ID="prod....5H"
56
56
  STRIPE_BASIC_PLAN_ID="prod....BA"
57
+ STRIPE_EXPLORER_PLAN_ID="prod....ER"
57
58
  STRIPE_TEST_PLAN_ID="prod....ST"
59
+ # Guard used only by the one-off Stripe plan migration script
60
+ STRIPE_MIGRATION_EXPECTED_ACCOUNT_ID="acct_..."
58
61
 
59
62
  # Verida
60
63
  ENABLE_VERIDA_CONNECTOR="false"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cheqd/studio",
3
- "version": "3.17.0-develop.6",
3
+ "version": "3.17.0-develop.7",
4
4
  "description": "cheqd Studio Backend",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -37,7 +37,8 @@
37
37
  "typeorm": "typeorm-ts-node-esm -d ./dist/database/ormconfig.js",
38
38
  "add:to:types": "tsx src/database/scripts/add-migration-to-types.ts",
39
39
  "generate": "npm run typeorm migration:generate ./src/database/migrations/studio-migrations && npm run add:to:types",
40
- "migrate": "npm run typeorm migration:run"
40
+ "migrate": "npm run typeorm migration:run",
41
+ "migrate:stripe-plans": "tsx scripts/migrate-studio-plans.ts"
41
42
  },
42
43
  "eslintConfig": {
43
44
  "root": true,