Replace PA05-33 OTA API with the proper two-step activation flow: - PA02-01: Account Registration (/master/addAcnt/) - PA05-05: Voice Options Registration (/mvno/talkoption/addOrder/) Changes: - Add FreebitAccountRegistrationService for PA02-01 account registration - Add FreebitVoiceOptionsService for PA05-05 voice options - Update SimFulfillmentService to use new APIs instead of PA05-33 OTA - Add SalesforceSIMInventoryService for fetching SIM inventory data - Remove deprecated FreebitOtaService (PA05-33 no longer used) - Remove debug console.log statements The new flow: 1. Fetch SIM inventory from Salesforce (phone number, PT number) 2. Call PA02-01 to register MVNO account with plan code 3. Call PA05-05 to configure voice options with customer identity 4. Update SIM inventory status to "In Use" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
79 lines
3.6 KiB
TypeScript
79 lines
3.6 KiB
TypeScript
import * as Mapper from "./mapper.js";
|
|
import * as RawTypes from "./raw.types.js";
|
|
import * as Requests from "./requests.js";
|
|
import * as Utils from "./utils.js";
|
|
|
|
export const schemas = {
|
|
accountDetails: Requests.freebitAccountDetailsRequestSchema,
|
|
trafficInfo: Requests.freebitTrafficInfoRequestSchema,
|
|
topUp: Requests.freebitTopUpRequestPayloadSchema,
|
|
topUpApi: Requests.freebitTopUpApiRequestSchema,
|
|
planChange: Requests.freebitPlanChangeRequestSchema,
|
|
planChangeApi: Requests.freebitPlanChangeApiRequestSchema,
|
|
addSpec: Requests.freebitAddSpecRequestSchema,
|
|
cancelPlan: Requests.freebitCancelPlanRequestSchema,
|
|
cancelPlanApi: Requests.freebitCancelPlanApiRequestSchema,
|
|
quotaHistory: Requests.freebitQuotaHistoryRequestSchema,
|
|
esimReissue: Requests.freebitEsimReissueRequestSchema,
|
|
simFeatures: Requests.freebitSimFeaturesRequestSchema,
|
|
globalIp: Requests.freebitGlobalIpRequestSchema,
|
|
esimActivationParams: Requests.freebitEsimActivationParamsSchema,
|
|
esimActivationRequest: Requests.freebitEsimActivationRequestSchema,
|
|
esimAddAccount: Requests.freebitEsimAddAccountRequestSchema,
|
|
auth: Requests.freebitAuthRequestSchema,
|
|
cancelAccount: Requests.freebitCancelAccountRequestSchema,
|
|
otaActivation: Requests.freebitOtaActivationRequestSchema,
|
|
otaActivationResponse: Requests.freebitOtaActivationResponseSchema,
|
|
};
|
|
|
|
export const raw = RawTypes;
|
|
export const mapper = Mapper;
|
|
export const requests = Requests;
|
|
|
|
export type EsimAccountActivationRequest = Requests.FreebitEsimActivationRequest;
|
|
export type TopUpRequest = Requests.FreebitTopUpRequest;
|
|
export type TopUpApiRequest = Requests.FreebitTopUpApiRequest;
|
|
export type PlanChangeRequest = Requests.FreebitPlanChangeRequest;
|
|
export type PlanChangeApiRequest = Requests.FreebitPlanChangeApiRequest;
|
|
export type SimFeaturesRequest = Requests.FreebitSimFeaturesRequest;
|
|
export type QuotaHistoryRequest = Requests.FreebitQuotaHistoryRequest;
|
|
export type EsimAddAccountRequest = Requests.FreebitEsimAddAccountRequest;
|
|
export type TrafficInfoRequest = Requests.FreebitTrafficInfoRequest;
|
|
export type CancelPlanRequest = Requests.FreebitCancelPlanRequest;
|
|
export type CancelPlanApiRequest = Requests.FreebitCancelPlanApiRequest;
|
|
export type CancelAccountRequest = Requests.FreebitCancelAccountRequest;
|
|
export type AuthRequest = Requests.FreebitAuthRequest;
|
|
export type OtaActivationRequest = Requests.FreebitOtaActivationRequest;
|
|
export type OtaActivationResponse = Requests.FreebitOtaActivationResponse;
|
|
export type TopUpResponse = ReturnType<typeof Mapper.transformFreebitTopUpResponse>;
|
|
export type AddSpecResponse = ReturnType<typeof Mapper.transformFreebitAddSpecResponse>;
|
|
export type PlanChangeResponse = ReturnType<typeof Mapper.transformFreebitPlanChangeResponse>;
|
|
export type CancelPlanResponse = ReturnType<typeof Mapper.transformFreebitCancelPlanResponse>;
|
|
export type CancelAccountResponse = ReturnType<typeof Mapper.transformFreebitCancelAccountResponse>;
|
|
export type EsimReissueResponse = ReturnType<typeof Mapper.transformFreebitEsimReissueResponse>;
|
|
export type EsimAddAccountResponse = ReturnType<
|
|
typeof Mapper.transformFreebitEsimAddAccountResponse
|
|
>;
|
|
export type EsimActivationResponse = ReturnType<
|
|
typeof Mapper.transformFreebitEsimActivationResponse
|
|
>;
|
|
export type AuthResponse = ReturnType<typeof Mapper.transformFreebitAuthResponse>;
|
|
|
|
export * from "./mapper.js";
|
|
export * from "./raw.types.js";
|
|
export * from "./requests.js";
|
|
export * from "./utils.js";
|
|
|
|
export const Freebit = {
|
|
...Mapper,
|
|
...Utils,
|
|
mapper: Mapper,
|
|
raw: RawTypes,
|
|
schemas,
|
|
requests: Requests,
|
|
utils: Utils,
|
|
};
|
|
|
|
// Deprecated: use Freebit.normalizeAccount
|
|
export const normalizeAccount = Utils.normalizeAccount;
|