@nadohq/mobile-client 0.27.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/README.md +73 -0
- package/dist/MobileClient-9JSAzblH.cjs +218 -0
- package/dist/MobileClient-9JSAzblH.cjs.map +1 -0
- package/dist/MobileClient.cjs +4 -0
- package/dist/MobileClient.d.cts +114 -0
- package/dist/MobileClient.d.cts.map +1 -0
- package/dist/MobileClient.d.ts +114 -0
- package/dist/MobileClient.d.ts.map +1 -0
- package/dist/MobileClient.js +185 -0
- package/dist/MobileClient.js.map +1 -0
- package/dist/MobileServerFailureError-Belp_yef.d.cts +25 -0
- package/dist/MobileServerFailureError-Belp_yef.d.cts.map +1 -0
- package/dist/MobileServerFailureError-DqM0T6CB.d.ts +25 -0
- package/dist/MobileServerFailureError-DqM0T6CB.d.ts.map +1 -0
- package/dist/buildSignedMobileRequest-BsbBkU0K.d.cts +14 -0
- package/dist/buildSignedMobileRequest-BsbBkU0K.d.cts.map +1 -0
- package/dist/buildSignedMobileRequest-CDRsRNHm.d.ts +14 -0
- package/dist/buildSignedMobileRequest-CDRsRNHm.d.ts.map +1 -0
- package/dist/canonicalize-Dm7sXwPg.d.cts +14 -0
- package/dist/canonicalize-Dm7sXwPg.d.cts.map +1 -0
- package/dist/canonicalize-PX6dTIdF.d.ts +14 -0
- package/dist/canonicalize-PX6dTIdF.d.ts.map +1 -0
- package/dist/clientTypes-DWW2N66c.d.ts +168 -0
- package/dist/clientTypes-DWW2N66c.d.ts.map +1 -0
- package/dist/clientTypes-Et0PUa2d.d.cts +168 -0
- package/dist/clientTypes-Et0PUa2d.d.cts.map +1 -0
- package/dist/dataMappers.cjs +89 -0
- package/dist/dataMappers.cjs.map +1 -0
- package/dist/dataMappers.d.cts +27 -0
- package/dist/dataMappers.d.cts.map +1 -0
- package/dist/dataMappers.d.ts +27 -0
- package/dist/dataMappers.d.ts.map +1 -0
- package/dist/dataMappers.js +84 -0
- package/dist/dataMappers.js.map +1 -0
- package/dist/eip712MethodByType-DJgXal9r.d.ts +10 -0
- package/dist/eip712MethodByType-DJgXal9r.d.ts.map +1 -0
- package/dist/eip712MethodByType-DLh9MRsD.d.cts +10 -0
- package/dist/eip712MethodByType-DLh9MRsD.d.cts.map +1 -0
- package/dist/endpoints.cjs +14 -0
- package/dist/endpoints.cjs.map +1 -0
- package/dist/endpoints.d.cts +10 -0
- package/dist/endpoints.d.cts.map +1 -0
- package/dist/endpoints.d.ts +10 -0
- package/dist/endpoints.d.ts.map +1 -0
- package/dist/endpoints.js +13 -0
- package/dist/endpoints.js.map +1 -0
- package/dist/index.cjs +27 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +15 -0
- package/dist/mobileErrorCodes-D8KzJXbU.d.cts +29 -0
- package/dist/mobileErrorCodes-D8KzJXbU.d.cts.map +1 -0
- package/dist/mobileErrorCodes-DM09jnNe.d.ts +29 -0
- package/dist/mobileErrorCodes-DM09jnNe.d.ts.map +1 -0
- package/dist/nonce-DCOrXXkQ.d.ts +15 -0
- package/dist/nonce-DCOrXXkQ.d.ts.map +1 -0
- package/dist/nonce-zGyisRlj.d.cts +15 -0
- package/dist/nonce-zGyisRlj.d.cts.map +1 -0
- package/dist/patterns-B9J2ldpx.d.cts +8 -0
- package/dist/patterns-B9J2ldpx.d.cts.map +1 -0
- package/dist/patterns-BbxH3_VA.d.ts +8 -0
- package/dist/patterns-BbxH3_VA.d.ts.map +1 -0
- package/dist/payloadHash-Bmhzs78N.d.ts +13 -0
- package/dist/payloadHash-Bmhzs78N.d.ts.map +1 -0
- package/dist/payloadHash-nj8WuLUP.d.cts +13 -0
- package/dist/payloadHash-nj8WuLUP.d.cts.map +1 -0
- package/dist/serverBaseTypes-BicXMrZV.d.cts +43 -0
- package/dist/serverBaseTypes-BicXMrZV.d.cts.map +1 -0
- package/dist/serverBaseTypes-ewbo8l4R.d.ts +43 -0
- package/dist/serverBaseTypes-ewbo8l4R.d.ts.map +1 -0
- package/dist/serverExecuteTypes-CXnMjKnt.d.ts +11 -0
- package/dist/serverExecuteTypes-CXnMjKnt.d.ts.map +1 -0
- package/dist/serverExecuteTypes-DKYK1V7C.d.cts +11 -0
- package/dist/serverExecuteTypes-DKYK1V7C.d.cts.map +1 -0
- package/dist/serverModelTypes-CQgfqgW3.d.cts +69 -0
- package/dist/serverModelTypes-CQgfqgW3.d.cts.map +1 -0
- package/dist/serverModelTypes-vEPhHIit.d.ts +69 -0
- package/dist/serverModelTypes-vEPhHIit.d.ts.map +1 -0
- package/dist/serverQueryTypes-BI-2TD8F.d.ts +53 -0
- package/dist/serverQueryTypes-BI-2TD8F.d.ts.map +1 -0
- package/dist/serverQueryTypes-D7Yharse.d.cts +53 -0
- package/dist/serverQueryTypes-D7Yharse.d.cts.map +1 -0
- package/dist/serverResponseGuards-C_vZIgGl.d.ts +16 -0
- package/dist/serverResponseGuards-C_vZIgGl.d.ts.map +1 -0
- package/dist/serverResponseGuards-DjCNL3CR.d.cts +16 -0
- package/dist/serverResponseGuards-DjCNL3CR.d.cts.map +1 -0
- package/dist/signing/buildSignedMobileRequest.cjs +47 -0
- package/dist/signing/buildSignedMobileRequest.cjs.map +1 -0
- package/dist/signing/buildSignedMobileRequest.d.cts +2 -0
- package/dist/signing/buildSignedMobileRequest.d.ts +2 -0
- package/dist/signing/buildSignedMobileRequest.js +45 -0
- package/dist/signing/buildSignedMobileRequest.js.map +1 -0
- package/dist/signing/canonicalize.cjs +68 -0
- package/dist/signing/canonicalize.cjs.map +1 -0
- package/dist/signing/canonicalize.d.cts +2 -0
- package/dist/signing/canonicalize.d.ts +2 -0
- package/dist/signing/canonicalize.js +67 -0
- package/dist/signing/canonicalize.js.map +1 -0
- package/dist/signing/eip712MethodByType.cjs +20 -0
- package/dist/signing/eip712MethodByType.cjs.map +1 -0
- package/dist/signing/eip712MethodByType.d.cts +2 -0
- package/dist/signing/eip712MethodByType.d.ts +2 -0
- package/dist/signing/eip712MethodByType.js +19 -0
- package/dist/signing/eip712MethodByType.js.map +1 -0
- package/dist/signing/index.cjs +11 -0
- package/dist/signing/index.d.cts +7 -0
- package/dist/signing/index.d.ts +7 -0
- package/dist/signing/index.js +6 -0
- package/dist/signing/nonce.cjs +19 -0
- package/dist/signing/nonce.cjs.map +1 -0
- package/dist/signing/nonce.d.cts +2 -0
- package/dist/signing/nonce.d.ts +2 -0
- package/dist/signing/nonce.js +18 -0
- package/dist/signing/nonce.js.map +1 -0
- package/dist/signing/payloadHash.cjs +17 -0
- package/dist/signing/payloadHash.cjs.map +1 -0
- package/dist/signing/payloadHash.d.cts +2 -0
- package/dist/signing/payloadHash.d.ts +2 -0
- package/dist/signing/payloadHash.js +15 -0
- package/dist/signing/payloadHash.js.map +1 -0
- package/dist/signing/types.cjs +0 -0
- package/dist/signing/types.d.cts +2 -0
- package/dist/signing/types.d.ts +2 -0
- package/dist/signing/types.js +1 -0
- package/dist/types/MobileServerFailureError.cjs +17 -0
- package/dist/types/MobileServerFailureError.cjs.map +1 -0
- package/dist/types/MobileServerFailureError.d.cts +2 -0
- package/dist/types/MobileServerFailureError.d.ts +2 -0
- package/dist/types/MobileServerFailureError.js +16 -0
- package/dist/types/MobileServerFailureError.js.map +1 -0
- package/dist/types/clientTypes.cjs +0 -0
- package/dist/types/clientTypes.d.cts +2 -0
- package/dist/types/clientTypes.d.ts +2 -0
- package/dist/types/clientTypes.js +1 -0
- package/dist/types/index.cjs +5 -0
- package/dist/types/index.d.cts +8 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.js +3 -0
- package/dist/types/mobileErrorCodes.cjs +27 -0
- package/dist/types/mobileErrorCodes.cjs.map +1 -0
- package/dist/types/mobileErrorCodes.d.cts +2 -0
- package/dist/types/mobileErrorCodes.d.ts +2 -0
- package/dist/types/mobileErrorCodes.js +26 -0
- package/dist/types/mobileErrorCodes.js.map +1 -0
- package/dist/types/serverBaseTypes.cjs +0 -0
- package/dist/types/serverBaseTypes.d.cts +2 -0
- package/dist/types/serverBaseTypes.d.ts +2 -0
- package/dist/types/serverBaseTypes.js +1 -0
- package/dist/types/serverExecuteTypes.cjs +0 -0
- package/dist/types/serverExecuteTypes.d.cts +2 -0
- package/dist/types/serverExecuteTypes.d.ts +2 -0
- package/dist/types/serverExecuteTypes.js +1 -0
- package/dist/types/serverModelTypes.cjs +0 -0
- package/dist/types/serverModelTypes.d.cts +2 -0
- package/dist/types/serverModelTypes.d.ts +2 -0
- package/dist/types/serverModelTypes.js +1 -0
- package/dist/types/serverQueryTypes.cjs +0 -0
- package/dist/types/serverQueryTypes.d.cts +2 -0
- package/dist/types/serverQueryTypes.d.ts +2 -0
- package/dist/types/serverQueryTypes.js +1 -0
- package/dist/types-B76Pn7Sy.d.ts +73 -0
- package/dist/types-B76Pn7Sy.d.ts.map +1 -0
- package/dist/types-uCD4BNZR.d.cts +73 -0
- package/dist/types-uCD4BNZR.d.cts.map +1 -0
- package/dist/utils/index.cjs +6 -0
- package/dist/utils/index.d.cts +3 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/patterns.cjs +10 -0
- package/dist/utils/patterns.cjs.map +1 -0
- package/dist/utils/patterns.d.cts +2 -0
- package/dist/utils/patterns.d.ts +2 -0
- package/dist/utils/patterns.js +9 -0
- package/dist/utils/patterns.js.map +1 -0
- package/dist/utils/serverResponseGuards.cjs +19 -0
- package/dist/utils/serverResponseGuards.cjs.map +1 -0
- package/dist/utils/serverResponseGuards.d.cts +2 -0
- package/dist/utils/serverResponseGuards.d.ts +2 -0
- package/dist/utils/serverResponseGuards.js +17 -0
- package/dist/utils/serverResponseGuards.js.map +1 -0
- package/package.json +58 -0
- package/src/MobileClient.ts +395 -0
- package/src/dataMappers.ts +106 -0
- package/src/endpoints.ts +10 -0
- package/src/index.ts +5 -0
- package/src/signing/buildSignedMobileRequest.ts +58 -0
- package/src/signing/canonicalize.ts +69 -0
- package/src/signing/eip712MethodByType.ts +19 -0
- package/src/signing/index.ts +6 -0
- package/src/signing/nonce.ts +16 -0
- package/src/signing/payloadHash.ts +12 -0
- package/src/signing/signing.test.ts +224 -0
- package/src/signing/types.ts +71 -0
- package/src/types/MobileServerFailureError.ts +18 -0
- package/src/types/clientTypes.ts +182 -0
- package/src/types/index.ts +7 -0
- package/src/types/mobileErrorCodes.ts +27 -0
- package/src/types/serverBaseTypes.ts +43 -0
- package/src/types/serverExecuteTypes.ts +12 -0
- package/src/types/serverModelTypes.ts +74 -0
- package/src/types/serverQueryTypes.ts +74 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/patterns.ts +4 -0
- package/src/utils/serverResponseGuards.ts +27 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { a as MobileServerNotificationPreferenceScope, c as MobileServerRegisteredDevice, i as MobileServerNotificationCategoryPreference, n as MobileNotificationPlatform, o as MobileServerNotificationPreferences, r as MobileServerIdentity, s as MobileServerProfile, t as MobileNotificationCategory } from "../serverModelTypes-vEPhHIit.js";
|
|
2
|
+
import { _ as MobileUpdateNotificationPreferencesParams, a as GetMobileUsernameAvailabilityParams, c as MobileNotificationCategoryPreference, d as MobilePublicProfile, f as MobileRegisterExpoTokenParams, g as MobileUnregisterExpoTokenParams, h as MobileSignedRequestParams, i as GetMobileSelfIdentityParams, l as MobileNotificationPreferenceScope, m as MobileSetPrivateModeParams, n as GetMobilePublicProfileParams, o as MobileClaimUsernameParams, p as MobileRegisteredDevice, r as GetMobileRegisteredDevicesParams, s as MobileIdentity, t as GetMobileNotificationPreferencesParams, u as MobileNotificationPreferences, v as MobileUpdateUsernameParams, y as MobileUsernameAvailability } from "../clientTypes-DWW2N66c.js";
|
|
3
|
+
import { a as MobileServerSuccessResponse, i as MobileServerRequestType, n as MobileServerPublicQueryParamsByType, r as MobileServerPublicQueryType, t as MobileServerFailureResponse } from "../serverBaseTypes-ewbo8l4R.js";
|
|
4
|
+
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "../mobileErrorCodes-DM09jnNe.js";
|
|
5
|
+
import { t as MobileServerFailureError } from "../MobileServerFailureError-DqM0T6CB.js";
|
|
6
|
+
import { t as MobileServerExecuteResult } from "../serverExecuteTypes-CXnMjKnt.js";
|
|
7
|
+
import { a as MobileServerRegisteredDevicesResponse, c as MobileServerUsernameAvailabilityResponse, i as MobileServerPublicQueryRequest, n as MobileServerProfileRequest, o as MobileServerSelfIdentityResponse, r as MobileServerProfileResponse, s as MobileServerUsernameAvailabilityRequest, t as MobileServerNotificationPreferencesResponse } from "../serverQueryTypes-BI-2TD8F.js";
|
|
8
|
+
export { GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MOBILE_ERROR_CODES, MobileClaimUsernameParams, MobileErrorCode, MobileIdentity, MobileNotificationCategory, MobileNotificationCategoryPreference, MobileNotificationPlatform, MobileNotificationPreferenceScope, MobileNotificationPreferences, MobilePublicProfile, MobileRegisterExpoTokenParams, MobileRegisteredDevice, MobileServerExecuteResult, MobileServerFailureError, MobileServerFailureResponse, MobileServerIdentity, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerNotificationPreferencesResponse, MobileServerProfile, MobileServerProfileRequest, MobileServerProfileResponse, MobileServerPublicQueryParamsByType, MobileServerPublicQueryRequest, MobileServerPublicQueryType, MobileServerRegisteredDevice, MobileServerRegisteredDevicesResponse, MobileServerRequestType, MobileServerSelfIdentityResponse, MobileServerSuccessResponse, MobileServerUsernameAvailabilityRequest, MobileServerUsernameAvailabilityResponse, MobileSetPrivateModeParams, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUpdateUsernameParams, MobileUsernameAvailability };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/types/mobileErrorCodes.ts
|
|
3
|
+
/**
|
|
4
|
+
* Numeric error codes returned by the mobile service API. Identity codes (61xx) and notification codes
|
|
5
|
+
* (62xx) are mobile-specific; the remaining codes are shared cross-service codes from the backend's common
|
|
6
|
+
* error enum.
|
|
7
|
+
*/
|
|
8
|
+
const MOBILE_ERROR_CODES = {
|
|
9
|
+
NOT_IMPLEMENTED: 4001,
|
|
10
|
+
INVALID_SIGNER: 2028,
|
|
11
|
+
SERVICE_UNAVAILABLE: 1006,
|
|
12
|
+
INVALID_DISPLAY_NAME: 6100,
|
|
13
|
+
USERNAME_UNAVAILABLE: 6101,
|
|
14
|
+
IDENTITY_ALREADY_CLAIMED: 6102,
|
|
15
|
+
IDENTITY_REQUIRED: 6103,
|
|
16
|
+
INVALID_IDENTITY_TARGET: 6104,
|
|
17
|
+
STALE_IDENTITY_UPDATE: 6105,
|
|
18
|
+
PROFILE_NOT_FOUND: 6106,
|
|
19
|
+
INVALID_EXPO_TOKEN: 6200,
|
|
20
|
+
INVALID_DEVICE_METADATA: 6201,
|
|
21
|
+
INVALID_PREFERENCES: 6202,
|
|
22
|
+
INTERNAL_ERROR: 5e3
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.MOBILE_ERROR_CODES = MOBILE_ERROR_CODES;
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=mobileErrorCodes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobileErrorCodes.cjs","names":[],"sources":["../../src/types/mobileErrorCodes.ts"],"sourcesContent":["/**\n * Numeric error codes returned by the mobile service API. Identity codes (61xx) and notification codes\n * (62xx) are mobile-specific; the remaining codes are shared cross-service codes from the backend's common\n * error enum.\n */\nexport const MOBILE_ERROR_CODES = {\n NOT_IMPLEMENTED: 4001,\n INVALID_SIGNER: 2028,\n SERVICE_UNAVAILABLE: 1006,\n INVALID_DISPLAY_NAME: 6100,\n USERNAME_UNAVAILABLE: 6101,\n IDENTITY_ALREADY_CLAIMED: 6102,\n IDENTITY_REQUIRED: 6103,\n INVALID_IDENTITY_TARGET: 6104,\n STALE_IDENTITY_UPDATE: 6105,\n PROFILE_NOT_FOUND: 6106,\n INVALID_EXPO_TOKEN: 6200,\n INVALID_DEVICE_METADATA: 6201,\n INVALID_PREFERENCES: 6202,\n INTERNAL_ERROR: 5000,\n} as const;\n\n/**\n * Union of all known mobile service API error codes.\n */\nexport type MobileErrorCode =\n (typeof MOBILE_ERROR_CODES)[keyof typeof MOBILE_ERROR_CODES];\n"],"mappings":";;;;;;;AAKA,MAAa,qBAAqB;CAChC,iBAAiB;CACjB,gBAAgB;CAChB,qBAAqB;CACrB,sBAAsB;CACtB,sBAAsB;CACtB,0BAA0B;CAC1B,mBAAmB;CACnB,yBAAyB;CACzB,uBAAuB;CACvB,mBAAmB;CACnB,oBAAoB;CACpB,yBAAyB;CACzB,qBAAqB;CACrB,gBAAgB;AAClB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/types/mobileErrorCodes.ts
|
|
2
|
+
/**
|
|
3
|
+
* Numeric error codes returned by the mobile service API. Identity codes (61xx) and notification codes
|
|
4
|
+
* (62xx) are mobile-specific; the remaining codes are shared cross-service codes from the backend's common
|
|
5
|
+
* error enum.
|
|
6
|
+
*/
|
|
7
|
+
const MOBILE_ERROR_CODES = {
|
|
8
|
+
NOT_IMPLEMENTED: 4001,
|
|
9
|
+
INVALID_SIGNER: 2028,
|
|
10
|
+
SERVICE_UNAVAILABLE: 1006,
|
|
11
|
+
INVALID_DISPLAY_NAME: 6100,
|
|
12
|
+
USERNAME_UNAVAILABLE: 6101,
|
|
13
|
+
IDENTITY_ALREADY_CLAIMED: 6102,
|
|
14
|
+
IDENTITY_REQUIRED: 6103,
|
|
15
|
+
INVALID_IDENTITY_TARGET: 6104,
|
|
16
|
+
STALE_IDENTITY_UPDATE: 6105,
|
|
17
|
+
PROFILE_NOT_FOUND: 6106,
|
|
18
|
+
INVALID_EXPO_TOKEN: 6200,
|
|
19
|
+
INVALID_DEVICE_METADATA: 6201,
|
|
20
|
+
INVALID_PREFERENCES: 6202,
|
|
21
|
+
INTERNAL_ERROR: 5e3
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { MOBILE_ERROR_CODES };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=mobileErrorCodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobileErrorCodes.js","names":[],"sources":["../../src/types/mobileErrorCodes.ts"],"sourcesContent":["/**\n * Numeric error codes returned by the mobile service API. Identity codes (61xx) and notification codes\n * (62xx) are mobile-specific; the remaining codes are shared cross-service codes from the backend's common\n * error enum.\n */\nexport const MOBILE_ERROR_CODES = {\n NOT_IMPLEMENTED: 4001,\n INVALID_SIGNER: 2028,\n SERVICE_UNAVAILABLE: 1006,\n INVALID_DISPLAY_NAME: 6100,\n USERNAME_UNAVAILABLE: 6101,\n IDENTITY_ALREADY_CLAIMED: 6102,\n IDENTITY_REQUIRED: 6103,\n INVALID_IDENTITY_TARGET: 6104,\n STALE_IDENTITY_UPDATE: 6105,\n PROFILE_NOT_FOUND: 6106,\n INVALID_EXPO_TOKEN: 6200,\n INVALID_DEVICE_METADATA: 6201,\n INVALID_PREFERENCES: 6202,\n INTERNAL_ERROR: 5000,\n} as const;\n\n/**\n * Union of all known mobile service API error codes.\n */\nexport type MobileErrorCode =\n (typeof MOBILE_ERROR_CODES)[keyof typeof MOBILE_ERROR_CODES];\n"],"mappings":";;;;;;AAKA,MAAa,qBAAqB;CAChC,iBAAiB;CACjB,gBAAgB;CAChB,qBAAqB;CACrB,sBAAsB;CACtB,sBAAsB;CACtB,0BAA0B;CAC1B,mBAAmB;CACnB,yBAAyB;CACzB,uBAAuB;CACvB,mBAAmB;CACnB,oBAAoB;CACpB,yBAAyB;CACzB,qBAAqB;CACrB,gBAAgB;AAClB"}
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as MobileServerSuccessResponse, i as MobileServerRequestType, n as MobileServerPublicQueryParamsByType, r as MobileServerPublicQueryType, t as MobileServerFailureResponse } from "../serverBaseTypes-BicXMrZV.cjs";
|
|
2
|
+
export { MobileServerFailureResponse, MobileServerPublicQueryParamsByType, MobileServerPublicQueryType, MobileServerRequestType, MobileServerSuccessResponse };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as MobileServerSuccessResponse, i as MobileServerRequestType, n as MobileServerPublicQueryParamsByType, r as MobileServerPublicQueryType, t as MobileServerFailureResponse } from "../serverBaseTypes-ewbo8l4R.js";
|
|
2
|
+
export { MobileServerFailureResponse, MobileServerPublicQueryParamsByType, MobileServerPublicQueryType, MobileServerRequestType, MobileServerSuccessResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as MobileServerNotificationPreferenceScope, c as MobileServerRegisteredDevice, i as MobileServerNotificationCategoryPreference, n as MobileNotificationPlatform, o as MobileServerNotificationPreferences, r as MobileServerIdentity, s as MobileServerProfile, t as MobileNotificationCategory } from "../serverModelTypes-CQgfqgW3.cjs";
|
|
2
|
+
export { MobileNotificationCategory, MobileNotificationPlatform, MobileServerIdentity, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerProfile, MobileServerRegisteredDevice };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as MobileServerNotificationPreferenceScope, c as MobileServerRegisteredDevice, i as MobileServerNotificationCategoryPreference, n as MobileNotificationPlatform, o as MobileServerNotificationPreferences, r as MobileServerIdentity, s as MobileServerProfile, t as MobileNotificationCategory } from "../serverModelTypes-vEPhHIit.js";
|
|
2
|
+
export { MobileNotificationCategory, MobileNotificationPlatform, MobileServerIdentity, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerProfile, MobileServerRegisteredDevice };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as MobileServerRegisteredDevicesResponse, c as MobileServerUsernameAvailabilityResponse, i as MobileServerPublicQueryRequest, n as MobileServerProfileRequest, o as MobileServerSelfIdentityResponse, r as MobileServerProfileResponse, s as MobileServerUsernameAvailabilityRequest, t as MobileServerNotificationPreferencesResponse } from "../serverQueryTypes-D7Yharse.cjs";
|
|
2
|
+
export { MobileServerNotificationPreferencesResponse, MobileServerProfileRequest, MobileServerProfileResponse, MobileServerPublicQueryRequest, MobileServerRegisteredDevicesResponse, MobileServerSelfIdentityResponse, MobileServerUsernameAvailabilityRequest, MobileServerUsernameAvailabilityResponse };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as MobileServerRegisteredDevicesResponse, c as MobileServerUsernameAvailabilityResponse, i as MobileServerPublicQueryRequest, n as MobileServerProfileRequest, o as MobileServerSelfIdentityResponse, r as MobileServerProfileResponse, s as MobileServerUsernameAvailabilityRequest, t as MobileServerNotificationPreferencesResponse } from "../serverQueryTypes-BI-2TD8F.js";
|
|
2
|
+
export { MobileServerNotificationPreferencesResponse, MobileServerProfileRequest, MobileServerProfileResponse, MobileServerPublicQueryRequest, MobileServerRegisteredDevicesResponse, MobileServerSelfIdentityResponse, MobileServerUsernameAvailabilityRequest, MobileServerUsernameAvailabilityResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { n as MobileNotificationPlatform, o as MobileServerNotificationPreferences } from "./serverModelTypes-vEPhHIit.js";
|
|
2
|
+
import { h as MobileSignedRequestParams } from "./clientTypes-DWW2N66c.js";
|
|
3
|
+
import { WalletClientWithAccount } from "@nadohq/shared";
|
|
4
|
+
import { Hex } from "viem";
|
|
5
|
+
|
|
6
|
+
//#region src/signing/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Unsigned inner payloads that can be authenticated against the mobile service API.
|
|
9
|
+
*
|
|
10
|
+
* Key order is significant: the payload hash is `keccak256(msgpack(inner))`, and msgpack encodes object keys
|
|
11
|
+
* in insertion order, so every field of every sub-type must be serialized in the exact order the backend
|
|
12
|
+
* declares its structs — `type` first, then the remaining fields — or the hash won't match and signature
|
|
13
|
+
* verification fails. This type only describes the shape; the authoritative runtime key order is enforced by
|
|
14
|
+
* {@link canonicalizeMobileInner}, which is the source of truth. Keep the field order here in sync with it.
|
|
15
|
+
*/
|
|
16
|
+
type MobileSignedInner = {
|
|
17
|
+
type: 'claim_username';
|
|
18
|
+
display_name: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'update_username';
|
|
21
|
+
display_name: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'set_private_mode';
|
|
24
|
+
private_mode: boolean;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'self_identity';
|
|
27
|
+
} | {
|
|
28
|
+
type: 'register_expo_token';
|
|
29
|
+
expo_token: string;
|
|
30
|
+
platform: MobileNotificationPlatform;
|
|
31
|
+
locale: string | null;
|
|
32
|
+
app_version: string | null;
|
|
33
|
+
} | {
|
|
34
|
+
type: 'unregister_expo_token';
|
|
35
|
+
expo_token: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'update_preferences';
|
|
38
|
+
preferences: MobileServerNotificationPreferences;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'notification_preferences';
|
|
41
|
+
} | {
|
|
42
|
+
type: 'registered_devices';
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Type-specific payload fields for a signed inner request of a given `type` (the inner payload without its
|
|
46
|
+
* `type` tag). Derived from {@link MobileSignedInner} so the two never drift apart.
|
|
47
|
+
*/
|
|
48
|
+
type MobileSignedInnerParams<T extends MobileSignedInner['type']> = Omit<Extract<MobileSignedInner, {
|
|
49
|
+
type: T;
|
|
50
|
+
}>, 'type'>;
|
|
51
|
+
/**
|
|
52
|
+
* A signed mobile service API request body: the inner payload flattened with its signature, sender, and
|
|
53
|
+
* nonce (unlike the engine client, which wraps params under a `{ [type]: params }` key).
|
|
54
|
+
*/
|
|
55
|
+
type MobileSignedRequest<T extends MobileSignedInner = MobileSignedInner> = T & {
|
|
56
|
+
signature: Hex;
|
|
57
|
+
sender: Hex;
|
|
58
|
+
nonce: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Params for {@link buildSignedMobileRequest}.
|
|
62
|
+
*/
|
|
63
|
+
interface BuildSignedMobileRequestParams extends MobileSignedRequestParams {
|
|
64
|
+
walletClient: WalletClientWithAccount;
|
|
65
|
+
inner: MobileSignedInner;
|
|
66
|
+
/**
|
|
67
|
+
* Overrides the generated nonce; mainly useful for tests that pin the signed payload.
|
|
68
|
+
*/
|
|
69
|
+
nonce?: bigint;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { MobileSignedRequest as i, MobileSignedInner as n, MobileSignedInnerParams as r, BuildSignedMobileRequestParams as t };
|
|
73
|
+
//# sourceMappingURL=types-B76Pn7Sy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-B76Pn7Sy.d.ts","names":[],"sources":["../src/signing/src/signing/types.ts"],"mappings":";;;;;;;;AAiBA;;;;;;;KAAY,iBAAA;EACN,IAAA;EAAwB,YAAA;AAAA;EACxB,IAAA;EAAyB,YAAA;AAAA;EACzB,IAAA;EAA0B,YAAA;AAAA;EAC1B,IAAA;AAAA;EAEA,IAAA;EACA,UAAA;EACA,QAAA,EAAU,0BAAA;EAGV,MAAA;EACA,WAAA;AAAA;EAEA,IAAA;EAA+B,UAAA;AAAA;EAE/B,IAAA;EACA,WAAA,EAAa,mCAAmC;AAAA;EAEhD,IAAA;AAAA;EACA,IAAA;AAAA;;;;;KAMM,uBAAA,WAAkC,iBAAA,YAA6B,IAAA,CACzE,OAAA,CAAQ,iBAAA;EAAqB,IAAA,EAAM,CAAA;AAAA;;;AAAC;AAQtC;KAAY,mBAAA,WACA,iBAAA,GAAoB,iBAAA,IAC5B,CAAA;EACF,SAAA,EAAW,GAAA;EACX,MAAA,EAAQ,GAAA;EACR,KAAA;AAAA;;;;UAMe,8BAAA,SAAuC,yBAAA;EACtD,YAAA,EAAc,uBAAA;EACd,KAAA,EAAO,iBAAA;EAZuB;;;EAgB9B,KAAA;AAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { n as MobileNotificationPlatform, o as MobileServerNotificationPreferences } from "./serverModelTypes-CQgfqgW3.cjs";
|
|
2
|
+
import { h as MobileSignedRequestParams } from "./clientTypes-Et0PUa2d.cjs";
|
|
3
|
+
import { WalletClientWithAccount } from "@nadohq/shared";
|
|
4
|
+
import { Hex } from "viem";
|
|
5
|
+
|
|
6
|
+
//#region src/signing/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Unsigned inner payloads that can be authenticated against the mobile service API.
|
|
9
|
+
*
|
|
10
|
+
* Key order is significant: the payload hash is `keccak256(msgpack(inner))`, and msgpack encodes object keys
|
|
11
|
+
* in insertion order, so every field of every sub-type must be serialized in the exact order the backend
|
|
12
|
+
* declares its structs — `type` first, then the remaining fields — or the hash won't match and signature
|
|
13
|
+
* verification fails. This type only describes the shape; the authoritative runtime key order is enforced by
|
|
14
|
+
* {@link canonicalizeMobileInner}, which is the source of truth. Keep the field order here in sync with it.
|
|
15
|
+
*/
|
|
16
|
+
type MobileSignedInner = {
|
|
17
|
+
type: 'claim_username';
|
|
18
|
+
display_name: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'update_username';
|
|
21
|
+
display_name: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'set_private_mode';
|
|
24
|
+
private_mode: boolean;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'self_identity';
|
|
27
|
+
} | {
|
|
28
|
+
type: 'register_expo_token';
|
|
29
|
+
expo_token: string;
|
|
30
|
+
platform: MobileNotificationPlatform;
|
|
31
|
+
locale: string | null;
|
|
32
|
+
app_version: string | null;
|
|
33
|
+
} | {
|
|
34
|
+
type: 'unregister_expo_token';
|
|
35
|
+
expo_token: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'update_preferences';
|
|
38
|
+
preferences: MobileServerNotificationPreferences;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'notification_preferences';
|
|
41
|
+
} | {
|
|
42
|
+
type: 'registered_devices';
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Type-specific payload fields for a signed inner request of a given `type` (the inner payload without its
|
|
46
|
+
* `type` tag). Derived from {@link MobileSignedInner} so the two never drift apart.
|
|
47
|
+
*/
|
|
48
|
+
type MobileSignedInnerParams<T extends MobileSignedInner['type']> = Omit<Extract<MobileSignedInner, {
|
|
49
|
+
type: T;
|
|
50
|
+
}>, 'type'>;
|
|
51
|
+
/**
|
|
52
|
+
* A signed mobile service API request body: the inner payload flattened with its signature, sender, and
|
|
53
|
+
* nonce (unlike the engine client, which wraps params under a `{ [type]: params }` key).
|
|
54
|
+
*/
|
|
55
|
+
type MobileSignedRequest<T extends MobileSignedInner = MobileSignedInner> = T & {
|
|
56
|
+
signature: Hex;
|
|
57
|
+
sender: Hex;
|
|
58
|
+
nonce: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Params for {@link buildSignedMobileRequest}.
|
|
62
|
+
*/
|
|
63
|
+
interface BuildSignedMobileRequestParams extends MobileSignedRequestParams {
|
|
64
|
+
walletClient: WalletClientWithAccount;
|
|
65
|
+
inner: MobileSignedInner;
|
|
66
|
+
/**
|
|
67
|
+
* Overrides the generated nonce; mainly useful for tests that pin the signed payload.
|
|
68
|
+
*/
|
|
69
|
+
nonce?: bigint;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { MobileSignedRequest as i, MobileSignedInner as n, MobileSignedInnerParams as r, BuildSignedMobileRequestParams as t };
|
|
73
|
+
//# sourceMappingURL=types-uCD4BNZR.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-uCD4BNZR.d.cts","names":[],"sources":["../src/signing/src/signing/types.ts"],"mappings":";;;;;;;;AAiBA;;;;;;;KAAY,iBAAA;EACN,IAAA;EAAwB,YAAA;AAAA;EACxB,IAAA;EAAyB,YAAA;AAAA;EACzB,IAAA;EAA0B,YAAA;AAAA;EAC1B,IAAA;AAAA;EAEA,IAAA;EACA,UAAA;EACA,QAAA,EAAU,0BAAA;EAGV,MAAA;EACA,WAAA;AAAA;EAEA,IAAA;EAA+B,UAAA;AAAA;EAE/B,IAAA;EACA,WAAA,EAAa,mCAAmC;AAAA;EAEhD,IAAA;AAAA;EACA,IAAA;AAAA;;;;;KAMM,uBAAA,WAAkC,iBAAA,YAA6B,IAAA,CACzE,OAAA,CAAQ,iBAAA;EAAqB,IAAA,EAAM,CAAA;AAAA;;;AAAC;AAQtC;KAAY,mBAAA,WACA,iBAAA,GAAoB,iBAAA,IAC5B,CAAA;EACF,SAAA,EAAW,GAAA;EACX,MAAA,EAAQ,GAAA;EACR,KAAA;AAAA;;;;UAMe,8BAAA,SAAuC,yBAAA;EACtD,YAAA,EAAc,uBAAA;EACd,KAAA,EAAO,iBAAA;EAZuB;;;EAgB9B,KAAA;AAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utils_serverResponseGuards = require("./serverResponseGuards.cjs");
|
|
3
|
+
const require_utils_patterns = require("./patterns.cjs");
|
|
4
|
+
exports.MOBILE_DISPLAY_NAME_PATTERN = require_utils_patterns.MOBILE_DISPLAY_NAME_PATTERN;
|
|
5
|
+
exports.isMobileServerFailureResponse = require_utils_serverResponseGuards.isMobileServerFailureResponse;
|
|
6
|
+
exports.isMobileServerSuccessResponse = require_utils_serverResponseGuards.isMobileServerSuccessResponse;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { t as MOBILE_DISPLAY_NAME_PATTERN } from "../patterns-B9J2ldpx.cjs";
|
|
2
|
+
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-DjCNL3CR.cjs";
|
|
3
|
+
export { MOBILE_DISPLAY_NAME_PATTERN, isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { t as MOBILE_DISPLAY_NAME_PATTERN } from "../patterns-BbxH3_VA.js";
|
|
2
|
+
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-C_vZIgGl.js";
|
|
3
|
+
export { MOBILE_DISPLAY_NAME_PATTERN, isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/utils/patterns.ts
|
|
3
|
+
/**
|
|
4
|
+
* Validates a display name: 3-20 ASCII characters from `[A-Za-z0-9_.]`, allowed in any position.
|
|
5
|
+
*/
|
|
6
|
+
const MOBILE_DISPLAY_NAME_PATTERN = /^[A-Za-z0-9_.]{3,20}$/;
|
|
7
|
+
//#endregion
|
|
8
|
+
exports.MOBILE_DISPLAY_NAME_PATTERN = MOBILE_DISPLAY_NAME_PATTERN;
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=patterns.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.cjs","names":[],"sources":["../../src/utils/patterns.ts"],"sourcesContent":["/**\n * Validates a display name: 3-20 ASCII characters from `[A-Za-z0-9_.]`, allowed in any position.\n */\nexport const MOBILE_DISPLAY_NAME_PATTERN = /^[A-Za-z0-9_.]{3,20}$/;\n"],"mappings":";;;;;AAGA,MAAa,8BAA8B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/utils/patterns.ts
|
|
2
|
+
/**
|
|
3
|
+
* Validates a display name: 3-20 ASCII characters from `[A-Za-z0-9_.]`, allowed in any position.
|
|
4
|
+
*/
|
|
5
|
+
const MOBILE_DISPLAY_NAME_PATTERN = /^[A-Za-z0-9_.]{3,20}$/;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { MOBILE_DISPLAY_NAME_PATTERN };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.js","names":[],"sources":["../../src/utils/patterns.ts"],"sourcesContent":["/**\n * Validates a display name: 3-20 ASCII characters from `[A-Za-z0-9_.]`, allowed in any position.\n */\nexport const MOBILE_DISPLAY_NAME_PATTERN = /^[A-Za-z0-9_.]{3,20}$/;\n"],"mappings":";;;;AAGA,MAAa,8BAA8B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/utils/serverResponseGuards.ts
|
|
3
|
+
/**
|
|
4
|
+
* Narrows an unknown response body to the mobile service API failure envelope.
|
|
5
|
+
*/
|
|
6
|
+
function isMobileServerFailureResponse(data) {
|
|
7
|
+
return typeof data === "object" && data !== null && data.status === "failure";
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Narrows an unknown response body to a successful mobile service API envelope.
|
|
11
|
+
*/
|
|
12
|
+
function isMobileServerSuccessResponse(data) {
|
|
13
|
+
return typeof data === "object" && data !== null && data.status === "success";
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.isMobileServerFailureResponse = isMobileServerFailureResponse;
|
|
17
|
+
exports.isMobileServerSuccessResponse = isMobileServerSuccessResponse;
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=serverResponseGuards.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverResponseGuards.cjs","names":[],"sources":["../../src/utils/serverResponseGuards.ts"],"sourcesContent":["import { MobileServerFailureResponse } from '../types/serverBaseTypes';\n\n/**\n * Narrows an unknown response body to the mobile service API failure envelope.\n */\nexport function isMobileServerFailureResponse(\n data: unknown,\n): data is MobileServerFailureResponse {\n return (\n typeof data === 'object' &&\n data !== null &&\n (data as Record<string, unknown>).status === 'failure'\n );\n}\n\n/**\n * Narrows an unknown response body to a successful mobile service API envelope.\n */\nexport function isMobileServerSuccessResponse<T extends { status: 'success' }>(\n data: unknown,\n): data is T {\n return (\n typeof data === 'object' &&\n data !== null &&\n (data as Record<string, unknown>).status === 'success'\n );\n}\n"],"mappings":";;;;;AAKA,SAAgB,8BACd,MACqC;CACrC,OACE,OAAO,SAAS,YAChB,SAAS,QACR,KAAiC,WAAW;AAEjD;;;;AAKA,SAAgB,8BACd,MACW;CACX,OACE,OAAO,SAAS,YAChB,SAAS,QACR,KAAiC,WAAW;AAEjD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/utils/serverResponseGuards.ts
|
|
2
|
+
/**
|
|
3
|
+
* Narrows an unknown response body to the mobile service API failure envelope.
|
|
4
|
+
*/
|
|
5
|
+
function isMobileServerFailureResponse(data) {
|
|
6
|
+
return typeof data === "object" && data !== null && data.status === "failure";
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Narrows an unknown response body to a successful mobile service API envelope.
|
|
10
|
+
*/
|
|
11
|
+
function isMobileServerSuccessResponse(data) {
|
|
12
|
+
return typeof data === "object" && data !== null && data.status === "success";
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=serverResponseGuards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverResponseGuards.js","names":[],"sources":["../../src/utils/serverResponseGuards.ts"],"sourcesContent":["import { MobileServerFailureResponse } from '../types/serverBaseTypes';\n\n/**\n * Narrows an unknown response body to the mobile service API failure envelope.\n */\nexport function isMobileServerFailureResponse(\n data: unknown,\n): data is MobileServerFailureResponse {\n return (\n typeof data === 'object' &&\n data !== null &&\n (data as Record<string, unknown>).status === 'failure'\n );\n}\n\n/**\n * Narrows an unknown response body to a successful mobile service API envelope.\n */\nexport function isMobileServerSuccessResponse<T extends { status: 'success' }>(\n data: unknown,\n): data is T {\n return (\n typeof data === 'object' &&\n data !== null &&\n (data as Record<string, unknown>).status === 'success'\n );\n}\n"],"mappings":";;;;AAKA,SAAgB,8BACd,MACqC;CACrC,OACE,OAAO,SAAS,YAChB,SAAS,QACR,KAAiC,WAAW;AAEjD;;;;AAKA,SAAgB,8BACd,MACW;CACX,OACE,OAAO,SAAS,YAChB,SAAS,QACR,KAAiC,WAAW;AAEjD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nadohq/mobile-client",
|
|
3
|
+
"version": "0.27.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"description": "HTTP client for the Nado mobile service API — username claims, profiles, privacy settings, and push notification devices & preferences",
|
|
7
|
+
"author": "Frank Jia <frank@inkfnd.com>",
|
|
8
|
+
"homepage": "",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"source": "./src/index.ts",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"repository": "https://github.com/nadohq/nado-typescript-sdk",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"clean": "rm -rf dist && rm -f tsconfig.tsbuildinfo",
|
|
17
|
+
"build": "tsdown",
|
|
18
|
+
"dev": "tsc -w",
|
|
19
|
+
"lint": "eslint --cache './**/*.{ts,tsx}'",
|
|
20
|
+
"lint:fix": "eslint --cache --fix './**/*.{ts,tsx}'",
|
|
21
|
+
"typecheck": "tsc --noEmit"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"src"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"import": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"require": {
|
|
34
|
+
"types": "./dist/index.d.cts",
|
|
35
|
+
"default": "./dist/index.cjs"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"react-native": "./dist/index.js",
|
|
40
|
+
"main": "./dist/index.cjs",
|
|
41
|
+
"module": "./dist/index.js",
|
|
42
|
+
"types": "./dist/index.d.ts",
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@msgpack/msgpack": "3.1.3",
|
|
45
|
+
"@nadohq/shared": "^0.27.0",
|
|
46
|
+
"axios": "1.16.1"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"bignumber.js": "11.1.1",
|
|
50
|
+
"viem": "2.52.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@jest/globals": "30.4.1",
|
|
54
|
+
"bignumber.js": "11.1.1",
|
|
55
|
+
"viem": "2.52.0"
|
|
56
|
+
},
|
|
57
|
+
"gitHead": "8a372c1df88e29446e9fd60072c76003d403fdce"
|
|
58
|
+
}
|