@chotot/ct-logic-uni-rev-payment-v1 1.133.0 → 1.145.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.
- package/configuration.proto +3 -0
- package/configuration_pb.d.ts +19 -0
- package/configuration_pb.js +3 -0
- package/crepro_campaign.proto +6 -1
- package/crepro_campaign_pb.d.ts +31 -2
- package/crepro_campaign_pb.js +12 -1
- package/econtract.proto +1 -0
- package/econtract_pb.d.ts +5 -0
- package/econtract_pb.js +1 -0
- package/order.proto +10 -1
- package/order_pb.d.ts +53 -0
- package/order_pb.js +21 -0
- package/package.json +1 -1
- package/service-LogicUniRevPaymentService_connectquery.d.ts +13 -1
- package/service-LogicUniRevPaymentService_connectquery.js +21 -1
- package/service.proto +3 -0
- package/service_connect.d.ts +12 -1
- package/service_connect.js +12 -1
- package/transaction.proto +2 -0
- package/transaction_pb.d.ts +14 -0
- package/transaction_pb.js +2 -0
- package/virtual_account.proto +4 -0
- package/virtual_account_pb.d.ts +20 -0
- package/virtual_account_pb.js +4 -0
- package/scripts/modify_package_json.js +0 -50
package/configuration.proto
CHANGED
|
@@ -14,6 +14,7 @@ message ForceUpdateInfoRequest {
|
|
|
14
14
|
string app_version = 2 [(validate.rules).string.min_len = 1];
|
|
15
15
|
string app_platform = 3 [(validate.rules).string.min_len = 1];
|
|
16
16
|
string screen_name = 4 [(validate.rules).string.min_len = 1];
|
|
17
|
+
int64 ad_id = 5; // optional, only for ads, supporting to check screen having ads
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
message ForceUpdateInfoResponse {
|
|
@@ -74,6 +75,7 @@ message PaymentGatewayCheckoutInfoRequest {
|
|
|
74
75
|
string order_type = 3;
|
|
75
76
|
OrderParams order_params = 4;
|
|
76
77
|
string page_type = 5;
|
|
78
|
+
int64 account_id = 6;
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
message OrderParams {
|
|
@@ -119,6 +121,7 @@ message PaymentGatewayCheckoutInfoResponse {
|
|
|
119
121
|
string note = 5;
|
|
120
122
|
PricingDescription pricing_description = 6;
|
|
121
123
|
optional InvoiceInfo invoice_info = 7;
|
|
124
|
+
optional bool show_invoice = 8; // open Invoice box when true, only applicable to Econtract with Invoice
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
message PricingDescription {
|
package/configuration_pb.d.ts
CHANGED
|
@@ -33,6 +33,13 @@ export declare class ForceUpdateInfoRequest extends Message<ForceUpdateInfoReque
|
|
|
33
33
|
*/
|
|
34
34
|
screenName: string;
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* optional, only for ads, supporting to check screen having ads
|
|
38
|
+
*
|
|
39
|
+
* @generated from field: int64 ad_id = 5;
|
|
40
|
+
*/
|
|
41
|
+
adId: bigint;
|
|
42
|
+
|
|
36
43
|
constructor(data?: PartialMessage<ForceUpdateInfoRequest>);
|
|
37
44
|
|
|
38
45
|
static readonly runtime: typeof proto3;
|
|
@@ -305,6 +312,11 @@ export declare class PaymentGatewayCheckoutInfoRequest extends Message<PaymentGa
|
|
|
305
312
|
*/
|
|
306
313
|
pageType: string;
|
|
307
314
|
|
|
315
|
+
/**
|
|
316
|
+
* @generated from field: int64 account_id = 6;
|
|
317
|
+
*/
|
|
318
|
+
accountId: bigint;
|
|
319
|
+
|
|
308
320
|
constructor(data?: PartialMessage<PaymentGatewayCheckoutInfoRequest>);
|
|
309
321
|
|
|
310
322
|
static readonly runtime: typeof proto3;
|
|
@@ -558,6 +570,13 @@ export declare class PaymentGatewayCheckoutInfoResponse extends Message<PaymentG
|
|
|
558
570
|
*/
|
|
559
571
|
invoiceInfo?: InvoiceInfo;
|
|
560
572
|
|
|
573
|
+
/**
|
|
574
|
+
* open Invoice box when true, only applicable to Econtract with Invoice
|
|
575
|
+
*
|
|
576
|
+
* @generated from field: optional bool show_invoice = 8;
|
|
577
|
+
*/
|
|
578
|
+
showInvoice?: boolean;
|
|
579
|
+
|
|
561
580
|
constructor(data?: PartialMessage<PaymentGatewayCheckoutInfoResponse>);
|
|
562
581
|
|
|
563
582
|
static readonly runtime: typeof proto3;
|
package/configuration_pb.js
CHANGED
|
@@ -18,6 +18,7 @@ export const ForceUpdateInfoRequest = proto3.makeMessageType(
|
|
|
18
18
|
{ no: 2, name: "app_version", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
19
19
|
{ no: 3, name: "app_platform", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
20
20
|
{ no: 4, name: "screen_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
21
|
+
{ no: 5, name: "ad_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
21
22
|
],
|
|
22
23
|
);
|
|
23
24
|
|
|
@@ -96,6 +97,7 @@ export const PaymentGatewayCheckoutInfoRequest = proto3.makeMessageType(
|
|
|
96
97
|
{ no: 3, name: "order_type", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
97
98
|
{ no: 4, name: "order_params", kind: "message", T: OrderParams },
|
|
98
99
|
{ no: 5, name: "page_type", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
100
|
+
{ no: 6, name: "account_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
99
101
|
],
|
|
100
102
|
);
|
|
101
103
|
|
|
@@ -183,6 +185,7 @@ export const PaymentGatewayCheckoutInfoResponse = proto3.makeMessageType(
|
|
|
183
185
|
{ no: 5, name: "note", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
184
186
|
{ no: 6, name: "pricing_description", kind: "message", T: PricingDescription },
|
|
185
187
|
{ no: 7, name: "invoice_info", kind: "message", T: InvoiceInfo, opt: true },
|
|
188
|
+
{ no: 8, name: "show_invoice", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
186
189
|
],
|
|
187
190
|
);
|
|
188
191
|
|
package/crepro_campaign.proto
CHANGED
|
@@ -187,12 +187,17 @@ message AssignCreditPromotionCodeRequest {
|
|
|
187
187
|
int64 campaign_id = 1 [(validate.rules).int64 = {
|
|
188
188
|
gt: 0
|
|
189
189
|
}];
|
|
190
|
-
repeated
|
|
190
|
+
repeated AccountWithCodeValue list_assignments = 2 [(validate.rules).repeated = {
|
|
191
191
|
max_items: 1000
|
|
192
192
|
}];
|
|
193
193
|
string action_by = 3;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
+
message AccountWithCodeValue {
|
|
197
|
+
int64 account_id = 1;
|
|
198
|
+
string code = 2;
|
|
199
|
+
}
|
|
200
|
+
|
|
196
201
|
message AssignCreditPromotionCodeResponse {
|
|
197
202
|
string status = 1;
|
|
198
203
|
int64 quantity = 2;
|
package/crepro_campaign_pb.d.ts
CHANGED
|
@@ -770,9 +770,9 @@ export declare class AssignCreditPromotionCodeRequest extends Message<AssignCred
|
|
|
770
770
|
campaignId: bigint;
|
|
771
771
|
|
|
772
772
|
/**
|
|
773
|
-
* @generated from field: repeated
|
|
773
|
+
* @generated from field: repeated ct_logic_uni_rev_payment.v1.AccountWithCodeValue list_assignments = 2;
|
|
774
774
|
*/
|
|
775
|
-
|
|
775
|
+
listAssignments: AccountWithCodeValue[];
|
|
776
776
|
|
|
777
777
|
/**
|
|
778
778
|
* @generated from field: string action_by = 3;
|
|
@@ -794,6 +794,35 @@ export declare class AssignCreditPromotionCodeRequest extends Message<AssignCred
|
|
|
794
794
|
static equals(a: AssignCreditPromotionCodeRequest | PlainMessage<AssignCreditPromotionCodeRequest> | undefined, b: AssignCreditPromotionCodeRequest | PlainMessage<AssignCreditPromotionCodeRequest> | undefined): boolean;
|
|
795
795
|
}
|
|
796
796
|
|
|
797
|
+
/**
|
|
798
|
+
* @generated from message ct_logic_uni_rev_payment.v1.AccountWithCodeValue
|
|
799
|
+
*/
|
|
800
|
+
export declare class AccountWithCodeValue extends Message<AccountWithCodeValue> {
|
|
801
|
+
/**
|
|
802
|
+
* @generated from field: int64 account_id = 1;
|
|
803
|
+
*/
|
|
804
|
+
accountId: bigint;
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* @generated from field: string code = 2;
|
|
808
|
+
*/
|
|
809
|
+
code: string;
|
|
810
|
+
|
|
811
|
+
constructor(data?: PartialMessage<AccountWithCodeValue>);
|
|
812
|
+
|
|
813
|
+
static readonly runtime: typeof proto3;
|
|
814
|
+
static readonly typeName = "ct_logic_uni_rev_payment.v1.AccountWithCodeValue";
|
|
815
|
+
static readonly fields: FieldList;
|
|
816
|
+
|
|
817
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AccountWithCodeValue;
|
|
818
|
+
|
|
819
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AccountWithCodeValue;
|
|
820
|
+
|
|
821
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AccountWithCodeValue;
|
|
822
|
+
|
|
823
|
+
static equals(a: AccountWithCodeValue | PlainMessage<AccountWithCodeValue> | undefined, b: AccountWithCodeValue | PlainMessage<AccountWithCodeValue> | undefined): boolean;
|
|
824
|
+
}
|
|
825
|
+
|
|
797
826
|
/**
|
|
798
827
|
* @generated from message ct_logic_uni_rev_payment.v1.AssignCreditPromotionCodeResponse
|
|
799
828
|
*/
|
package/crepro_campaign_pb.js
CHANGED
|
@@ -258,11 +258,22 @@ export const AssignCreditPromotionCodeRequest = proto3.makeMessageType(
|
|
|
258
258
|
"ct_logic_uni_rev_payment.v1.AssignCreditPromotionCodeRequest",
|
|
259
259
|
() => [
|
|
260
260
|
{ no: 1, name: "campaign_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
261
|
-
{ no: 2, name: "
|
|
261
|
+
{ no: 2, name: "list_assignments", kind: "message", T: AccountWithCodeValue, repeated: true },
|
|
262
262
|
{ no: 3, name: "action_by", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
263
263
|
],
|
|
264
264
|
);
|
|
265
265
|
|
|
266
|
+
/**
|
|
267
|
+
* @generated from message ct_logic_uni_rev_payment.v1.AccountWithCodeValue
|
|
268
|
+
*/
|
|
269
|
+
export const AccountWithCodeValue = proto3.makeMessageType(
|
|
270
|
+
"ct_logic_uni_rev_payment.v1.AccountWithCodeValue",
|
|
271
|
+
() => [
|
|
272
|
+
{ no: 1, name: "account_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
273
|
+
{ no: 2, name: "code", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
274
|
+
],
|
|
275
|
+
);
|
|
276
|
+
|
|
266
277
|
/**
|
|
267
278
|
* @generated from message ct_logic_uni_rev_payment.v1.AssignCreditPromotionCodeResponse
|
|
268
279
|
*/
|
package/econtract.proto
CHANGED
package/econtract_pb.d.ts
CHANGED
|
@@ -177,6 +177,11 @@ export declare class Econtract extends Message<Econtract> {
|
|
|
177
177
|
*/
|
|
178
178
|
paymentCode: string;
|
|
179
179
|
|
|
180
|
+
/**
|
|
181
|
+
* @generated from field: string encrypted_order_id = 34;
|
|
182
|
+
*/
|
|
183
|
+
encryptedOrderId: string;
|
|
184
|
+
|
|
180
185
|
constructor(data?: PartialMessage<Econtract>);
|
|
181
186
|
|
|
182
187
|
static readonly runtime: typeof proto3;
|
package/econtract_pb.js
CHANGED
|
@@ -46,6 +46,7 @@ export const Econtract = proto3.makeMessageType(
|
|
|
46
46
|
{ no: 31, name: "post_payment_info", kind: "message", T: PostPaymentInfo },
|
|
47
47
|
{ no: 32, name: "payment_expired_at", kind: "message", T: Timestamp },
|
|
48
48
|
{ no: 33, name: "payment_code", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
49
|
+
{ no: 34, name: "encrypted_order_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
49
50
|
],
|
|
50
51
|
);
|
|
51
52
|
|
package/order.proto
CHANGED
|
@@ -78,4 +78,13 @@ message ResponsePGatewayParams {
|
|
|
78
78
|
optional string session = 16;
|
|
79
79
|
optional string order_no = 17;
|
|
80
80
|
optional string checksum = 18;
|
|
81
|
-
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
message DecryptPaymentCodeRequest {
|
|
84
|
+
string ciphertext = 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message DecryptPaymentCodeResponse {
|
|
88
|
+
string payment_code = 2;
|
|
89
|
+
int64 account_id = 3;
|
|
90
|
+
}
|
package/order_pb.d.ts
CHANGED
|
@@ -370,3 +370,56 @@ export declare class ResponsePGatewayParams extends Message<ResponsePGatewayPara
|
|
|
370
370
|
static equals(a: ResponsePGatewayParams | PlainMessage<ResponsePGatewayParams> | undefined, b: ResponsePGatewayParams | PlainMessage<ResponsePGatewayParams> | undefined): boolean;
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
+
/**
|
|
374
|
+
* @generated from message ct_logic_uni_rev_payment.v1.DecryptPaymentCodeRequest
|
|
375
|
+
*/
|
|
376
|
+
export declare class DecryptPaymentCodeRequest extends Message<DecryptPaymentCodeRequest> {
|
|
377
|
+
/**
|
|
378
|
+
* @generated from field: string ciphertext = 1;
|
|
379
|
+
*/
|
|
380
|
+
ciphertext: string;
|
|
381
|
+
|
|
382
|
+
constructor(data?: PartialMessage<DecryptPaymentCodeRequest>);
|
|
383
|
+
|
|
384
|
+
static readonly runtime: typeof proto3;
|
|
385
|
+
static readonly typeName = "ct_logic_uni_rev_payment.v1.DecryptPaymentCodeRequest";
|
|
386
|
+
static readonly fields: FieldList;
|
|
387
|
+
|
|
388
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DecryptPaymentCodeRequest;
|
|
389
|
+
|
|
390
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DecryptPaymentCodeRequest;
|
|
391
|
+
|
|
392
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DecryptPaymentCodeRequest;
|
|
393
|
+
|
|
394
|
+
static equals(a: DecryptPaymentCodeRequest | PlainMessage<DecryptPaymentCodeRequest> | undefined, b: DecryptPaymentCodeRequest | PlainMessage<DecryptPaymentCodeRequest> | undefined): boolean;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* @generated from message ct_logic_uni_rev_payment.v1.DecryptPaymentCodeResponse
|
|
399
|
+
*/
|
|
400
|
+
export declare class DecryptPaymentCodeResponse extends Message<DecryptPaymentCodeResponse> {
|
|
401
|
+
/**
|
|
402
|
+
* @generated from field: string payment_code = 2;
|
|
403
|
+
*/
|
|
404
|
+
paymentCode: string;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* @generated from field: int64 account_id = 3;
|
|
408
|
+
*/
|
|
409
|
+
accountId: bigint;
|
|
410
|
+
|
|
411
|
+
constructor(data?: PartialMessage<DecryptPaymentCodeResponse>);
|
|
412
|
+
|
|
413
|
+
static readonly runtime: typeof proto3;
|
|
414
|
+
static readonly typeName = "ct_logic_uni_rev_payment.v1.DecryptPaymentCodeResponse";
|
|
415
|
+
static readonly fields: FieldList;
|
|
416
|
+
|
|
417
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DecryptPaymentCodeResponse;
|
|
418
|
+
|
|
419
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DecryptPaymentCodeResponse;
|
|
420
|
+
|
|
421
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DecryptPaymentCodeResponse;
|
|
422
|
+
|
|
423
|
+
static equals(a: DecryptPaymentCodeResponse | PlainMessage<DecryptPaymentCodeResponse> | undefined, b: DecryptPaymentCodeResponse | PlainMessage<DecryptPaymentCodeResponse> | undefined): boolean;
|
|
424
|
+
}
|
|
425
|
+
|
package/order_pb.js
CHANGED
|
@@ -121,3 +121,24 @@ export const ResponsePGatewayParams = proto3.makeMessageType(
|
|
|
121
121
|
],
|
|
122
122
|
);
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* @generated from message ct_logic_uni_rev_payment.v1.DecryptPaymentCodeRequest
|
|
126
|
+
*/
|
|
127
|
+
export const DecryptPaymentCodeRequest = proto3.makeMessageType(
|
|
128
|
+
"ct_logic_uni_rev_payment.v1.DecryptPaymentCodeRequest",
|
|
129
|
+
() => [
|
|
130
|
+
{ no: 1, name: "ciphertext", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
131
|
+
],
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @generated from message ct_logic_uni_rev_payment.v1.DecryptPaymentCodeResponse
|
|
136
|
+
*/
|
|
137
|
+
export const DecryptPaymentCodeResponse = proto3.makeMessageType(
|
|
138
|
+
"ct_logic_uni_rev_payment.v1.DecryptPaymentCodeResponse",
|
|
139
|
+
() => [
|
|
140
|
+
{ no: 2, name: "payment_code", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
141
|
+
{ no: 3, name: "account_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
142
|
+
],
|
|
143
|
+
);
|
|
144
|
+
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import { DeletePaymentTokenRequest, DeletePaymentTokenResponse, GetListMerchantB
|
|
|
10
10
|
import { PayooBankTransferIPNRequest, PayooBankTransferIPNResponse, PayooCheckPhoneAtPosRequest, PayooCheckPhoneAtPosResponse, PayooIPNRequest, PayooIPNResponse, PayooTopupAtPosRequest, PayooTopupAtPosResponse } from "./payoo_pb.js";
|
|
11
11
|
import { CheckIapIosUserConsentRequest, CheckIapIosUserConsentResponse, IosServerNotificationRequest, IosServerNotificationResponse, PostLogInAppIosRequest, PostLogInAppIosResponse, PostVerifyInAppIosRequest, PostVerifyInAppIosResponse } from "./iap_pb.js";
|
|
12
12
|
import { DeleteNapasTokenByIdRequest, DeleteNapasTokenByIdResponse, GetNapasFormByIdRequest, GetNapasFormByIdResponse, GetNapasTokensRequest, GetNapasTokensResponse, NapasIPNRequest, NapasIPNResponse, PayNapasTokenRequest, PayNapasTokenResponse, ResponseNapasByIdRequest, ResponseNapasByIdResponse } from "./napas_pb.js";
|
|
13
|
-
import { GetGatewayByOrderRequest, GetGatewayByOrderResponse, HaveAtmRequestRequest, HaveAtmRequestResponse, PaidAndWithDrawDongTotRequest, PaidAndWithDrawDongTotResponse } from "./order_pb.js";
|
|
13
|
+
import { DecryptPaymentCodeRequest, DecryptPaymentCodeResponse, GetGatewayByOrderRequest, GetGatewayByOrderResponse, HaveAtmRequestRequest, HaveAtmRequestResponse, PaidAndWithDrawDongTotRequest, PaidAndWithDrawDongTotResponse } from "./order_pb.js";
|
|
14
14
|
import { BnplCallCenterTemplateRequest, BnplCallCenterTemplateResponse, BnplPaymentLimitTemplateRequest, BnplPaymentLimitTemplateResponse, GoogleBillingPaymentMessageTemplateRequest, GoogleBillingPaymentMessageTemplateResponse, GoogleBillingPaymentPageTemplateRequest, GoogleBillingPaymentPageTemplateResponse, GoogleBillingServiceMessageTemplateRequest, GoogleBillingServiceMessageTemplateResponse } from "./template_pb.js";
|
|
15
15
|
import { FundiinIPNRequest, FundiinIPNResponse, FundiinTagsRequest, FundiinTagsResponse } from "./fundiin_pb.js";
|
|
16
16
|
import { CheckGoogleBillingOrdersRequest, CheckGoogleBillingOrdersResponse, GetGoogleBillingOrdersRequest, GetGoogleBillingOrdersResponse, GoogleBillingIPNRequest, GoogleBillingIPNResponse, GoogleBillingUnacknowledgedOrdersRequest, GoogleBillingUnacknowledgedOrdersResponse, RetryGoogleBillingOrderRequest, RetryGoogleBillingOrderResponse } from "./google_billing_pb.js";
|
|
@@ -1116,6 +1116,17 @@ export declare const LogicUniRevPaymentService: {
|
|
|
1116
1116
|
readonly O: typeof ForceMappingPaymentResponse,
|
|
1117
1117
|
readonly kind: MethodKind.Unary,
|
|
1118
1118
|
},
|
|
1119
|
+
/**
|
|
1120
|
+
* decrypt payment code
|
|
1121
|
+
*
|
|
1122
|
+
* @generated from rpc ct_logic_uni_rev_payment.v1.LogicUniRevPaymentService.DecryptPaymentCode
|
|
1123
|
+
*/
|
|
1124
|
+
readonly decryptPaymentCode: {
|
|
1125
|
+
readonly name: "DecryptPaymentCode",
|
|
1126
|
+
readonly I: typeof DecryptPaymentCodeRequest,
|
|
1127
|
+
readonly O: typeof DecryptPaymentCodeResponse,
|
|
1128
|
+
readonly kind: MethodKind.Unary,
|
|
1129
|
+
},
|
|
1119
1130
|
}
|
|
1120
1131
|
};
|
|
1121
1132
|
|
|
@@ -1237,3 +1248,4 @@ export const calculateVATopupDongtot: UnaryHooks<CalculateVATopupDongtotRequest,
|
|
|
1237
1248
|
export const getIPNStatus: UnaryHooks<GetIPNStatusRequest, GetIPNStatusResponse>;
|
|
1238
1249
|
export const validateMappingPayment: UnaryHooks<ValidateMappingPaymentRequest, ValidateMappingPaymentResponse>;
|
|
1239
1250
|
export const forceMappingPayment: UnaryHooks<ForceMappingPaymentRequest, ForceMappingPaymentResponse>;
|
|
1251
|
+
export const decryptPaymentCode: UnaryHooks<DecryptPaymentCodeRequest, DecryptPaymentCodeResponse>;
|
|
@@ -10,7 +10,7 @@ import { DeletePaymentTokenRequest, DeletePaymentTokenResponse, GetListMerchantB
|
|
|
10
10
|
import { PayooBankTransferIPNRequest, PayooBankTransferIPNResponse, PayooCheckPhoneAtPosRequest, PayooCheckPhoneAtPosResponse, PayooIPNRequest, PayooIPNResponse, PayooTopupAtPosRequest, PayooTopupAtPosResponse } from "./payoo_pb.js";
|
|
11
11
|
import { CheckIapIosUserConsentRequest, CheckIapIosUserConsentResponse, IosServerNotificationRequest, IosServerNotificationResponse, PostLogInAppIosRequest, PostLogInAppIosResponse, PostVerifyInAppIosRequest, PostVerifyInAppIosResponse } from "./iap_pb.js";
|
|
12
12
|
import { DeleteNapasTokenByIdRequest, DeleteNapasTokenByIdResponse, GetNapasFormByIdRequest, GetNapasFormByIdResponse, GetNapasTokensRequest, GetNapasTokensResponse, NapasIPNRequest, NapasIPNResponse, PayNapasTokenRequest, PayNapasTokenResponse, ResponseNapasByIdRequest, ResponseNapasByIdResponse } from "./napas_pb.js";
|
|
13
|
-
import { GetGatewayByOrderRequest, GetGatewayByOrderResponse, HaveAtmRequestRequest, HaveAtmRequestResponse, PaidAndWithDrawDongTotRequest, PaidAndWithDrawDongTotResponse } from "./order_pb.js";
|
|
13
|
+
import { DecryptPaymentCodeRequest, DecryptPaymentCodeResponse, GetGatewayByOrderRequest, GetGatewayByOrderResponse, HaveAtmRequestRequest, HaveAtmRequestResponse, PaidAndWithDrawDongTotRequest, PaidAndWithDrawDongTotResponse } from "./order_pb.js";
|
|
14
14
|
import { BnplCallCenterTemplateRequest, BnplCallCenterTemplateResponse, BnplPaymentLimitTemplateRequest, BnplPaymentLimitTemplateResponse, GoogleBillingPaymentMessageTemplateRequest, GoogleBillingPaymentMessageTemplateResponse, GoogleBillingPaymentPageTemplateRequest, GoogleBillingPaymentPageTemplateResponse, GoogleBillingServiceMessageTemplateRequest, GoogleBillingServiceMessageTemplateResponse } from "./template_pb.js";
|
|
15
15
|
import { FundiinIPNRequest, FundiinIPNResponse, FundiinTagsRequest, FundiinTagsResponse } from "./fundiin_pb.js";
|
|
16
16
|
import { CheckGoogleBillingOrdersRequest, CheckGoogleBillingOrdersResponse, GetGoogleBillingOrdersRequest, GetGoogleBillingOrdersResponse, GoogleBillingIPNRequest, GoogleBillingIPNResponse, GoogleBillingUnacknowledgedOrdersRequest, GoogleBillingUnacknowledgedOrdersResponse, RetryGoogleBillingOrderRequest, RetryGoogleBillingOrderResponse } from "./google_billing_pb.js";
|
|
@@ -1118,6 +1118,17 @@ export const LogicUniRevPaymentService = {
|
|
|
1118
1118
|
O: ForceMappingPaymentResponse,
|
|
1119
1119
|
kind: MethodKind.Unary,
|
|
1120
1120
|
},
|
|
1121
|
+
/**
|
|
1122
|
+
* decrypt payment code
|
|
1123
|
+
*
|
|
1124
|
+
* @generated from rpc ct_logic_uni_rev_payment.v1.LogicUniRevPaymentService.DecryptPaymentCode
|
|
1125
|
+
*/
|
|
1126
|
+
decryptPaymentCode: {
|
|
1127
|
+
name: "DecryptPaymentCode",
|
|
1128
|
+
I: DecryptPaymentCodeRequest,
|
|
1129
|
+
O: DecryptPaymentCodeResponse,
|
|
1130
|
+
kind: MethodKind.Unary,
|
|
1131
|
+
},
|
|
1121
1132
|
}
|
|
1122
1133
|
}
|
|
1123
1134
|
|
|
@@ -1966,3 +1977,12 @@ export const validateMappingPayment = createQueryService({
|
|
|
1966
1977
|
export const forceMappingPayment = createQueryService({
|
|
1967
1978
|
service: LogicUniRevPaymentService,
|
|
1968
1979
|
}).forceMappingPayment;
|
|
1980
|
+
|
|
1981
|
+
/**
|
|
1982
|
+
* decrypt payment code
|
|
1983
|
+
*
|
|
1984
|
+
* @generated from rpc ct_logic_uni_rev_payment.v1.LogicUniRevPaymentService.DecryptPaymentCode
|
|
1985
|
+
*/
|
|
1986
|
+
export const decryptPaymentCode = createQueryService({
|
|
1987
|
+
service: LogicUniRevPaymentService,
|
|
1988
|
+
}).decryptPaymentCode;
|
package/service.proto
CHANGED
|
@@ -640,4 +640,7 @@ service LogicUniRevPaymentService {
|
|
|
640
640
|
|
|
641
641
|
// force mapping payment to an order -> trigger a payment success event
|
|
642
642
|
rpc ForceMappingPayment(ForceMappingPaymentRequest) returns (ForceMappingPaymentResponse) {}
|
|
643
|
+
|
|
644
|
+
// decrypt payment code
|
|
645
|
+
rpc DecryptPaymentCode(DecryptPaymentCodeRequest) returns (DecryptPaymentCodeResponse) {}
|
|
643
646
|
}
|
package/service_connect.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { DeletePaymentTokenRequest, DeletePaymentTokenResponse, GetListMerchantB
|
|
|
10
10
|
import { PayooBankTransferIPNRequest, PayooBankTransferIPNResponse, PayooCheckPhoneAtPosRequest, PayooCheckPhoneAtPosResponse, PayooIPNRequest, PayooIPNResponse, PayooTopupAtPosRequest, PayooTopupAtPosResponse } from "./payoo_pb.js";
|
|
11
11
|
import { CheckIapIosUserConsentRequest, CheckIapIosUserConsentResponse, IosServerNotificationRequest, IosServerNotificationResponse, PostLogInAppIosRequest, PostLogInAppIosResponse, PostVerifyInAppIosRequest, PostVerifyInAppIosResponse } from "./iap_pb.js";
|
|
12
12
|
import { DeleteNapasTokenByIdRequest, DeleteNapasTokenByIdResponse, GetNapasFormByIdRequest, GetNapasFormByIdResponse, GetNapasTokensRequest, GetNapasTokensResponse, NapasIPNRequest, NapasIPNResponse, PayNapasTokenRequest, PayNapasTokenResponse, ResponseNapasByIdRequest, ResponseNapasByIdResponse } from "./napas_pb.js";
|
|
13
|
-
import { GetGatewayByOrderRequest, GetGatewayByOrderResponse, HaveAtmRequestRequest, HaveAtmRequestResponse, PaidAndWithDrawDongTotRequest, PaidAndWithDrawDongTotResponse } from "./order_pb.js";
|
|
13
|
+
import { DecryptPaymentCodeRequest, DecryptPaymentCodeResponse, GetGatewayByOrderRequest, GetGatewayByOrderResponse, HaveAtmRequestRequest, HaveAtmRequestResponse, PaidAndWithDrawDongTotRequest, PaidAndWithDrawDongTotResponse } from "./order_pb.js";
|
|
14
14
|
import { BnplCallCenterTemplateRequest, BnplCallCenterTemplateResponse, BnplPaymentLimitTemplateRequest, BnplPaymentLimitTemplateResponse, GoogleBillingPaymentMessageTemplateRequest, GoogleBillingPaymentMessageTemplateResponse, GoogleBillingPaymentPageTemplateRequest, GoogleBillingPaymentPageTemplateResponse, GoogleBillingServiceMessageTemplateRequest, GoogleBillingServiceMessageTemplateResponse } from "./template_pb.js";
|
|
15
15
|
import { FundiinIPNRequest, FundiinIPNResponse, FundiinTagsRequest, FundiinTagsResponse } from "./fundiin_pb.js";
|
|
16
16
|
import { CheckGoogleBillingOrdersRequest, CheckGoogleBillingOrdersResponse, GetGoogleBillingOrdersRequest, GetGoogleBillingOrdersResponse, GoogleBillingIPNRequest, GoogleBillingIPNResponse, GoogleBillingUnacknowledgedOrdersRequest, GoogleBillingUnacknowledgedOrdersResponse, RetryGoogleBillingOrderRequest, RetryGoogleBillingOrderResponse } from "./google_billing_pb.js";
|
|
@@ -1115,6 +1115,17 @@ export declare const LogicUniRevPaymentService: {
|
|
|
1115
1115
|
readonly O: typeof ForceMappingPaymentResponse,
|
|
1116
1116
|
readonly kind: MethodKind.Unary,
|
|
1117
1117
|
},
|
|
1118
|
+
/**
|
|
1119
|
+
* decrypt payment code
|
|
1120
|
+
*
|
|
1121
|
+
* @generated from rpc ct_logic_uni_rev_payment.v1.LogicUniRevPaymentService.DecryptPaymentCode
|
|
1122
|
+
*/
|
|
1123
|
+
readonly decryptPaymentCode: {
|
|
1124
|
+
readonly name: "DecryptPaymentCode",
|
|
1125
|
+
readonly I: typeof DecryptPaymentCodeRequest,
|
|
1126
|
+
readonly O: typeof DecryptPaymentCodeResponse,
|
|
1127
|
+
readonly kind: MethodKind.Unary,
|
|
1128
|
+
},
|
|
1118
1129
|
}
|
|
1119
1130
|
};
|
|
1120
1131
|
|
package/service_connect.js
CHANGED
|
@@ -10,7 +10,7 @@ import { DeletePaymentTokenRequest, DeletePaymentTokenResponse, GetListMerchantB
|
|
|
10
10
|
import { PayooBankTransferIPNRequest, PayooBankTransferIPNResponse, PayooCheckPhoneAtPosRequest, PayooCheckPhoneAtPosResponse, PayooIPNRequest, PayooIPNResponse, PayooTopupAtPosRequest, PayooTopupAtPosResponse } from "./payoo_pb.js";
|
|
11
11
|
import { CheckIapIosUserConsentRequest, CheckIapIosUserConsentResponse, IosServerNotificationRequest, IosServerNotificationResponse, PostLogInAppIosRequest, PostLogInAppIosResponse, PostVerifyInAppIosRequest, PostVerifyInAppIosResponse } from "./iap_pb.js";
|
|
12
12
|
import { DeleteNapasTokenByIdRequest, DeleteNapasTokenByIdResponse, GetNapasFormByIdRequest, GetNapasFormByIdResponse, GetNapasTokensRequest, GetNapasTokensResponse, NapasIPNRequest, NapasIPNResponse, PayNapasTokenRequest, PayNapasTokenResponse, ResponseNapasByIdRequest, ResponseNapasByIdResponse } from "./napas_pb.js";
|
|
13
|
-
import { GetGatewayByOrderRequest, GetGatewayByOrderResponse, HaveAtmRequestRequest, HaveAtmRequestResponse, PaidAndWithDrawDongTotRequest, PaidAndWithDrawDongTotResponse } from "./order_pb.js";
|
|
13
|
+
import { DecryptPaymentCodeRequest, DecryptPaymentCodeResponse, GetGatewayByOrderRequest, GetGatewayByOrderResponse, HaveAtmRequestRequest, HaveAtmRequestResponse, PaidAndWithDrawDongTotRequest, PaidAndWithDrawDongTotResponse } from "./order_pb.js";
|
|
14
14
|
import { BnplCallCenterTemplateRequest, BnplCallCenterTemplateResponse, BnplPaymentLimitTemplateRequest, BnplPaymentLimitTemplateResponse, GoogleBillingPaymentMessageTemplateRequest, GoogleBillingPaymentMessageTemplateResponse, GoogleBillingPaymentPageTemplateRequest, GoogleBillingPaymentPageTemplateResponse, GoogleBillingServiceMessageTemplateRequest, GoogleBillingServiceMessageTemplateResponse } from "./template_pb.js";
|
|
15
15
|
import { FundiinIPNRequest, FundiinIPNResponse, FundiinTagsRequest, FundiinTagsResponse } from "./fundiin_pb.js";
|
|
16
16
|
import { CheckGoogleBillingOrdersRequest, CheckGoogleBillingOrdersResponse, GetGoogleBillingOrdersRequest, GetGoogleBillingOrdersResponse, GoogleBillingIPNRequest, GoogleBillingIPNResponse, GoogleBillingUnacknowledgedOrdersRequest, GoogleBillingUnacknowledgedOrdersResponse, RetryGoogleBillingOrderRequest, RetryGoogleBillingOrderResponse } from "./google_billing_pb.js";
|
|
@@ -1115,6 +1115,17 @@ export const LogicUniRevPaymentService = {
|
|
|
1115
1115
|
O: ForceMappingPaymentResponse,
|
|
1116
1116
|
kind: MethodKind.Unary,
|
|
1117
1117
|
},
|
|
1118
|
+
/**
|
|
1119
|
+
* decrypt payment code
|
|
1120
|
+
*
|
|
1121
|
+
* @generated from rpc ct_logic_uni_rev_payment.v1.LogicUniRevPaymentService.DecryptPaymentCode
|
|
1122
|
+
*/
|
|
1123
|
+
decryptPaymentCode: {
|
|
1124
|
+
name: "DecryptPaymentCode",
|
|
1125
|
+
I: DecryptPaymentCodeRequest,
|
|
1126
|
+
O: DecryptPaymentCodeResponse,
|
|
1127
|
+
kind: MethodKind.Unary,
|
|
1128
|
+
},
|
|
1118
1129
|
}
|
|
1119
1130
|
};
|
|
1120
1131
|
|
package/transaction.proto
CHANGED
|
@@ -498,6 +498,7 @@ message ValidateMappingPaymentRequest {
|
|
|
498
498
|
int64 account_id = 3;
|
|
499
499
|
string gateway = 4;
|
|
500
500
|
string transaction_id = 5;
|
|
501
|
+
int64 amount = 7; // actual amount paid by user
|
|
501
502
|
}
|
|
502
503
|
|
|
503
504
|
message ValidateMappingPaymentResponse {}
|
|
@@ -508,6 +509,7 @@ message ForceMappingPaymentRequest {
|
|
|
508
509
|
int64 order_value = 2; // original order amount, no service fee, no tax
|
|
509
510
|
string gateway = 3;
|
|
510
511
|
string transaction_id = 4;
|
|
512
|
+
int64 amount = 5; // actual amount paid by user
|
|
511
513
|
}
|
|
512
514
|
|
|
513
515
|
message ForceMappingPaymentResponse {}
|
package/transaction_pb.d.ts
CHANGED
|
@@ -2621,6 +2621,13 @@ export declare class ValidateMappingPaymentRequest extends Message<ValidateMappi
|
|
|
2621
2621
|
*/
|
|
2622
2622
|
transactionId: string;
|
|
2623
2623
|
|
|
2624
|
+
/**
|
|
2625
|
+
* actual amount paid by user
|
|
2626
|
+
*
|
|
2627
|
+
* @generated from field: int64 amount = 7;
|
|
2628
|
+
*/
|
|
2629
|
+
amount: bigint;
|
|
2630
|
+
|
|
2624
2631
|
constructor(data?: PartialMessage<ValidateMappingPaymentRequest>);
|
|
2625
2632
|
|
|
2626
2633
|
static readonly runtime: typeof proto3;
|
|
@@ -2681,6 +2688,13 @@ export declare class ForceMappingPaymentRequest extends Message<ForceMappingPaym
|
|
|
2681
2688
|
*/
|
|
2682
2689
|
transactionId: string;
|
|
2683
2690
|
|
|
2691
|
+
/**
|
|
2692
|
+
* actual amount paid by user
|
|
2693
|
+
*
|
|
2694
|
+
* @generated from field: int64 amount = 5;
|
|
2695
|
+
*/
|
|
2696
|
+
amount: bigint;
|
|
2697
|
+
|
|
2684
2698
|
constructor(data?: PartialMessage<ForceMappingPaymentRequest>);
|
|
2685
2699
|
|
|
2686
2700
|
static readonly runtime: typeof proto3;
|
package/transaction_pb.js
CHANGED
|
@@ -822,6 +822,7 @@ export const ValidateMappingPaymentRequest = proto3.makeMessageType(
|
|
|
822
822
|
{ no: 3, name: "account_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
823
823
|
{ no: 4, name: "gateway", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
824
824
|
{ no: 5, name: "transaction_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
825
|
+
{ no: 7, name: "amount", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
825
826
|
],
|
|
826
827
|
);
|
|
827
828
|
|
|
@@ -843,6 +844,7 @@ export const ForceMappingPaymentRequest = proto3.makeMessageType(
|
|
|
843
844
|
{ no: 2, name: "order_value", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
844
845
|
{ no: 3, name: "gateway", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
845
846
|
{ no: 4, name: "transaction_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
847
|
+
{ no: 5, name: "amount", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
846
848
|
],
|
|
847
849
|
);
|
|
848
850
|
|
package/virtual_account.proto
CHANGED
|
@@ -79,6 +79,8 @@ message GetVirtualAccountResponse {
|
|
|
79
79
|
bool is_va_econtract = 6;
|
|
80
80
|
int64 account_id = 7;
|
|
81
81
|
string vendor = 8;
|
|
82
|
+
string bank_logo = 9;
|
|
83
|
+
string bank_acronym_name = 10;
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
message GetDynamicVirtualAccountRequest {
|
|
@@ -210,11 +212,13 @@ message GetVirtualAccountPaymentOrderBaseRequest {
|
|
|
210
212
|
max_len: 50,
|
|
211
213
|
in: [ "public", "private", "internal" ],
|
|
212
214
|
}];
|
|
215
|
+
string vendor = 5;
|
|
213
216
|
}
|
|
214
217
|
|
|
215
218
|
message GetVirtualAccountPaymentOrderBaseResponse {
|
|
216
219
|
GetVirtualAccountResponse va = 1;
|
|
217
220
|
VirtualAccountPaymentOrderBase payment = 2;
|
|
221
|
+
repeated string supported_vendors = 3;
|
|
218
222
|
}
|
|
219
223
|
|
|
220
224
|
message VirtualAccountPaymentOrderBase {
|
package/virtual_account_pb.d.ts
CHANGED
|
@@ -403,6 +403,16 @@ export declare class GetVirtualAccountResponse extends Message<GetVirtualAccount
|
|
|
403
403
|
*/
|
|
404
404
|
vendor: string;
|
|
405
405
|
|
|
406
|
+
/**
|
|
407
|
+
* @generated from field: string bank_logo = 9;
|
|
408
|
+
*/
|
|
409
|
+
bankLogo: string;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* @generated from field: string bank_acronym_name = 10;
|
|
413
|
+
*/
|
|
414
|
+
bankAcronymName: string;
|
|
415
|
+
|
|
406
416
|
constructor(data?: PartialMessage<GetVirtualAccountResponse>);
|
|
407
417
|
|
|
408
418
|
static readonly runtime: typeof proto3;
|
|
@@ -1117,6 +1127,11 @@ export declare class GetVirtualAccountPaymentOrderBaseRequest extends Message<Ge
|
|
|
1117
1127
|
*/
|
|
1118
1128
|
apiSource: string;
|
|
1119
1129
|
|
|
1130
|
+
/**
|
|
1131
|
+
* @generated from field: string vendor = 5;
|
|
1132
|
+
*/
|
|
1133
|
+
vendor: string;
|
|
1134
|
+
|
|
1120
1135
|
constructor(data?: PartialMessage<GetVirtualAccountPaymentOrderBaseRequest>);
|
|
1121
1136
|
|
|
1122
1137
|
static readonly runtime: typeof proto3;
|
|
@@ -1146,6 +1161,11 @@ export declare class GetVirtualAccountPaymentOrderBaseResponse extends Message<G
|
|
|
1146
1161
|
*/
|
|
1147
1162
|
payment?: VirtualAccountPaymentOrderBase;
|
|
1148
1163
|
|
|
1164
|
+
/**
|
|
1165
|
+
* @generated from field: repeated string supported_vendors = 3;
|
|
1166
|
+
*/
|
|
1167
|
+
supportedVendors: string[];
|
|
1168
|
+
|
|
1149
1169
|
constructor(data?: PartialMessage<GetVirtualAccountPaymentOrderBaseResponse>);
|
|
1150
1170
|
|
|
1151
1171
|
static readonly runtime: typeof proto3;
|
package/virtual_account_pb.js
CHANGED
|
@@ -138,6 +138,8 @@ export const GetVirtualAccountResponse = proto3.makeMessageType(
|
|
|
138
138
|
{ no: 6, name: "is_va_econtract", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
|
|
139
139
|
{ no: 7, name: "account_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
140
140
|
{ no: 8, name: "vendor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
141
|
+
{ no: 9, name: "bank_logo", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
142
|
+
{ no: 10, name: "bank_acronym_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
141
143
|
],
|
|
142
144
|
);
|
|
143
145
|
|
|
@@ -367,6 +369,7 @@ export const GetVirtualAccountPaymentOrderBaseRequest = proto3.makeMessageType(
|
|
|
367
369
|
{ no: 2, name: "order_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
368
370
|
{ no: 3, name: "account_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
369
371
|
{ no: 4, name: "api_source", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
372
|
+
{ no: 5, name: "vendor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
370
373
|
],
|
|
371
374
|
);
|
|
372
375
|
|
|
@@ -378,6 +381,7 @@ export const GetVirtualAccountPaymentOrderBaseResponse = proto3.makeMessageType(
|
|
|
378
381
|
() => [
|
|
379
382
|
{ no: 1, name: "va", kind: "message", T: GetVirtualAccountResponse },
|
|
380
383
|
{ no: 2, name: "payment", kind: "message", T: VirtualAccountPaymentOrderBase },
|
|
384
|
+
{ no: 3, name: "supported_vendors", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
|
|
381
385
|
],
|
|
382
386
|
);
|
|
383
387
|
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const fs = require('fs').promises;
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
async function modifyPackageJson() {
|
|
5
|
-
const args = process.argv.slice(2);
|
|
6
|
-
if (args.length < 4) {
|
|
7
|
-
console.error('Usage: node modify_package_json.js <packageExtractPath> <newName> <newVersion> <verdaccioHostname>');
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const packageExtractPath = args[0]; // e.g., /tmp/npm-migration-xxxxxx/package
|
|
12
|
-
const newName = args[1];
|
|
13
|
-
const newVersion = args[2];
|
|
14
|
-
const verdaccioHostname = args[3]; // e.g., npmjs.cmco.io
|
|
15
|
-
|
|
16
|
-
const packageJsonPath = path.join(packageExtractPath, 'package.json');
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
console.log(`Reading package.json from: ${packageJsonPath}`);
|
|
20
|
-
let packageJsonContent = await fs.readFile(packageJsonPath, 'utf8');
|
|
21
|
-
let packageJson = JSON.parse(packageJsonContent);
|
|
22
|
-
|
|
23
|
-
console.log(`Original name: ${packageJson.name}, version: ${packageJson.version}`);
|
|
24
|
-
|
|
25
|
-
packageJson.name = newName;
|
|
26
|
-
packageJson.version = newVersion;
|
|
27
|
-
|
|
28
|
-
// Remove publishConfig if it points to the old Verdaccio registry
|
|
29
|
-
if (packageJson.publishConfig && packageJson.publishConfig.registry) {
|
|
30
|
-
try {
|
|
31
|
-
const publishRegistryUrl = new URL(packageJson.publishConfig.registry);
|
|
32
|
-
if (publishRegistryUrl.hostname === verdaccioHostname) {
|
|
33
|
-
delete packageJson.publishConfig;
|
|
34
|
-
console.log(`Removed publishConfig pointing to ${verdaccioHostname}`);
|
|
35
|
-
}
|
|
36
|
-
} catch (e) {
|
|
37
|
-
console.warn(`Could not parse publishConfig.registry: ${packageJson.publishConfig.registry}. Skipping removal.`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
42
|
-
console.log(`Successfully modified package.json. New name: ${packageJson.name}, new version: ${packageJson.version}`);
|
|
43
|
-
|
|
44
|
-
} catch (error) {
|
|
45
|
-
console.error(`Error modifying package.json at ${packageJsonPath}:`, error);
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
modifyPackageJson();
|