@cheqd/studio 3.3.0-develop.3 → 3.3.0-develop.5

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 (56) hide show
  1. package/dist/controllers/admin/webhook.d.ts +9 -0
  2. package/dist/controllers/admin/webhook.d.ts.map +1 -1
  3. package/dist/controllers/admin/webhook.js +223 -46
  4. package/dist/controllers/admin/webhook.js.map +1 -1
  5. package/dist/controllers/api/account.d.ts +2 -2
  6. package/dist/controllers/api/account.d.ts.map +1 -1
  7. package/dist/controllers/api/account.js +10 -7
  8. package/dist/controllers/api/account.js.map +1 -1
  9. package/dist/controllers/validator/jsonld-proof.js +2 -2
  10. package/dist/controllers/validator/jsonld-proof.js.map +1 -1
  11. package/dist/database/entities/customer.entity.d.ts +2 -2
  12. package/dist/database/entities/customer.entity.d.ts.map +1 -1
  13. package/dist/database/entities/customer.entity.js +3 -2
  14. package/dist/database/entities/customer.entity.js.map +1 -1
  15. package/dist/database/migrations/AlterCustomerTableUniqueEmail.d.ts +6 -0
  16. package/dist/database/migrations/AlterCustomerTableUniqueEmail.d.ts.map +1 -0
  17. package/dist/database/migrations/AlterCustomerTableUniqueEmail.js +29 -0
  18. package/dist/database/migrations/AlterCustomerTableUniqueEmail.js.map +1 -0
  19. package/dist/database/migrations/MigrateData.js +1 -1
  20. package/dist/database/migrations/MigrateData.js.map +1 -1
  21. package/dist/database/types/types.d.ts.map +1 -1
  22. package/dist/database/types/types.js +3 -0
  23. package/dist/database/types/types.js.map +1 -1
  24. package/dist/services/admin/stripe.d.ts +1 -2
  25. package/dist/services/admin/stripe.d.ts.map +1 -1
  26. package/dist/services/admin/stripe.js +10 -15
  27. package/dist/services/admin/stripe.js.map +1 -1
  28. package/dist/services/api/customer.d.ts +1 -4
  29. package/dist/services/api/customer.d.ts.map +1 -1
  30. package/dist/services/api/customer.js +2 -5
  31. package/dist/services/api/customer.js.map +1 -1
  32. package/dist/services/identity/agent.d.ts.map +1 -1
  33. package/dist/services/identity/agent.js +6 -2
  34. package/dist/services/identity/agent.js.map +1 -1
  35. package/dist/services/track/helpers.d.ts +11 -0
  36. package/dist/services/track/helpers.d.ts.map +1 -1
  37. package/dist/services/track/helpers.js +14 -11
  38. package/dist/services/track/helpers.js.map +1 -1
  39. package/dist/services/track/tracker.d.ts.map +1 -1
  40. package/dist/services/track/tracker.js +0 -2
  41. package/dist/services/track/tracker.js.map +1 -1
  42. package/dist/static/swagger-api.json +6 -0
  43. package/dist/types/constants.d.ts.map +1 -1
  44. package/dist/types/constants.js +1 -1
  45. package/dist/types/constants.js.map +1 -1
  46. package/dist/types/swagger-api-types.d.ts +4 -0
  47. package/dist/types/swagger-api-types.d.ts.map +1 -1
  48. package/dist/types/swagger-api-types.js +4 -0
  49. package/dist/types/swagger-api-types.js.map +1 -1
  50. package/dist/types/validation.d.ts +2 -1
  51. package/dist/types/validation.d.ts.map +1 -1
  52. package/package.json +7 -7
  53. package/dist/services/track/admin/subscription-submitter.d.ts +0 -17
  54. package/dist/services/track/admin/subscription-submitter.d.ts.map +0 -1
  55. package/dist/services/track/admin/subscription-submitter.js +0 -208
  56. package/dist/services/track/admin/subscription-submitter.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"swagger-api-types.d.ts","sourceRoot":"","sources":["../../src/types/swagger-api-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAw1CG"}
@@ -1339,7 +1339,11 @@
1339
1339
  * properties:
1340
1340
  * user:
1341
1341
  * type: object
1342
+ * required:
1343
+ * - primaryEmail
1342
1344
  * properties:
1345
+ * name:
1346
+ * type: string
1343
1347
  * primaryEmail:
1344
1348
  * type: string
1345
1349
  * InvalidRequest:
@@ -1 +1 @@
1
- {"version":3,"file":"swagger-api-types.js","sourceRoot":"","sources":["../../src/types/swagger-api-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAw1CG"}
@@ -12,7 +12,8 @@ export type JSONLDProofType = {
12
12
  created: string;
13
13
  verificationMethod: string;
14
14
  proofPurpose: string;
15
- jws: string;
15
+ proofValue?: string;
16
+ jws?: string;
16
17
  };
17
18
  export type CheqdCredentialStatus = {
18
19
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/types/validation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACZ,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/types/validation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cheqd/studio",
3
- "version": "3.3.0-develop.3",
3
+ "version": "3.3.0-develop.5",
4
4
  "description": "cheqd Studio Backend",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -58,7 +58,7 @@
58
58
  "@cheqd/ts-proto": "^3.4.4",
59
59
  "@cosmjs/amino": "^0.32.4",
60
60
  "@cosmjs/encoding": "^0.32.4",
61
- "@logto/express": "^2.3.14",
61
+ "@logto/express": "^2.3.15",
62
62
  "@stablelib/ed25519": "^1.0.3",
63
63
  "@veramo/core": "^6.0.0",
64
64
  "@veramo/credential-ld": "^6.0.0",
@@ -111,7 +111,7 @@
111
111
  "@semantic-release/changelog": "^6.0.3",
112
112
  "@semantic-release/commit-analyzer": "^13.0.0",
113
113
  "@semantic-release/git": "^10.0.1",
114
- "@semantic-release/github": "^10.1.6",
114
+ "@semantic-release/github": "^10.1.7",
115
115
  "@semantic-release/npm": "^12.0.1",
116
116
  "@semantic-release/release-notes-generator": "^14.0.1",
117
117
  "@types/bcrypt": "^5.0.2",
@@ -124,12 +124,12 @@
124
124
  "@types/helmet": "^4.0.0",
125
125
  "@types/json-stringify-safe": "^5.0.3",
126
126
  "@types/jsonwebtoken": "^9.0.6",
127
- "@types/node": "^20.16.1",
127
+ "@types/node": "^20.16.3",
128
128
  "@types/secp256k1": "^4.0.6",
129
129
  "@types/swagger-jsdoc": "^6.0.4",
130
130
  "@types/swagger-ui-express": "^4.1.6",
131
131
  "@types/uuid": "^9.0.8",
132
- "@types/validator": "^13.12.0",
132
+ "@types/validator": "^13.12.1",
133
133
  "@typescript-eslint/eslint-plugin": "^5.62.0",
134
134
  "@typescript-eslint/parser": "^5.62.0",
135
135
  "buffer": "6.0.3",
@@ -141,10 +141,10 @@
141
141
  "prettier": "^3.3.3",
142
142
  "semantic-release": "^24.1.0",
143
143
  "swagger-jsdoc": "^6.2.8",
144
- "ts-jest": "^29.2.4",
144
+ "ts-jest": "^29.2.5",
145
145
  "ts-loader": "^9.5.1",
146
146
  "ts-node": "^10.9.2",
147
- "tsx": "^4.17.0",
147
+ "tsx": "^4.19.0",
148
148
  "typescript": "^5.5.4",
149
149
  "uint8arrays": "^5.1.0"
150
150
  },
@@ -1,17 +0,0 @@
1
- import type { INotifyMessage } from '../../../types/track.js';
2
- import type { ISubmitOperation } from '../submitter.js';
3
- import type { IObserver } from '../types.js';
4
- export declare class SubscriptionSubmitter implements IObserver {
5
- private emitter;
6
- private readonly stripe;
7
- constructor(emitter: EventEmitter);
8
- notify(notifyMessage: INotifyMessage): void;
9
- update(operation: ISubmitOperation): Promise<void>;
10
- private handleCustomerRoleAssignment;
11
- private handleCustomerRoleRemoval;
12
- private syncLogtoRoles;
13
- submitSubscriptionCreate(operation: ISubmitOperation): Promise<void>;
14
- submitSubscriptionUpdate(operation: ISubmitOperation): Promise<void>;
15
- submitSubscriptionCancel(operation: ISubmitOperation): Promise<void>;
16
- }
17
- //# sourceMappingURL=subscription-submitter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscription-submitter.d.ts","sourceRoot":"","sources":["../../../../src/services/track/admin/subscription-submitter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,KAAK,EAAE,gBAAgB,EAA2B,MAAM,iBAAiB,CAAC;AAEjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAO7C,qBAAa,qBAAsB,YAAW,SAAS;IACtD,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,OAAO,EAAE,YAAY;IAKjC,MAAM,CAAC,aAAa,EAAE,cAAc,GAAG,IAAI;IAIrC,MAAM,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;YAgB1C,4BAA4B;YA8B5B,yBAAyB;YAgCzB,cAAc;IAsCtB,wBAAwB,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2FpE,wBAAwB,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiDpE,wBAAwB,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAqC1E"}
@@ -1,208 +0,0 @@
1
- import Stripe from 'stripe';
2
- import { OperationNameEnum } from '../../../types/constants.js';
3
- import { SubscriptionService } from '../../admin/subscription.js';
4
- import { CustomerService } from '../../api/customer.js';
5
- import { EventTracker } from '../tracker.js';
6
- import { LogToHelper } from '../../../middleware/auth/logto-helper.js';
7
- import { StatusCodes } from 'http-status-codes';
8
- import { UserService } from '../../api/user.js';
9
- export class SubscriptionSubmitter {
10
- emitter;
11
- stripe;
12
- constructor(emitter) {
13
- this.emitter = emitter;
14
- this.stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
15
- }
16
- notify(notifyMessage) {
17
- this.emitter.emit('notify', notifyMessage);
18
- }
19
- async update(operation) {
20
- switch (operation.operation) {
21
- case OperationNameEnum.SUBSCRIPTION_CREATE:
22
- await this.submitSubscriptionCreate(operation);
23
- break;
24
- case OperationNameEnum.SUBSCRIPTION_UPDATE:
25
- await this.submitSubscriptionUpdate(operation);
26
- break;
27
- case OperationNameEnum.SUBSCRIPTION_CANCEL:
28
- await this.submitSubscriptionCancel(operation);
29
- break;
30
- }
31
- }
32
- async handleCustomerRoleAssignment(operation, logToHelper, userLogtoId, productName) {
33
- const roleAssignmentResponse = await logToHelper.assignCustomerPlanRoles(userLogtoId, productName.toLowerCase());
34
- if (roleAssignmentResponse.status !== 201) {
35
- this.notify({
36
- message: EventTracker.compileBasicNotification(`Failed to assign roles to user for planType ${productName}: ${roleAssignmentResponse.error}`, operation.operation),
37
- severity: 'error',
38
- });
39
- return;
40
- }
41
- this.notify({
42
- message: EventTracker.compileBasicNotification(`${productName} plan assigned to user with logtoId ${userLogtoId}`, operation.operation),
43
- severity: 'info',
44
- });
45
- }
46
- async handleCustomerRoleRemoval(operation, logto, userLogtoId) {
47
- const responses = await Promise.allSettled([
48
- logto.removeLogtoRoleFromUser(userLogtoId, process.env.LOGTO_TESTNET_ROLE_ID.trim()),
49
- logto.removeLogtoRoleFromUser(userLogtoId, process.env.LOGTO_MAINNET_ROLE_ID.trim()),
50
- ]);
51
- const allRolesRemoved = responses.every((r) => r.status === 'fulfilled' && r.value.status === StatusCodes.OK);
52
- if (allRolesRemoved) {
53
- this.notify({
54
- message: EventTracker.compileBasicNotification(`Roles have been removed successfully for user with id: ${userLogtoId}`, operation.operation),
55
- severity: 'info',
56
- });
57
- return;
58
- }
59
- for (const resp of responses) {
60
- if (resp.status === 'rejected' || resp.value.status !== StatusCodes.OK) {
61
- const errMsg = resp.status === 'rejected' ? resp.reason.message : resp.value.error;
62
- this.notify({
63
- message: EventTracker.compileBasicNotification(`Role removal error: ${errMsg}`, operation.operation),
64
- severity: 'error',
65
- });
66
- }
67
- }
68
- }
69
- async syncLogtoRoles(operation, customerId, productName) {
70
- const logToHelper = new LogToHelper();
71
- const setupResp = await logToHelper.setup();
72
- if (setupResp.status !== StatusCodes.OK) {
73
- this.notify({
74
- message: EventTracker.compileBasicNotification(`Logto client initialisation failed: ${setupResp.error}`, operation.operation),
75
- severity: 'error',
76
- });
77
- return;
78
- }
79
- const user = await UserService.instance.userRepository.findOne({ where: { customer: { customerId } } });
80
- if (user) {
81
- switch (operation.operation) {
82
- case OperationNameEnum.SUBSCRIPTION_CREATE:
83
- case OperationNameEnum.SUBSCRIPTION_UPDATE:
84
- this.handleCustomerRoleAssignment(operation, logToHelper, user.logToId, productName);
85
- return;
86
- case OperationNameEnum.SUBSCRIPTION_CANCEL:
87
- this.handleCustomerRoleRemoval(operation, logToHelper, user.logToId);
88
- return;
89
- }
90
- }
91
- this.notify({
92
- message: EventTracker.compileBasicNotification(`Role assignment failed: No user found with customerId: ${customerId}`, operation.operation),
93
- severity: 'error',
94
- });
95
- }
96
- async submitSubscriptionCreate(operation) {
97
- const data = operation.data;
98
- let customer = operation.options?.customer;
99
- try {
100
- const [product, stripeCustomer] = await Promise.all([
101
- this.stripe.products.retrieve(data.productId),
102
- this.stripe.customers.retrieve(data.paymentProviderId),
103
- ]);
104
- if (!customer) {
105
- const whereClause = [{ paymentProviderId: data.paymentProviderId }];
106
- // we add an additional "OR" check in case that a customer was created locally with email and no paymentProviderId
107
- if (!stripeCustomer.deleted && stripeCustomer.email) {
108
- whereClause.push({ email: stripeCustomer.email });
109
- }
110
- const customers = await CustomerService.instance.customerRepository.find({
111
- where: whereClause,
112
- });
113
- if (customers.length === 0) {
114
- this.notify({
115
- message: EventTracker.compileBasicNotification(`Customer not found for Cheqd Studio, creating new customer record with paymentProviderId: ${data.paymentProviderId}`, operation.operation),
116
- severity: 'info',
117
- });
118
- if (!stripeCustomer.deleted && stripeCustomer.email) {
119
- const customerName = stripeCustomer.name ?? stripeCustomer.email;
120
- const customer = await CustomerService.instance.create(customerName, stripeCustomer.email, undefined, data.paymentProviderId);
121
- customers.push(customer);
122
- }
123
- }
124
- if (customers.length !== 1) {
125
- this.notify({
126
- message: EventTracker.compileBasicNotification(`Only one Stripe account should be associated with CaaS customer. Stripe accountId: ${data.paymentProviderId}.`, operation.operation),
127
- severity: 'error',
128
- });
129
- }
130
- customer = customers[0];
131
- }
132
- const subscription = await SubscriptionService.instance.create(data.subscriptionId, customer, data.status, data.currentPeriodStart, data.currentPeriodEnd, data.trialStart, data.trialEnd);
133
- if (!subscription) {
134
- this.notify({
135
- message: EventTracker.compileBasicNotification(`Failed to create a new subscription with id: ${data.subscriptionId}.`, operation.operation),
136
- severity: 'error',
137
- });
138
- }
139
- await this.syncLogtoRoles(operation, customer.customerId, product.name);
140
- this.notify({
141
- message: EventTracker.compileBasicNotification(`Subscription created with id: ${data.subscriptionId}.`, operation.operation),
142
- severity: 'info',
143
- });
144
- }
145
- catch (error) {
146
- this.notify({
147
- message: EventTracker.compileBasicNotification(`Failed to create a new subscription with id: ${data.subscriptionId} because of error: ${error?.message || error}`, operation.operation),
148
- severity: 'error',
149
- });
150
- }
151
- }
152
- async submitSubscriptionUpdate(operation) {
153
- const data = operation.data;
154
- try {
155
- const subscription = await SubscriptionService.instance.update(data.subscriptionId, data.status, data.currentPeriodStart, data.currentPeriodEnd, data.trialStart, data.trialEnd);
156
- if (!subscription) {
157
- this.notify({
158
- message: EventTracker.compileBasicNotification(`Failed to update subscription with id: ${data.subscriptionId}.`, operation.operation),
159
- severity: 'error',
160
- });
161
- }
162
- const [customer, product] = await Promise.all([
163
- CustomerService.instance.findbyPaymentProviderId(data.paymentProviderId),
164
- this.stripe.products.retrieve(data.productId),
165
- ]);
166
- if (customer) {
167
- await this.syncLogtoRoles(operation, customer.customerId, product.name);
168
- }
169
- this.notify({
170
- message: EventTracker.compileBasicNotification(`Subscription updated with id: ${data.subscriptionId}.`, operation.operation),
171
- severity: 'info',
172
- });
173
- }
174
- catch (error) {
175
- this.notify({
176
- message: EventTracker.compileBasicNotification(`Failed to update subscription with id: ${data.subscriptionId} because of error: ${error?.message || error}`, operation.operation),
177
- severity: 'error',
178
- });
179
- }
180
- }
181
- async submitSubscriptionCancel(operation) {
182
- const data = operation.data;
183
- try {
184
- const subscription = await SubscriptionService.instance.update(data.subscriptionId, data.status);
185
- if (!subscription) {
186
- this.notify({
187
- message: EventTracker.compileBasicNotification(`Failed to cancel subscription with id: ${data.subscriptionId}.`, operation.operation),
188
- severity: 'error',
189
- });
190
- }
191
- const customer = await CustomerService.instance.findbyPaymentProviderId(data.paymentProviderId);
192
- if (customer) {
193
- this.syncLogtoRoles(operation, customer.customerId, '');
194
- }
195
- this.notify({
196
- message: EventTracker.compileBasicNotification(`Subscription canceled with id: ${data.subscriptionId}.`, operation.operation),
197
- severity: 'info',
198
- });
199
- }
200
- catch (error) {
201
- this.notify({
202
- message: EventTracker.compileBasicNotification(`Failed to cancel subscription with id: ${data.subscriptionId} because of error: ${error?.message || error}`, operation.operation),
203
- severity: 'error',
204
- });
205
- }
206
- }
207
- }
208
- //# sourceMappingURL=subscription-submitter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscription-submitter.js","sourceRoot":"","sources":["../../../../src/services/track/admin/subscription-submitter.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAA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