@logto/cloud 0.2.5-4f1d80b → 0.2.5-8065345

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,16 +24,33 @@ 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").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
  };
@@ -41,92 +59,19 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
41
59
  id: string;
42
60
  name: string;
43
61
  indicator: string;
62
+ planId: string;
44
63
  tag: TenantTag;
45
- subscriptionPlan: {
46
- id: string;
47
- name: string;
48
- quota: {
49
- mauLimit: number | null;
50
- applicationsLimit: number;
51
- machineToMachineLimit: number;
52
- resourcesLimit: number;
53
- scopesPerResourceLimit: number;
54
- customDomainEnabled: boolean;
55
- omniSignInEnabled: boolean;
56
- builtInEmailConnectorEnabled: boolean;
57
- socialConnectorsLimit: number | null;
58
- standardConnectorsLimit: number;
59
- rolesLimit: number;
60
- scopesPerRoleLimit: number | null;
61
- hooksLimit: number;
62
- auditLogsRetentionDays: number;
63
- };
64
- stripeProducts: {
65
- description?: string | undefined;
66
- id: string;
67
- name: string;
68
- type: "flat" | "tier1" | "tier2" | "tier3";
69
- price: {
70
- quantity?: 1 | undefined;
71
- unitAmount?: number | null | undefined;
72
- id: string;
73
- unitAmountDecimal: string;
74
- };
75
- }[];
76
- createdAt: Date;
77
- updatedAt: Date;
78
- };
79
64
  }[]>;
80
- } & {
81
- "/tenants/my": import("@withtyped/server").PathGuard<"/my", unknown, unknown, {
82
- id: string;
83
- name: string;
84
- indicator: string;
85
- tag: TenantTag;
86
- subscriptionPlan: {
87
- id: string;
88
- name: string;
89
- quota: {
90
- mauLimit: number | null;
91
- applicationsLimit: number;
92
- machineToMachineLimit: number;
93
- resourcesLimit: number;
94
- scopesPerResourceLimit: number;
95
- customDomainEnabled: boolean;
96
- omniSignInEnabled: boolean;
97
- builtInEmailConnectorEnabled: boolean;
98
- socialConnectorsLimit: number | null;
99
- standardConnectorsLimit: number;
100
- rolesLimit: number;
101
- scopesPerRoleLimit: number | null;
102
- hooksLimit: number;
103
- auditLogsRetentionDays: number;
104
- };
105
- stripeProducts: {
106
- description?: string | undefined;
107
- id: string;
108
- name: string;
109
- type: "flat" | "tier1" | "tier2" | "tier3";
110
- price: {
111
- quantity?: 1 | undefined;
112
- unitAmount?: number | null | undefined;
113
- id: string;
114
- unitAmountDecimal: string;
115
- };
116
- }[];
117
- createdAt: Date;
118
- updatedAt: Date;
119
- };
120
- }>;
121
65
  };
122
66
  post: {
123
67
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
124
68
  name?: string | undefined;
125
69
  tag?: TenantTag | undefined;
126
70
  }, {
127
- name: string;
128
71
  id: string;
72
+ name: string;
129
73
  indicator: string;
74
+ planId: string;
130
75
  tag: TenantTag;
131
76
  }>;
132
77
  };
@@ -136,13 +81,70 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
136
81
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
137
82
  };
138
83
  copy: {};
84
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
85
+ options: {};
86
+ patch: {};
87
+ get: {
88
+ "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
89
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
90
+ planId: string;
91
+ currentPeriodStart: Date;
92
+ currentPeriodEnd: Date;
93
+ }>;
94
+ } & {
95
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
96
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
97
+ planId: string;
98
+ currentPeriodStart: Date;
99
+ currentPeriodEnd: Date;
100
+ }>;
101
+ } & {
102
+ "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
103
+ invoices: {
104
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
105
+ createdAt: Date;
106
+ id: string;
107
+ updatedAt: Date;
108
+ customerId: string | null;
109
+ billingReason: string | null;
110
+ periodStart: Date;
111
+ periodEnd: Date;
112
+ amountDue: number;
113
+ amountPaid: number;
114
+ subscriptionId: string | null;
115
+ hostedInvoiceUrl: string | null;
116
+ invoicePdf: string | null;
117
+ planName: string | null;
118
+ }[];
119
+ }>;
120
+ } & {
121
+ "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
122
+ activeUsers: number;
123
+ cost: number;
124
+ }>;
125
+ };
126
+ post: {
127
+ "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
128
+ callbackUrl?: string | undefined;
129
+ }, {
130
+ redirectUri: string;
131
+ }>;
132
+ };
133
+ put: {};
134
+ head: {};
135
+ delete: {
136
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
137
+ };
138
+ copy: {};
139
139
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
140
140
  options: {};
141
141
  patch: {};
142
142
  get: {
143
143
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
144
144
  from?: string | undefined;
145
- }, unknown, unknown>;
145
+ }, unknown, {
146
+ count: number;
147
+ }>;
146
148
  };
147
149
  post: {
148
150
  "/services/send-email": import("@withtyped/server").PathGuard<"/send-email", unknown, {
@@ -193,6 +195,7 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
193
195
  patch: {};
194
196
  get: {
195
197
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
198
+ createdAt: Date;
196
199
  id: string;
197
200
  name: string;
198
201
  quota: {
@@ -213,9 +216,9 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
213
216
  };
214
217
  stripeProducts: {
215
218
  description?: string | undefined;
219
+ type: "flat" | "tier1" | "tier2" | "tier3";
216
220
  id: string;
217
221
  name: string;
218
- type: "flat" | "tier1" | "tier2" | "tier3";
219
222
  price: {
220
223
  quantity?: 1 | undefined;
221
224
  unitAmount?: number | null | undefined;
@@ -223,7 +226,6 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
223
226
  unitAmountDecimal: string;
224
227
  };
225
228
  }[];
226
- createdAt: Date;
227
229
  updatedAt: Date;
228
230
  }[]>;
229
231
  };
@@ -235,15 +237,90 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
235
237
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
236
238
  options: {};
237
239
  patch: {};
238
- get: {};
240
+ get: {
241
+ "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
242
+ status: "open" | "complete" | "expired";
243
+ createdAt: Date;
244
+ id: string;
245
+ userId: string;
246
+ updatedAt: Date;
247
+ tenantId: string | null;
248
+ planId: string;
249
+ }>;
250
+ };
239
251
  post: {
240
252
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
241
253
  tenantId?: string | undefined;
254
+ tenantTag?: TenantTag | undefined;
255
+ tenantName?: string | undefined;
242
256
  cancelCallbackUrl?: string | undefined;
243
257
  planId: string;
244
258
  successCallbackUrl: string;
259
+ }, {
260
+ redirectUri?: string | null | undefined;
261
+ sessionId: string;
262
+ }>;
263
+ };
264
+ put: {};
265
+ head: {};
266
+ delete: {};
267
+ copy: {};
268
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
269
+ options: {};
270
+ patch: {};
271
+ get: {
272
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
273
+ };
274
+ post: {
275
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
276
+ name: string;
277
+ }, {
278
+ createdAt: Date;
279
+ id: string;
280
+ name: string;
281
+ }>;
282
+ } & {
283
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
284
+ value: string;
285
+ type: "hostname" | "query";
286
+ }, {
287
+ value: string;
288
+ type: "hostname" | "query";
289
+ createdAt: Date;
290
+ affiliateId: string;
291
+ }>;
292
+ };
293
+ put: {};
294
+ head: {};
295
+ delete: {
296
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
297
+ value: string;
298
+ type: "hostname" | "query";
245
299
  }, unknown>;
246
300
  };
301
+ copy: {};
302
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
303
+ options: {};
304
+ patch: {};
305
+ get: {};
306
+ post: {
307
+ "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
308
+ hostname?: string | undefined;
309
+ query?: string | undefined;
310
+ createdAt: string;
311
+ userId: string;
312
+ }, {
313
+ createdAt: Date;
314
+ id: string;
315
+ affiliateId: string | null;
316
+ userId: string;
317
+ createdVia: {
318
+ hostname?: string | undefined;
319
+ query?: string | undefined;
320
+ createdAt: string;
321
+ };
322
+ }>;
323
+ };
247
324
  put: {};
248
325
  head: {};
249
326
  delete: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-4f1d80b",
3
+ "version": "0.2.5-8065345",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -38,6 +38,9 @@
38
38
  },
39
39
  "eslintConfig": {
40
40
  "extends": "@silverhand",
41
+ "rules": {
42
+ "no-console": "error"
43
+ },
41
44
  "ignorePatterns": [
42
45
  "types.test.ts"
43
46
  ]