@opexa/portal-sdk 0.59.55 → 0.59.57
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/README.md +1634 -1634
- package/dist/{chunk-JTAO2DVT.js → chunk-6PJLGY7R.js} +3 -3
- package/dist/chunk-6PJLGY7R.js.map +1 -0
- package/dist/{chunk-GXJX4GGR.js → chunk-E47D735T.js} +22 -3
- package/dist/chunk-E47D735T.js.map +1 -0
- package/dist/{chunk-WVFSGB7Y.js → chunk-ROBGEUSE.js} +2 -2
- package/dist/chunk-ROBGEUSE.js.map +1 -0
- package/dist/index.cjs +21 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +19 -0
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +2 -2
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.js +2 -2
- package/dist/{types-C8AKce3p.d.cts → types-DQqxKgAE.d.cts} +2 -2
- package/dist/{types-B0c9zTyG.d.ts → types-DyMrEcwn.d.ts} +2 -2
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-GXJX4GGR.js.map +0 -1
- package/dist/chunk-JTAO2DVT.js.map +0 -1
- package/dist/chunk-WVFSGB7Y.js.map +0 -1
|
@@ -39,5 +39,5 @@ function callIfFn(value, ...args) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export { callIfFn, gql, statusCodeToOperationError };
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-ROBGEUSE.js.map
|
|
43
|
+
//# sourceMappingURL=chunk-ROBGEUSE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/gql.ts","../src/utils/status-code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;AAClD,CAAA;;;ACtBA,SAAS,WACR,KAAA,EACuC;AACvC,EAAA,OAAO,OAAO,KAAA,KAAU,UAAA;AACzB;AAEO,SAAS,QAAA,CACf,UACG,IAAA,EACF;AACD,EAAA,IAAI,UAAA,CAAyB,KAAK,CAAA,EAAG;AACpC,IAAA,OAAO,KAAA,CAAM,GAAG,IAAI,CAAA;AAAA,EACrB,CAAA,MAAO;AACN,IAAA,OAAO,KAAA;AAAA,EACR;AACD","file":"chunk-ROBGEUSE.js","sourcesContent":["export function gql(strings: TemplateStringsArray, ...values: unknown[]) {\n\tlet result = '';\n\n\tfor (const [index, string] of strings.entries()) {\n\t\tconst value = values.at(index) ?? '';\n\n\t\tresult = `${result}${string}${value}`;\n\t}\n\n\treturn result.trim();\n}\n","import type { HttpError, OperationError } from '../types/index.js';\n\nexport function statusCodeToOperationError(\n\tvalue: number,\n\tmessage?: string,\n): OperationError<HttpError> {\n\tconst e = ERROR_MAP[value] ? ERROR_MAP[value] : ERROR_MAP[500];\n\n\treturn {\n\t\tname: e.name,\n\t\tmessage: message ?? e.message,\n\t};\n}\n\nconst ERROR_MAP: Record<number, OperationError<HttpError>> = {\n\t400: { name: 'HttpBadRequest', message: 'Bad Request' },\n\t401: { name: 'HttpUnauthorized', message: 'Unauthorized' },\n\t403: { name: 'HttpForbidden', message: 'Forbidden' },\n\t404: { name: 'HttpNotFound', message: 'Not Found' },\n\t408: { name: 'HttpRequestTimeout', message: 'Request Timeout' },\n\t429: { name: 'HttpTooManyRequests', message: 'Too Many Requests' },\n\t500: { name: 'HttpInternalServerError', message: 'Internal Server Error' },\n};\n","function isFunction<Return, Args = never>(\n\tvalue: unknown | ((...args: Args[]) => Return),\n): value is (...args: Args[]) => Return {\n\treturn typeof value === 'function';\n}\n\nexport function callIfFn<Return, Args = never>(\n\tvalue: Return | ((...args: Args[]) => Return),\n\t...args: Args[]\n) {\n\tif (isFunction<Return, Args>(value)) {\n\t\treturn value(...args);\n\t} else {\n\t\treturn value;\n\t}\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -925,6 +925,9 @@ var CREATE_GCASH_WEBPAY_DEPOSIT_MUTATION = gql`
|
|
|
925
925
|
... on WalletDoesNotExistError {
|
|
926
926
|
__typename
|
|
927
927
|
}
|
|
928
|
+
... on InsufficientAgentBalanceError {
|
|
929
|
+
__typename
|
|
930
|
+
}
|
|
928
931
|
}
|
|
929
932
|
}
|
|
930
933
|
`;
|
|
@@ -1006,6 +1009,9 @@ var CREATE_TEST_DEPOSIT_MUTATION = gql`
|
|
|
1006
1009
|
... on WalletDoesNotExistError {
|
|
1007
1010
|
__typename
|
|
1008
1011
|
}
|
|
1012
|
+
... on InsufficientAgentBalanceError {
|
|
1013
|
+
__typename
|
|
1014
|
+
}
|
|
1009
1015
|
}
|
|
1010
1016
|
}
|
|
1011
1017
|
`;
|
|
@@ -1090,6 +1096,9 @@ var CREATE_AIO_GCASH_DEPOSIT_MUTATION = gql`
|
|
|
1090
1096
|
... on WalletDoesNotExistError {
|
|
1091
1097
|
__typename
|
|
1092
1098
|
}
|
|
1099
|
+
... on InsufficientAgentBalanceError {
|
|
1100
|
+
__typename
|
|
1101
|
+
}
|
|
1093
1102
|
}
|
|
1094
1103
|
}
|
|
1095
1104
|
`;
|
|
@@ -1117,6 +1126,9 @@ var CREATE_AIO_PAY_MAYA_DEPOSIT_MUTATION = gql`
|
|
|
1117
1126
|
... on WalletDoesNotExistError {
|
|
1118
1127
|
__typename
|
|
1119
1128
|
}
|
|
1129
|
+
... on InsufficientAgentBalanceError {
|
|
1130
|
+
__typename
|
|
1131
|
+
}
|
|
1120
1132
|
}
|
|
1121
1133
|
}
|
|
1122
1134
|
`;
|
|
@@ -1144,6 +1156,9 @@ var CREATE_AIO_GRAB_PAY_DEPOSIT_MUTATION = gql`
|
|
|
1144
1156
|
... on WalletDoesNotExistError {
|
|
1145
1157
|
__typename
|
|
1146
1158
|
}
|
|
1159
|
+
... on InsufficientAgentBalanceError {
|
|
1160
|
+
__typename
|
|
1161
|
+
}
|
|
1147
1162
|
}
|
|
1148
1163
|
}
|
|
1149
1164
|
`;
|
|
@@ -1173,6 +1188,9 @@ var CREATE_AIO_PALAWAN_PAY_DEPOSIT_MUTATION = gql`
|
|
|
1173
1188
|
... on WalletDoesNotExistError {
|
|
1174
1189
|
__typename
|
|
1175
1190
|
}
|
|
1191
|
+
... on InsufficientAgentBalanceError {
|
|
1192
|
+
__typename
|
|
1193
|
+
}
|
|
1176
1194
|
}
|
|
1177
1195
|
}
|
|
1178
1196
|
`;
|
|
@@ -3718,6 +3736,7 @@ function createOperationError(code) {
|
|
|
3718
3736
|
RateLimitExceededError: "Maximum number of requests reached",
|
|
3719
3737
|
RewardAlreadyClaimedError: "Reward is already claimed",
|
|
3720
3738
|
ReCAPTCHAVerificationFailedError: "Invalid reCAPTCHA",
|
|
3739
|
+
InsufficientAgentBalanceError: "Insufficient agent balance",
|
|
3721
3740
|
AccountSuspendedError: "Account is suspended",
|
|
3722
3741
|
TransactionPasswordNotSetError: "Transaction password is not set",
|
|
3723
3742
|
UPIReferenceNotAvailableError: "UPI reference is no longer available",
|
|
@@ -6734,11 +6753,10 @@ function parseFbCxd(input) {
|
|
|
6734
6753
|
return { cxd, fbAdditionalCxd };
|
|
6735
6754
|
}
|
|
6736
6755
|
var thumbmark_instance;
|
|
6737
|
-
async function getFingerprint(
|
|
6756
|
+
async function getFingerprint() {
|
|
6738
6757
|
if (typeof window === "undefined") return null;
|
|
6739
6758
|
if (!thumbmark_instance) {
|
|
6740
6759
|
thumbmark_instance = new thumbmarkjs.Thumbmark({
|
|
6741
|
-
api_key: environment === "production" ? "8294c227c5194f96e4deb022e8e76293" : void 0,
|
|
6742
6760
|
logging: false,
|
|
6743
6761
|
timeout: 3e4,
|
|
6744
6762
|
cache_lifetime_in_ms: 1 * 60 * 60 * 1e3
|
|
@@ -9724,7 +9742,7 @@ var Sdk = class {
|
|
|
9724
9742
|
};
|
|
9725
9743
|
}
|
|
9726
9744
|
async fingerprint() {
|
|
9727
|
-
return await getFingerprint(
|
|
9745
|
+
return await getFingerprint();
|
|
9728
9746
|
}
|
|
9729
9747
|
get miscMiddleware() {
|
|
9730
9748
|
return async (request) => {
|