@commercelayer/cli-plugin-triggers 3.8.3 → 3.10.0

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.
Files changed (136) hide show
  1. package/README.md +47 -0
  2. package/lib/base.d.ts +3 -3
  3. package/lib/base.js +1 -1
  4. package/lib/commands/adyen_payment/details.js +1 -1
  5. package/lib/commands/adyen_payment/index.js +1 -1
  6. package/lib/commands/authorization/capture.js +1 -1
  7. package/lib/commands/authorization/capture_amount_cents.js +1 -1
  8. package/lib/commands/authorization/index.js +1 -1
  9. package/lib/commands/authorization/void.js +1 -1
  10. package/lib/commands/axerve_payment/index.js +1 -1
  11. package/lib/commands/axerve_payment/update.js +1 -1
  12. package/lib/commands/bundle/compute_compare_at_amount.js +1 -1
  13. package/lib/commands/bundle/compute_price_amount.js +1 -1
  14. package/lib/commands/bundle/index.js +1 -1
  15. package/lib/commands/capture/index.js +1 -1
  16. package/lib/commands/capture/refund.js +1 -1
  17. package/lib/commands/capture/refund_amount_cents.js +1 -1
  18. package/lib/commands/checkout_com_payment/details.js +1 -1
  19. package/lib/commands/checkout_com_payment/index.js +1 -1
  20. package/lib/commands/checkout_com_payment/refresh.js +1 -1
  21. package/lib/commands/customer_password_reset/index.js +1 -1
  22. package/lib/commands/customer_password_reset/reset_password_token.js +1 -1
  23. package/lib/commands/gift_card/activate.js +1 -1
  24. package/lib/commands/gift_card/balance_change_cents.js +1 -1
  25. package/lib/commands/gift_card/deactivate.js +1 -1
  26. package/lib/commands/gift_card/index.js +1 -1
  27. package/lib/commands/gift_card/purchase.js +1 -1
  28. package/lib/commands/in_stock_subscription/activate.js +1 -1
  29. package/lib/commands/in_stock_subscription/deactivate.js +1 -1
  30. package/lib/commands/in_stock_subscription/index.js +1 -1
  31. package/lib/commands/klarna_payment/index.js +1 -1
  32. package/lib/commands/klarna_payment/update.js +1 -1
  33. package/lib/commands/line_item/external_price.js +1 -1
  34. package/lib/commands/line_item/index.js +1 -1
  35. package/lib/commands/market/disable.js +1 -1
  36. package/lib/commands/market/enable.js +1 -1
  37. package/lib/commands/market/index.js +1 -1
  38. package/lib/commands/noc.js +1 -1
  39. package/lib/commands/order/approve.js +1 -1
  40. package/lib/commands/order/approve_and_capture.js +1 -1
  41. package/lib/commands/order/archive.js +1 -1
  42. package/lib/commands/order/authorization_amount_cents.js +1 -1
  43. package/lib/commands/order/authorize.js +1 -1
  44. package/lib/commands/order/billing_address_clone_id.js +1 -1
  45. package/lib/commands/order/billing_address_same_as_shipping.js +1 -1
  46. package/lib/commands/order/cancel.js +1 -1
  47. package/lib/commands/order/capture.js +1 -1
  48. package/lib/commands/order/commit_invoice.js +1 -1
  49. package/lib/commands/order/create_subscriptions.d.ts +9 -0
  50. package/lib/commands/order/create_subscriptions.js +21 -0
  51. package/lib/commands/order/customer_payment_source_id.js +1 -1
  52. package/lib/commands/order/index.js +1 -1
  53. package/lib/commands/order/nullify_payment_source.js +1 -1
  54. package/lib/commands/order/place.js +1 -1
  55. package/lib/commands/order/refresh.js +1 -1
  56. package/lib/commands/order/refund.js +1 -1
  57. package/lib/commands/order/refund_invoice.js +1 -1
  58. package/lib/commands/order/save_billing_address_to_customer_address_book.js +1 -1
  59. package/lib/commands/order/save_payment_source_to_customer_wallet.js +1 -1
  60. package/lib/commands/order/save_shipping_address_to_customer_address_book.js +1 -1
  61. package/lib/commands/order/shipping_address_clone_id.js +1 -1
  62. package/lib/commands/order/shipping_address_same_as_billing.js +1 -1
  63. package/lib/commands/order/unarchive.js +1 -1
  64. package/lib/commands/order/update_taxes.js +1 -1
  65. package/lib/commands/order/validate.js +1 -1
  66. package/lib/commands/order_subscription/activate.js +1 -1
  67. package/lib/commands/order_subscription/cancel.js +1 -1
  68. package/lib/commands/order_subscription/deactivate.js +1 -1
  69. package/lib/commands/order_subscription/index.js +1 -1
  70. package/lib/commands/payment_method/disable.js +1 -1
  71. package/lib/commands/payment_method/enable.js +1 -1
  72. package/lib/commands/payment_method/index.js +1 -1
  73. package/lib/commands/return/approve.js +1 -1
  74. package/lib/commands/return/archive.js +1 -1
  75. package/lib/commands/return/cancel.js +1 -1
  76. package/lib/commands/return/index.js +1 -1
  77. package/lib/commands/return/receive.js +1 -1
  78. package/lib/commands/return/reject.js +1 -1
  79. package/lib/commands/return/request.js +1 -1
  80. package/lib/commands/return/restock.js +1 -1
  81. package/lib/commands/return/ship.js +1 -1
  82. package/lib/commands/return/unarchive.js +1 -1
  83. package/lib/commands/return_line_item/index.js +1 -1
  84. package/lib/commands/return_line_item/restock.js +1 -1
  85. package/lib/commands/satispay_payment/index.js +1 -1
  86. package/lib/commands/satispay_payment/refresh.js +1 -1
  87. package/lib/commands/shipment/get_rates.js +1 -1
  88. package/lib/commands/shipment/index.js +1 -1
  89. package/lib/commands/shipment/on_hold.js +1 -1
  90. package/lib/commands/shipment/packing.js +1 -1
  91. package/lib/commands/shipment/picking.js +1 -1
  92. package/lib/commands/shipment/purchase.js +1 -1
  93. package/lib/commands/shipment/ready_to_ship.js +1 -1
  94. package/lib/commands/shipment/ship.js +1 -1
  95. package/lib/commands/shipping_method/disable.js +1 -1
  96. package/lib/commands/shipping_method/enable.js +1 -1
  97. package/lib/commands/shipping_method/index.js +1 -1
  98. package/lib/commands/stock_transfer/cancel.js +1 -1
  99. package/lib/commands/stock_transfer/complete.js +1 -1
  100. package/lib/commands/stock_transfer/in_transit.js +1 -1
  101. package/lib/commands/stock_transfer/index.js +1 -1
  102. package/lib/commands/stock_transfer/picking.js +1 -1
  103. package/lib/commands/stock_transfer/upcoming.js +1 -1
  104. package/lib/commands/stripe_payment/index.js +1 -1
  105. package/lib/commands/stripe_payment/refresh.js +1 -1
  106. package/lib/commands/stripe_payment/update.d.ts +9 -0
  107. package/lib/commands/stripe_payment/update.js +21 -0
  108. package/lib/commands/webhook/index.js +1 -1
  109. package/lib/commands/webhook/reset_circuit.js +1 -1
  110. package/lib/triggers/adyen_payments.d.ts +1 -3
  111. package/lib/triggers/authorizations.d.ts +1 -3
  112. package/lib/triggers/axerve_payments.d.ts +1 -3
  113. package/lib/triggers/bundles.d.ts +1 -3
  114. package/lib/triggers/captures.d.ts +1 -3
  115. package/lib/triggers/checkout_com_payments.d.ts +1 -3
  116. package/lib/triggers/customer_password_resets.d.ts +1 -3
  117. package/lib/triggers/gift_cards.d.ts +1 -3
  118. package/lib/triggers/in_stock_subscriptions.d.ts +1 -3
  119. package/lib/triggers/klarna_payments.d.ts +1 -3
  120. package/lib/triggers/line_items.d.ts +1 -3
  121. package/lib/triggers/markets.d.ts +1 -3
  122. package/lib/triggers/order_subscriptions.d.ts +1 -3
  123. package/lib/triggers/orders.d.ts +2 -4
  124. package/lib/triggers/orders.js +5 -0
  125. package/lib/triggers/payment_methods.d.ts +1 -3
  126. package/lib/triggers/return_line_items.d.ts +1 -3
  127. package/lib/triggers/returns.d.ts +1 -3
  128. package/lib/triggers/satispay_payments.d.ts +1 -3
  129. package/lib/triggers/shipments.d.ts +1 -3
  130. package/lib/triggers/shipping_methods.d.ts +1 -3
  131. package/lib/triggers/stock_transfers.d.ts +1 -3
  132. package/lib/triggers/stripe_payments.d.ts +2 -4
  133. package/lib/triggers/stripe_payments.js +5 -0
  134. package/lib/triggers/webhooks.d.ts +1 -3
  135. package/oclif.manifest.json +145 -1
  136. package/package.json +13 -13
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'purchase' | 'activate' | 'deactivate' | 'balance_change_cents';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'activate' | 'deactivate';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'update';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'external_price';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'disable' | 'enable';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'activate' | 'deactivate' | 'cancel';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
5
- export type ActionType = 'archive' | 'unarchive' | 'place' | 'cancel' | 'approve' | 'approve_and_capture' | 'authorize' | 'authorization_amount_cents' | 'capture' | 'refund' | 'update_taxes' | 'nullify_payment_source' | 'billing_address_clone_id' | 'shipping_address_clone_id' | 'customer_payment_source_id' | 'shipping_address_same_as_billing' | 'billing_address_same_as_shipping' | 'commit_invoice' | 'refund_invoice' | 'save_payment_source_to_customer_wallet' | 'save_shipping_address_to_customer_address_book' | 'save_billing_address_to_customer_address_book' | 'refresh' | 'validate';
2
+ export declare const triggers: Record<string, Trigger>;
3
+ export type ActionType = 'archive' | 'unarchive' | 'place' | 'cancel' | 'approve' | 'approve_and_capture' | 'authorize' | 'authorization_amount_cents' | 'capture' | 'refund' | 'update_taxes' | 'nullify_payment_source' | 'billing_address_clone_id' | 'shipping_address_clone_id' | 'customer_payment_source_id' | 'shipping_address_same_as_billing' | 'billing_address_same_as_shipping' | 'commit_invoice' | 'refund_invoice' | 'save_payment_source_to_customer_wallet' | 'save_shipping_address_to_customer_address_book' | 'save_billing_address_to_customer_address_book' | 'refresh' | 'validate' | 'create_subscriptions';
@@ -122,4 +122,9 @@ exports.triggers = {
122
122
  trigger: '_validate',
123
123
  description: 'Send this attribute if you want to trigger the external validation for the order.',
124
124
  },
125
+ create_subscriptions: {
126
+ action: 'create_subscriptions',
127
+ trigger: '_create_subscriptions',
128
+ description: 'Send this attribute if you want to create order subscriptions from the recurring line items upon/after placing the order. Subscriptions are generated according to associated subscription model strategy.',
129
+ },
125
130
  };
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'disable' | 'enable';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'restock';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'request' | 'approve' | 'cancel' | 'ship' | 'reject' | 'receive' | 'restock' | 'archive' | 'unarchive';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'refresh';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'on_hold' | 'picking' | 'packing' | 'ready_to_ship' | 'ship' | 'get_rates' | 'purchase';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'disable' | 'enable';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'upcoming' | 'picking' | 'in_transit' | 'complete' | 'cancel';
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
5
- export type ActionType = 'refresh';
2
+ export declare const triggers: Record<string, Trigger>;
3
+ export type ActionType = 'update' | 'refresh';
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.triggers = void 0;
4
4
  exports.triggers = {
5
+ update: {
6
+ action: 'update',
7
+ trigger: '_update',
8
+ description: 'Send this attribute if you want to update the created payment intent with fresh order data.',
9
+ },
5
10
  refresh: {
6
11
  action: 'refresh',
7
12
  trigger: '_refresh',
@@ -1,5 +1,3 @@
1
1
  import type { Trigger } from '../common';
2
- export declare const triggers: {
3
- [key: string]: Trigger;
4
- };
2
+ export declare const triggers: Record<string, Trigger>;
5
3
  export type ActionType = 'reset_circuit';
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.8.3",
2
+ "version": "3.10.0",
3
3
  "commands": {
4
4
  "noc": {
5
5
  "id": "noc",
@@ -3188,6 +3188,78 @@
3188
3188
  }
3189
3189
  }
3190
3190
  },
3191
+ "order:create_subscriptions": {
3192
+ "id": "order:create_subscriptions",
3193
+ "description": "Send this attribute if you want to create order subscriptions from the recurring line items upon/after placing the order. Subscriptions are generated according to associated subscription model strategy.",
3194
+ "strict": true,
3195
+ "pluginName": "@commercelayer/cli-plugin-triggers",
3196
+ "pluginAlias": "@commercelayer/cli-plugin-triggers",
3197
+ "pluginType": "core",
3198
+ "aliases": [],
3199
+ "flags": {
3200
+ "organization": {
3201
+ "name": "organization",
3202
+ "type": "option",
3203
+ "char": "o",
3204
+ "description": "the slug of your organization",
3205
+ "hidden": true,
3206
+ "required": true,
3207
+ "multiple": false
3208
+ },
3209
+ "domain": {
3210
+ "name": "domain",
3211
+ "type": "option",
3212
+ "char": "d",
3213
+ "hidden": true,
3214
+ "required": false,
3215
+ "multiple": false,
3216
+ "dependsOn": [
3217
+ "organization"
3218
+ ]
3219
+ },
3220
+ "accessToken": {
3221
+ "name": "accessToken",
3222
+ "type": "option",
3223
+ "hidden": true,
3224
+ "required": true,
3225
+ "multiple": false
3226
+ },
3227
+ "print": {
3228
+ "name": "print",
3229
+ "type": "boolean",
3230
+ "char": "p",
3231
+ "description": "print out the modified resource",
3232
+ "allowNo": false
3233
+ },
3234
+ "json": {
3235
+ "name": "json",
3236
+ "type": "boolean",
3237
+ "char": "j",
3238
+ "description": "print result in JSON format",
3239
+ "allowNo": false,
3240
+ "dependsOn": [
3241
+ "print"
3242
+ ]
3243
+ },
3244
+ "unformatted": {
3245
+ "name": "unformatted",
3246
+ "type": "boolean",
3247
+ "char": "u",
3248
+ "description": "print JSON output without indentation",
3249
+ "allowNo": false,
3250
+ "dependsOn": [
3251
+ "json"
3252
+ ]
3253
+ }
3254
+ },
3255
+ "args": {
3256
+ "id": {
3257
+ "name": "id",
3258
+ "description": "the unique id of the resource",
3259
+ "required": true
3260
+ }
3261
+ }
3262
+ },
3191
3263
  "order:customer_payment_source_id": {
3192
3264
  "id": "order:customer_payment_source_id",
3193
3265
  "description": "The id of the customer payment source (i.e. credit card) that you want to use as the order's payment source.",
@@ -7164,6 +7236,78 @@
7164
7236
  }
7165
7237
  }
7166
7238
  },
7239
+ "stripe_payment:update": {
7240
+ "id": "stripe_payment:update",
7241
+ "description": "Send this attribute if you want to update the created payment intent with fresh order data.",
7242
+ "strict": true,
7243
+ "pluginName": "@commercelayer/cli-plugin-triggers",
7244
+ "pluginAlias": "@commercelayer/cli-plugin-triggers",
7245
+ "pluginType": "core",
7246
+ "aliases": [],
7247
+ "flags": {
7248
+ "organization": {
7249
+ "name": "organization",
7250
+ "type": "option",
7251
+ "char": "o",
7252
+ "description": "the slug of your organization",
7253
+ "hidden": true,
7254
+ "required": true,
7255
+ "multiple": false
7256
+ },
7257
+ "domain": {
7258
+ "name": "domain",
7259
+ "type": "option",
7260
+ "char": "d",
7261
+ "hidden": true,
7262
+ "required": false,
7263
+ "multiple": false,
7264
+ "dependsOn": [
7265
+ "organization"
7266
+ ]
7267
+ },
7268
+ "accessToken": {
7269
+ "name": "accessToken",
7270
+ "type": "option",
7271
+ "hidden": true,
7272
+ "required": true,
7273
+ "multiple": false
7274
+ },
7275
+ "print": {
7276
+ "name": "print",
7277
+ "type": "boolean",
7278
+ "char": "p",
7279
+ "description": "print out the modified resource",
7280
+ "allowNo": false
7281
+ },
7282
+ "json": {
7283
+ "name": "json",
7284
+ "type": "boolean",
7285
+ "char": "j",
7286
+ "description": "print result in JSON format",
7287
+ "allowNo": false,
7288
+ "dependsOn": [
7289
+ "print"
7290
+ ]
7291
+ },
7292
+ "unformatted": {
7293
+ "name": "unformatted",
7294
+ "type": "boolean",
7295
+ "char": "u",
7296
+ "description": "print JSON output without indentation",
7297
+ "allowNo": false,
7298
+ "dependsOn": [
7299
+ "json"
7300
+ ]
7301
+ }
7302
+ },
7303
+ "args": {
7304
+ "id": {
7305
+ "name": "id",
7306
+ "description": "the unique id of the resource",
7307
+ "required": true
7308
+ }
7309
+ }
7310
+ },
7167
7311
  "webhook": {
7168
7312
  "id": "webhook",
7169
7313
  "description": "execute an action on a resource of type webhooks",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercelayer/cli-plugin-triggers",
3
3
  "description": "Commerce Layer CLI Triggers plugin",
4
- "version": "3.8.3",
4
+ "version": "3.10.0",
5
5
  "author": "Pierluigi Viti <pierluigi@commercelayer.io>",
6
6
  "bugs": "https://github.com/commercelayer/commercelayer-cli-plugin-triggers/issues",
7
7
  "engines": {
@@ -44,30 +44,30 @@
44
44
  "types": "lib/index.d.ts",
45
45
  "devDependencies": {
46
46
  "@commercelayer/cli-dev": "^2.0.5",
47
- "@commercelayer/eslint-config-ts": "^0.1.4",
48
- "@oclif/plugin-help": "^5.2.8",
49
- "@oclif/test": "^2.3.10",
50
- "@types/chai": "^4.3.4",
47
+ "@commercelayer/eslint-config-ts": "^1.0.0",
48
+ "@oclif/plugin-help": "^5.2.9",
49
+ "@oclif/test": "^2.3.21",
50
+ "@types/chai": "^4.3.5",
51
51
  "@types/inquirer": "^8.2.6",
52
- "@types/lodash": "^4.14.191",
52
+ "@types/lodash": "^4.14.195",
53
53
  "@types/mocha": "^10.0.1",
54
- "@types/node": "^18.15.3",
54
+ "@types/node": "^20.2.4",
55
55
  "chai": "^4.3.7",
56
- "eslint": "^8.36.0",
56
+ "eslint": "^8.41.0",
57
57
  "inflector-js": "^1.0.1",
58
58
  "lodash": "^4.17.21",
59
59
  "mocha": "^10.2.0",
60
60
  "nyc": "^15.1.0",
61
61
  "ts-node": "^10.9.1",
62
- "typescript": "4.9.5"
62
+ "typescript": "5.0.4"
63
63
  },
64
64
  "dependencies": {
65
- "@commercelayer/cli-core": "^3.3.6",
65
+ "@commercelayer/cli-core": "^3.7.3",
66
66
  "@commercelayer/js-auth": "^2.3.0",
67
- "@commercelayer/sdk": "^4.25.0",
68
- "@oclif/core": "^2.6.3",
67
+ "@commercelayer/sdk": "^4.27.1",
68
+ "@oclif/core": "^2.8.5",
69
69
  "inquirer": "^8.2.5",
70
- "tslib": "^2.5.0"
70
+ "tslib": "^2.5.2"
71
71
  },
72
72
  "publishConfig": {
73
73
  "access": "public"