@blocklet/payment-js 1.18.29 → 1.18.31

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/lib/index.d.ts CHANGED
@@ -42,6 +42,19 @@ declare const _default: {
42
42
  }>, data?: never) => Promise<import("@blocklet/payment-types").Paginated<import("@blocklet/payment-types").TCustomerExpanded>>;
43
43
  search: (_params: any, data?: never) => Promise<import("@blocklet/payment-types").Paginated<import("@blocklet/payment-types").TCustomerExpanded>>;
44
44
  me: (_params: never, data?: never) => Promise<import("@blocklet/payment-types").TCustomerExpanded>;
45
+ overdueInvoices: (_params: string, data?: never) => Promise<{
46
+ customer: import("sequelize").InferAttributes<import("@blocklet/payment-types").Customer, {
47
+ omit: never;
48
+ }>;
49
+ invoices: import("sequelize").InferAttributes<import("@blocklet/payment-types").Invoice, {
50
+ omit: never;
51
+ }>[];
52
+ summary: Record<string, {
53
+ amount: string;
54
+ currency: import("@blocklet/payment-types").PaymentCurrency;
55
+ method: import("@blocklet/payment-types").PaymentMethod;
56
+ }>;
57
+ }>;
45
58
  };
46
59
  products: {
47
60
  create: (data: Partial<import("sequelize").InferAttributes<import("@blocklet/payment-types").Product, {
@@ -208,6 +221,19 @@ declare const _default: {
208
221
  del: (_params: string, data?: never) => Promise<import("sequelize").InferAttributes<import("@blocklet/payment-types").Subscription, {
209
222
  omit: never;
210
223
  }>>;
224
+ overdueInvoices: (_params: string, data?: never) => Promise<{
225
+ subscription: import("sequelize").InferAttributes<import("@blocklet/payment-types").Subscription, {
226
+ omit: never;
227
+ }>;
228
+ invoices: import("sequelize").InferAttributes<import("@blocklet/payment-types").Invoice, {
229
+ omit: never;
230
+ }>[];
231
+ summary: Record<string, {
232
+ amount: string;
233
+ currency: import("@blocklet/payment-types").PaymentCurrency;
234
+ method: import("@blocklet/payment-types").PaymentMethod;
235
+ }>;
236
+ }>;
211
237
  };
212
238
  subscriptionItems: {
213
239
  create: (data: Partial<import("sequelize").InferAttributes<import("@blocklet/payment-types").SubscriptionItem, {
@@ -277,6 +303,20 @@ declare const _default: {
277
303
  }>, data?: never) => Promise<import("@blocklet/payment-types").Paginated<import("@blocklet/payment-types").TRefundExpanded>>;
278
304
  search: (_params: any, data?: never) => Promise<import("@blocklet/payment-types").Paginated<import("@blocklet/payment-types").TRefundExpanded>>;
279
305
  };
306
+ settings: {
307
+ create: (data: import("./resources/setting").TSettingCreate, params?: never) => Promise<import("sequelize").InferAttributes<import("@blocklet/payment-types").Setting, {
308
+ omit: never;
309
+ }>>;
310
+ retrieve: (_params: string, data?: never) => Promise<import("sequelize").InferAttributes<import("@blocklet/payment-types").Setting, {
311
+ omit: never;
312
+ }>>;
313
+ update: (_params: string, data?: import("./resources/setting").TSettingUpdate) => Promise<import("sequelize").InferAttributes<import("@blocklet/payment-types").Setting, {
314
+ omit: never;
315
+ }>>;
316
+ del: (_params: string, data?: never) => Promise<{
317
+ message: string;
318
+ }>;
319
+ };
280
320
  };
281
321
  export default _default;
282
322
  export * from '@blocklet/payment-types';
package/lib/index.js CHANGED
@@ -30,6 +30,7 @@ const subscription_1 = __importDefault(require("./resources/subscription"));
30
30
  const subscription_item_1 = __importDefault(require("./resources/subscription-item"));
31
31
  const webhook_endpoint_1 = __importDefault(require("./resources/webhook-endpoint"));
32
32
  const refund_1 = __importDefault(require("./resources/refund"));
33
+ const setting_1 = __importDefault(require("./resources/setting"));
33
34
  // auto detect livemode
34
35
  if (process.env.PAYMENT_LIVEMODE) {
35
36
  resource_1.environments.setLivemode(process.env.PAYMENT_LIVEMODE === 'true');
@@ -56,5 +57,6 @@ exports.default = {
56
57
  webhookEndpoints: webhook_endpoint_1.default,
57
58
  environments: resource_1.environments,
58
59
  refunds: refund_1.default,
60
+ settings: setting_1.default,
59
61
  };
60
62
  __exportStar(require("@blocklet/payment-types"), exports);
@@ -1,4 +1,4 @@
1
- import type { Paginated, Pagination, TCustomerExpanded } from '@blocklet/payment-types';
1
+ import type { Paginated, Pagination, PaymentCurrency, PaymentMethod, TCustomerExpanded } from '@blocklet/payment-types';
2
2
  declare const _default: {
3
3
  retrieve: (_params: string, data?: never) => Promise<TCustomerExpanded>;
4
4
  update: (_params: string, data?: Partial<import("sequelize").InferAttributes<import("@blocklet/payment-types").Customer, {
@@ -11,5 +11,18 @@ declare const _default: {
11
11
  }>, data?: never) => Promise<Paginated<TCustomerExpanded>>;
12
12
  search: (_params: any, data?: never) => Promise<Paginated<TCustomerExpanded>>;
13
13
  me: (_params: never, data?: never) => Promise<TCustomerExpanded>;
14
+ overdueInvoices: (_params: string, data?: never) => Promise<{
15
+ customer: import("sequelize").InferAttributes<import("@blocklet/payment-types").Customer, {
16
+ omit: never;
17
+ }>;
18
+ invoices: import("sequelize").InferAttributes<import("@blocklet/payment-types").Invoice, {
19
+ omit: never;
20
+ }>[];
21
+ summary: Record<string, {
22
+ amount: string;
23
+ currency: PaymentCurrency;
24
+ method: PaymentMethod;
25
+ }>;
26
+ }>;
14
27
  };
15
28
  export default _default;
@@ -24,5 +24,9 @@ exports.default = {
24
24
  method: 'GET',
25
25
  path: '/api/customers/me',
26
26
  }),
27
+ overdueInvoices: (0, resource_1.createResourceMethod)({
28
+ method: 'GET',
29
+ path: '/api/customers/{id}/overdue/invoices',
30
+ }),
27
31
  // del: createResourceMethod<TCustomer, never, string>({ method: 'DELETE', path: '/api/customers/{id}' }),
28
32
  };
@@ -0,0 +1,63 @@
1
+ import type { NotificationSetting } from '@blocklet/payment-types';
2
+ export interface BaseSettingCreate {
3
+ mountLocation: string;
4
+ active?: boolean;
5
+ description: string;
6
+ livemode?: boolean;
7
+ componentDid?: string;
8
+ }
9
+ export type DonateSetting = {
10
+ amount?: {
11
+ presets?: string[];
12
+ preset?: string;
13
+ custom: boolean;
14
+ minimum?: string;
15
+ maximum?: string;
16
+ };
17
+ btnText?: string;
18
+ historyType?: 'table' | 'avatar';
19
+ };
20
+ export interface NotificationSettingCreate extends BaseSettingCreate {
21
+ type: 'notification';
22
+ settings: NotificationSetting;
23
+ }
24
+ export interface DonateSettingCreate extends BaseSettingCreate {
25
+ type: 'donate';
26
+ settings: DonateSetting;
27
+ }
28
+ export interface GenericSettingCreate extends BaseSettingCreate {
29
+ type: string;
30
+ settings?: Record<string, any>;
31
+ }
32
+ export type TSettingCreate = NotificationSettingCreate | DonateSettingCreate | GenericSettingCreate;
33
+ export type NotificationSettingUpdate = {
34
+ settings?: Partial<NotificationSetting>;
35
+ active?: boolean;
36
+ description?: string;
37
+ };
38
+ export type DonateSettingUpdate = {
39
+ settings?: Partial<DonateSetting>;
40
+ active?: boolean;
41
+ description?: string;
42
+ };
43
+ export type GenericSettingUpdate = {
44
+ settings?: Record<string, any>;
45
+ active?: boolean;
46
+ description?: string;
47
+ };
48
+ export type TSettingUpdate = NotificationSettingUpdate | DonateSettingUpdate | GenericSettingUpdate;
49
+ declare const _default: {
50
+ create: (data: TSettingCreate, params?: never) => Promise<import("sequelize").InferAttributes<import("@blocklet/payment-types").Setting, {
51
+ omit: never;
52
+ }>>;
53
+ retrieve: (_params: string, data?: never) => Promise<import("sequelize").InferAttributes<import("@blocklet/payment-types").Setting, {
54
+ omit: never;
55
+ }>>;
56
+ update: (_params: string, data?: TSettingUpdate) => Promise<import("sequelize").InferAttributes<import("@blocklet/payment-types").Setting, {
57
+ omit: never;
58
+ }>>;
59
+ del: (_params: string, data?: never) => Promise<{
60
+ message: string;
61
+ }>;
62
+ };
63
+ export default _default;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const resource_1 = require("../resource");
4
+ exports.default = {
5
+ create: (0, resource_1.createResourceCreateMethod)({
6
+ method: 'POST',
7
+ path: '/api/settings',
8
+ }),
9
+ retrieve: (0, resource_1.createResourceMethod)({
10
+ method: 'GET',
11
+ path: '/api/settings/{mountLocationOrId}',
12
+ }),
13
+ update: (0, resource_1.createResourceMethod)({
14
+ method: 'PUT',
15
+ path: '/api/settings/{mountLocationOrId}',
16
+ }),
17
+ del: (0, resource_1.createResourceMethod)({
18
+ method: 'DELETE',
19
+ path: '/api/settings/{mountLocationOrId}',
20
+ }),
21
+ };
@@ -1,5 +1,5 @@
1
1
  import type { OrderItem } from 'sequelize';
2
- import type { Paginated, Pagination, TSubscriptionExpanded } from '@blocklet/payment-types';
2
+ import type { Paginated, Pagination, PaymentCurrency, PaymentMethod, TSubscriptionExpanded } from '@blocklet/payment-types';
3
3
  import type { LiteralUnion } from 'type-fest';
4
4
  type CancelBodyType = {
5
5
  at?: 'now' | 'current_period_end' | 'custom';
@@ -43,5 +43,18 @@ declare const _default: {
43
43
  del: (_params: string, data?: never) => Promise<import("sequelize").InferAttributes<import("@blocklet/payment-types").Subscription, {
44
44
  omit: never;
45
45
  }>>;
46
+ overdueInvoices: (_params: string, data?: never) => Promise<{
47
+ subscription: import("sequelize").InferAttributes<import("@blocklet/payment-types").Subscription, {
48
+ omit: never;
49
+ }>;
50
+ invoices: import("sequelize").InferAttributes<import("@blocklet/payment-types").Invoice, {
51
+ omit: never;
52
+ }>[];
53
+ summary: Record<string, {
54
+ amount: string;
55
+ currency: PaymentCurrency;
56
+ method: PaymentMethod;
57
+ }>;
58
+ }>;
46
59
  };
47
60
  export default _default;
@@ -42,4 +42,8 @@ exports.default = {
42
42
  method: 'DELETE',
43
43
  path: '/api/subscriptions/{id}',
44
44
  }),
45
+ overdueInvoices: (0, resource_1.createResourceMethod)({
46
+ method: 'GET',
47
+ path: '/api/subscriptions/{id}/overdue/invoices',
48
+ }),
45
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-js",
3
- "version": "1.18.29",
3
+ "version": "1.18.31",
4
4
  "description": "Node.js client for Payment Kit",
5
5
  "keywords": [
6
6
  "types",
@@ -36,8 +36,8 @@
36
36
  "url": "https://github.com/blocklet/payment-kit/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@blocklet/payment-types": "1.18.29",
40
- "@blocklet/sdk": "^1.16.41"
39
+ "@blocklet/payment-types": "1.18.31",
40
+ "@blocklet/sdk": "^1.16.42"
41
41
  },
42
42
  "importSort": {
43
43
  ".js, .jsx, .mjs": {
@@ -63,5 +63,5 @@
63
63
  "type-fest": "^4.23.0",
64
64
  "typescript": "^5.5.4"
65
65
  },
66
- "gitHead": "bb8d03a1da62822cbc2ae57d7c5f2912aaebc0da"
66
+ "gitHead": "c9b1eff248ecd07bc1f606df039464dafa786914"
67
67
  }