picgo 3.1.0 → 3.2.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.
@@ -6,10 +6,11 @@ import type { CloudBillingOverview, CloudUsage, ICloudUserInfo } from '../../../
6
6
  * 使用方式(PicGo desktop 主进程会读到 process.env):
7
7
  * PICGO_MOCK_LIFECYCLE=grace pnpm dev
8
8
  *
9
- * 可选值:active-pro | active-pro-yearly | active-grant | grace | frozen | pending-cleanup
9
+ * 可选值:active-pro | active-pro-yearly | active-pro-cancel | active-grant | active-grant-lifetime | grace | frozen | pending-cleanup | redemption-stacked | redemption-stacked-long | subscription-with-redemption | subscription-ended-with-redemption | subscription-pending
10
10
  * 取消 mock:unset PICGO_MOCK_LIFECYCLE
11
11
  */
12
- export type MockLifecycleScenario = 'active-pro' | 'active-pro-yearly' | 'active-pro-cancel' | 'active-grant' | 'active-grant-lifetime' | 'grace' | 'frozen' | 'pending-cleanup';
12
+ export type MockLifecycleScenario = 'active-pro' | 'active-pro-yearly' | 'active-pro-cancel' | 'active-grant' | 'active-grant-lifetime' | 'grace' | 'frozen' | 'pending-cleanup' | 'redemption-stacked' | 'redemption-stacked-long' | 'subscription-with-redemption' | 'subscription-ended-with-redemption' | 'subscription-pending';
13
+ export declare const ALL_MOCK_SCENARIOS: readonly MockLifecycleScenario[];
13
14
  export declare function getMockScenario(): MockLifecycleScenario | undefined;
14
15
  export declare function buildMockOverview(scenario: MockLifecycleScenario): CloudBillingOverview;
15
16
  export declare function buildMockUsage(scenario: MockLifecycleScenario, appType: 'gui' | 'cli'): CloudUsage;
@@ -108,6 +108,8 @@ export type CloudBillingPlanInfo = {
108
108
  capability: string;
109
109
  /** 订阅计费周期类型:'monthly' / 'yearly' / null(免费用户)。 */
110
110
  billingPeriod: string | null;
111
+ /** 订阅来源的 plan code;与限时会员同时存在时,订阅那一行用它展示自己的档位。旧服务端不下发。 */
112
+ subscription?: string;
111
113
  source: 'entitlement' | 'admin_grant' | 'both' | 'free';
112
114
  };
113
115
  export type CloudLifecyclePhase = 'active' | 'grace' | 'frozen' | 'pending_cleanup';
@@ -130,14 +132,54 @@ export type CloudLifecycleInfo = {
130
132
  currentPhaseEndsAt: string | null;
131
133
  flags: CloudLifecycleFlags;
132
134
  };
135
+ /**
136
+ * 服务端由 raw status + 账期终点派生的订阅有效状态。客户端判断续费 / 取消 / 已结束只看它,
137
+ * raw `status` 仅用于展示与排错。
138
+ */
139
+ export declare enum CloudSubscriptionStanding {
140
+ Live = "live",
141
+ Ending = "ending",
142
+ Ended = "ended",
143
+ None = "none"
144
+ }
133
145
  export type CloudSubscriptionInfo = {
134
146
  status: string;
147
+ /** 旧服务端不下发。 */
148
+ standing?: CloudSubscriptionStanding;
135
149
  currentPeriodEnd: string | null;
136
150
  };
151
+ export declare enum CloudFixedTermSource {
152
+ Redemption = "redemption",
153
+ Admin = "admin",
154
+ Purchase = "purchase"
155
+ }
156
+ /** 当前生效的一种限时会员来源(兑换 / 赠送 / 买断),不会自动续费,可与订阅同时计时。 */
157
+ export type CloudFixedTerm = {
158
+ source: CloudFixedTermSource;
159
+ /** 该来源当前生效的 plan code(多段兑换时即当前这一段)。 */
160
+ plan: string;
161
+ /** 该来源的结束时间;兑换来源为整条叠加时间线的终点。 */
162
+ endsAt: string;
163
+ daysRemaining: number;
164
+ };
165
+ /** 叠加兑换里排在当前这一段之后的一段,按消耗顺序排列。 */
166
+ export type CloudRedemptionSegment = {
167
+ plan: string;
168
+ startsAt: string;
169
+ endsAt: string;
170
+ };
137
171
  export type CloudBillingOverview = {
138
172
  plan: CloudBillingPlanInfo;
139
173
  lifecycle: CloudLifecycleInfo;
140
174
  subscription: CloudSubscriptionInfo | null;
175
+ /** 排在当前兑换段之后的兑换段;旧服务端不下发时为空数组。 */
176
+ redemptionQueue: CloudRedemptionSegment[];
177
+ /** 当前生效的限时会员,每种来源一条;旧服务端不下发时为空数组。 */
178
+ fixedTerms: CloudFixedTerm[];
179
+ /** 已付款但订阅记录尚未由 webhook 写入时,该订阅的 plan;否则为 null。 */
180
+ pendingSubscription: {
181
+ plan: string;
182
+ } | null;
141
183
  };
142
184
  export type ImportResult = {
143
185
  total: number;
@@ -89,6 +89,8 @@ export declare const handleUnixStylePath: (pathStr: string) => string;
89
89
  * remove plugin version when register plugin name
90
90
  * 1. picgo-plugin-xxx@1.0.0 -> picgo-plugin-xxx
91
91
  * 2. @xxx/picgo-plugin-xxx@1.0.0 -> @xxx/picgo-plugin-xxx
92
+ * 3. picgo-plugin-xxx-yyy@latest -> picgo-plugin-xxx-yyy
93
+ * 4. @xxx/picgo-plugin-xxx-yyy -> @xxx/picgo-plugin-xxx-yyy
92
94
  * @param nameOrPath
93
95
  * @param scope
94
96
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picgo",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "packageManager": "pnpm@11.7.0",
5
5
  "description": "A tool for image uploading",
6
6
  "main": "dist/index.cjs.js",