@logto/cloud 0.2.5-4d5e389 → 0.2.5-70aa370

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.
@@ -1,6 +1,7 @@
1
1
  // Generated by dts-bundle-generator v8.0.1
2
2
 
3
3
  import { RequestContext } from '@withtyped/server';
4
+ import { InferModelType } from '@withtyped/server/model';
4
5
 
5
6
  export type WithAuthContext<Context = RequestContext> = Context & {
6
7
  auth: {
@@ -23,57 +24,81 @@ declare enum VerificationCodeType {
23
24
  /** @deprecated Use `Generic` type template for sending test sms/email use case */
24
25
  Test = "Test"
25
26
  }
26
- declare const router: import("@withtyped/server").Router<WithAuthContext, import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
27
+ declare const AffiliateProperties: import("@withtyped/server/model").default<"affiliate_properties", {
28
+ createdAt: Date;
29
+ affiliateId: string;
30
+ type: "hostname" | "query";
31
+ value: string;
32
+ }, "createdAt", "createdAt">;
33
+ export type AffiliateProperty = InferModelType<typeof AffiliateProperties>;
34
+ declare const Affiliates: import("@withtyped/server/model").default<"affiliates", {
35
+ id: string;
36
+ createdAt: Date;
37
+ name: string;
38
+ }, "createdAt" | "id", "createdAt" | "id">;
39
+ export type Affiliate = InferModelType<typeof Affiliates>;
40
+ export type AffiliateData = Affiliate & {
41
+ properties: Array<Pick<AffiliateProperty, "type" | "value">>;
42
+ };
43
+ declare const router: import("@withtyped/server").Router<WithAuthContext, import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
27
44
  options: {};
28
45
  patch: {
29
46
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
30
47
  name?: string | undefined;
31
48
  tag?: TenantTag | undefined;
32
49
  }, {
33
- name: string;
34
50
  id: string;
51
+ name: string;
35
52
  indicator: string;
53
+ planId: string;
36
54
  tag: TenantTag;
37
55
  }>;
38
56
  };
39
57
  get: {
40
58
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
41
- name: string;
42
59
  id: string;
60
+ name: string;
43
61
  indicator: string;
62
+ planId: string;
44
63
  tag: TenantTag;
45
64
  }[]>;
46
65
  } & {
47
66
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
48
- id: string;
49
- status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid";
50
- createdAt: Date;
51
- updatedAt: Date;
52
- tenantId: string;
67
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
53
68
  planId: string;
54
69
  currentPeriodStart: Date;
55
70
  currentPeriodEnd: Date;
56
- customerId: string;
57
- latestInvoiceId: string | null;
58
- canceledAt: Date | null;
59
71
  }>;
60
72
  } & {
61
73
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
62
- id: string;
63
- status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid";
64
- createdAt: Date;
65
- updatedAt: Date;
66
- tenantId: string;
74
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
67
75
  planId: string;
68
76
  currentPeriodStart: Date;
69
77
  currentPeriodEnd: Date;
70
- customerId: string;
71
- latestInvoiceId: string | null;
72
- canceledAt: Date | null;
78
+ }>;
79
+ } & {
80
+ "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
81
+ invoices: {
82
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
83
+ createdAt: Date;
84
+ id: string;
85
+ updatedAt: Date;
86
+ customerId: string | null;
87
+ billingReason: string | null;
88
+ periodStart: Date;
89
+ periodEnd: Date;
90
+ amountDue: number;
91
+ amountPaid: number;
92
+ subscriptionId: string | null;
93
+ hostedInvoiceUrl: string | null;
94
+ invoicePdf: string | null;
95
+ planName: string | null;
96
+ }[];
73
97
  }>;
74
98
  } & {
75
99
  "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
76
100
  activeUsers: number;
101
+ cost: number;
77
102
  }>;
78
103
  };
79
104
  post: {
@@ -81,15 +106,24 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
81
106
  name?: string | undefined;
82
107
  tag?: TenantTag | undefined;
83
108
  }, {
84
- name: string;
85
109
  id: string;
110
+ name: string;
86
111
  indicator: string;
112
+ planId: string;
87
113
  tag: TenantTag;
88
114
  }>;
115
+ } & {
116
+ "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
117
+ callbackUrl?: string | undefined;
118
+ } | undefined, {
119
+ redirectUri: string;
120
+ }>;
89
121
  };
90
122
  put: {};
91
123
  head: {};
92
124
  delete: {
125
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
126
+ } & {
93
127
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
94
128
  };
95
129
  copy: {};
@@ -99,7 +133,9 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
99
133
  get: {
100
134
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
101
135
  from?: string | undefined;
102
- }, unknown, unknown>;
136
+ }, unknown, {
137
+ count: number;
138
+ }>;
103
139
  };
104
140
  post: {
105
141
  "/services/send-email": import("@withtyped/server").PathGuard<"/send-email", unknown, {
@@ -150,6 +186,7 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
150
186
  patch: {};
151
187
  get: {
152
188
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
189
+ createdAt: Date;
153
190
  id: string;
154
191
  name: string;
155
192
  quota: {
@@ -170,9 +207,9 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
170
207
  };
171
208
  stripeProducts: {
172
209
  description?: string | undefined;
210
+ type: "flat" | "tier1" | "tier2" | "tier3";
173
211
  id: string;
174
212
  name: string;
175
- type: "flat" | "tier1" | "tier2" | "tier3";
176
213
  price: {
177
214
  quantity?: 1 | undefined;
178
215
  unitAmount?: number | null | undefined;
@@ -180,7 +217,6 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
180
217
  unitAmountDecimal: string;
181
218
  };
182
219
  }[];
183
- createdAt: Date;
184
220
  updatedAt: Date;
185
221
  }[]>;
186
222
  };
@@ -192,15 +228,90 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
192
228
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
193
229
  options: {};
194
230
  patch: {};
195
- get: {};
231
+ get: {
232
+ "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
233
+ status: "open" | "complete" | "expired";
234
+ createdAt: Date;
235
+ id: string;
236
+ userId: string;
237
+ updatedAt: Date;
238
+ tenantId: string | null;
239
+ planId: string;
240
+ }>;
241
+ };
196
242
  post: {
197
243
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
198
244
  tenantId?: string | undefined;
245
+ tenantTag?: TenantTag | undefined;
246
+ tenantName?: string | undefined;
199
247
  cancelCallbackUrl?: string | undefined;
200
248
  planId: string;
201
249
  successCallbackUrl: string;
250
+ }, {
251
+ redirectUri?: string | null | undefined;
252
+ sessionId: string;
253
+ }>;
254
+ };
255
+ put: {};
256
+ head: {};
257
+ delete: {};
258
+ copy: {};
259
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
260
+ options: {};
261
+ patch: {};
262
+ get: {
263
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
264
+ };
265
+ post: {
266
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
267
+ name: string;
268
+ }, {
269
+ createdAt: Date;
270
+ id: string;
271
+ name: string;
272
+ }>;
273
+ } & {
274
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
275
+ value: string;
276
+ type: "hostname" | "query";
277
+ }, {
278
+ value: string;
279
+ type: "hostname" | "query";
280
+ createdAt: Date;
281
+ affiliateId: string;
282
+ }>;
283
+ };
284
+ put: {};
285
+ head: {};
286
+ delete: {
287
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
288
+ value: string;
289
+ type: "hostname" | "query";
202
290
  }, unknown>;
203
291
  };
292
+ copy: {};
293
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
294
+ options: {};
295
+ patch: {};
296
+ get: {};
297
+ post: {
298
+ "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
299
+ hostname?: string | undefined;
300
+ query?: string | undefined;
301
+ createdAt: string;
302
+ userId: string;
303
+ }, {
304
+ createdAt: Date;
305
+ id: string;
306
+ affiliateId: string | null;
307
+ userId: string;
308
+ createdVia: {
309
+ hostname?: string | undefined;
310
+ query?: string | undefined;
311
+ createdAt: string;
312
+ };
313
+ }>;
314
+ };
204
315
  put: {};
205
316
  head: {};
206
317
  delete: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-4d5e389",
3
+ "version": "0.2.5-70aa370",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -41,16 +41,6 @@
41
41
  "rules": {
42
42
  "no-console": "error"
43
43
  },
44
- "overrides": [
45
- {
46
- "files": [
47
- "src/cli/**/*"
48
- ],
49
- "rules": {
50
- "no-console": "off"
51
- }
52
- }
53
- ],
54
44
  "ignorePatterns": [
55
45
  "types.test.ts"
56
46
  ]