@carrierllc/sdk 0.2.7 → 0.2.8
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/dist/client.d.ts +2 -1
- package/dist/client.js +1 -0
- package/dist/data/operations.json +22 -0
- package/dist/index.d.ts +1 -1
- package/dist/operation-ids.d.ts +1 -1
- package/dist/storefront-write.d.ts +2 -0
- package/dist/storefront-write.js +9 -0
- package/dist/types.d.ts +6 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { OperationId } from "./operation-ids.js";
|
|
9
9
|
import { type CallParams } from "./operations.js";
|
|
10
|
-
import type { ConnectivityIntent, ConnectivityPlan, HostedStorefront, IdempotentRequest, IntentCreateParams, ProductCreateParams, StorefrontCreateParams, StorefrontPlanParams, StorefrontUpdateParams } from "./types.js";
|
|
10
|
+
import type { ConnectivityIntent, ConnectivityPlan, HostedStorefront, IdempotentRequest, IntentCreateParams, ProductCreateParams, StorefrontCreateParams, StorefrontPlanParams, StorefrontPlanUpdateParams, StorefrontUpdateParams } from "./types.js";
|
|
11
11
|
export interface CarrierOptions {
|
|
12
12
|
/** Defaults to https://api.carrier.llc. No trailing slash required. */
|
|
13
13
|
baseUrl?: string;
|
|
@@ -33,6 +33,7 @@ export declare class Carrier {
|
|
|
33
33
|
upsertPlan: (id: string, body: StorefrontPlanParams) => Promise<{
|
|
34
34
|
slug: string;
|
|
35
35
|
}>;
|
|
36
|
+
updatePlan: (id: string, slug: string, body: StorefrontPlanUpdateParams) => Promise<NonNullable<HostedStorefront["plans"]>[number]>;
|
|
36
37
|
};
|
|
37
38
|
constructor(apiKey: string, options?: CarrierOptions);
|
|
38
39
|
/** Call any operation id from the public OpenAPI document. */
|
package/dist/client.js
CHANGED
|
@@ -34,6 +34,7 @@ export class Carrier {
|
|
|
34
34
|
create: (body, request) => this.post("/v1/storefronts", body, request.idempotencyKey),
|
|
35
35
|
update: (id, body) => this.request("PATCH", `/v1/storefronts/${encodeURIComponent(id)}`, { body }),
|
|
36
36
|
upsertPlan: (id, body) => this.request("POST", `/v1/storefronts/${encodeURIComponent(id)}/plans`, { body }),
|
|
37
|
+
updatePlan: (id, slug, body) => this.request("PATCH", `/v1/storefronts/${encodeURIComponent(id)}/plans/${encodeURIComponent(slug)}`, { body }),
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
/** Call any operation id from the public OpenAPI document. */
|
|
@@ -2746,6 +2746,28 @@
|
|
|
2746
2746
|
"queryParams": [],
|
|
2747
2747
|
"headerParams": []
|
|
2748
2748
|
},
|
|
2749
|
+
{
|
|
2750
|
+
"id": "get_hosted_storefront_plan_readiness",
|
|
2751
|
+
"method": "GET",
|
|
2752
|
+
"path": "/api/hosted/{slug}/plans/{planId}/readiness",
|
|
2753
|
+
"tag": "Storefront",
|
|
2754
|
+
"summary": "Read-only readiness check using the fulfilment owner's account rules",
|
|
2755
|
+
"security": "public",
|
|
2756
|
+
"body": false,
|
|
2757
|
+
"bodyRequired": false,
|
|
2758
|
+
"pathParams": [
|
|
2759
|
+
{
|
|
2760
|
+
"name": "slug",
|
|
2761
|
+
"required": true
|
|
2762
|
+
},
|
|
2763
|
+
{
|
|
2764
|
+
"name": "planId",
|
|
2765
|
+
"required": true
|
|
2766
|
+
}
|
|
2767
|
+
],
|
|
2768
|
+
"queryParams": [],
|
|
2769
|
+
"headerParams": []
|
|
2770
|
+
},
|
|
2749
2771
|
{
|
|
2750
2772
|
"id": "list_storefronts",
|
|
2751
2773
|
"method": "GET",
|
package/dist/index.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export type { OperationId } from "./operation-ids.js";
|
|
|
8
8
|
export type { CallParams } from "./operations.js";
|
|
9
9
|
export { SDK_VERSION } from "./version.js";
|
|
10
10
|
export { isStorefrontPlanError, logoFileDataUrl, logoReference, majorToCents, parseCountryInput, parseDataGb, parseValidityDays, parseWholeNumber, completePlanInput, storefrontBrandPatch, storefrontPlanBody, hostedStorefrontUrl, storefrontSlugFrom, type ExistingStorefrontBrand, type StorefrontBrandInput, type StorefrontPlanBody, type StorefrontPlanInput, type StoredPlanIdentity, } from "./storefront-write.js";
|
|
11
|
-
export type { ConnectivityEsim, ConnectivityIntent, ConnectivityPlan, HostedStorefront, IdempotentRequest, IntentCreateParams, IntentStatus, PlanPrice, ProductCreateParams, StorefrontCreateParams, StorefrontPlanParams, StorefrontUpdateParams, } from "./types.js";
|
|
11
|
+
export type { ConnectivityEsim, ConnectivityIntent, ConnectivityPlan, HostedStorefront, IdempotentRequest, IntentCreateParams, IntentStatus, PlanPrice, ProductCreateParams, StorefrontCreateParams, StorefrontPlanParams, StorefrontPlanUpdateParams, StorefrontUpdateParams, } from "./types.js";
|
package/dist/operation-ids.d.ts
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
*
|
|
3
3
|
* Generated by sdks/generate.py. Do not edit by hand.
|
|
4
4
|
*/
|
|
5
|
-
export type OperationId = "list_reseller_accounts" | "get_reseller_info" | "esim_status_per_account" | "list_sponsors" | "list_steering_lists" | "get_subscriber" | "list_subscribers" | "create_subscriber" | "get_sim_provider_status" | "change_sim_status" | "get_subscriber_location" | "hlr_get_bitrate" | "hlr_set_bitrate" | "list_subscriber_packages" | "assign_package" | "clean_all_packages" | "list_package_templates" | "create_package_template" | "list_location_zones" | "create_location_zone" | "list_detailed_location_zones" | "list_destination_prefixes" | "subscriber_usage" | "subscriber_network_events" | "subscriber_active_period" | "get_tariff" | "list_network_profiles" | "modify_subscriber_balance" | "modify_subscriber_status" | "modify_subscriber_contact_info" | "set_subscriber_traffic_restrictions" | "modify_subscriber_steering_list" | "move_subscriber_range_to_account" | "assign_recurring_package" | "modify_package_limits" | "modify_package_expiry" | "modify_package_status" | "stop_resume_recurring_package" | "modify_account_balance" | "delete_subscriber_package" | "modify_template_core" | "modify_template_recurring" | "modify_template_throttling" | "send_sms" | "fleet_health" | "churn_risk" | "audit_network_coverage" | "diagnose_subscriber" | "detect_usage_anomalies" | "optimize_package" | "marketing_intelligence" | "high_cost_subscribers" | "high_cost_subscribers_method_guard" | "detect_country_entry" | "list_intelligence_schedules" | "create_intelligence_schedule" | "delete_intelligence_schedule" | "run_intelligence_schedule" | "get_intelligence_schedule_report" | "get_intelligence_share" | "operator_billing_connect_begin" | "operator_billing_connect_oauth_begin" | "operator_billing_connect_oauth_complete" | "operator_billing_connect_status" | "operator_billing_connect_dashboard_link" | "operator_billing_list_payouts" | "operator_billing_create_manual_payout" | "operator_billing_get_payout_schedule" | "operator_billing_update_payout_schedule" | "operator_billing_list_fees" | "operator_billing_list_refunds" | "operator_billing_create_refund" | "operator_billing_list_disputes" | "operator_billing_submit_dispute_evidence" | "operator_billing_list_fraud_reviews" | "operator_billing_approve_fraud_review" | "operator_billing_decline_fraud_review" | "operator_billing_list_value_lists" | "operator_billing_add_value_list_item" | "affiliates_me_get" | "affiliates_me_create" | "affiliates_me_commissions_list" | "affiliates_link" | "operator_identity_status" | "operator_identity_create_session" | "operator_identity_update_session" | "operator_list_promotions" | "operator_create_promotion" | "signup_start" | "signup_verify" | "create_api_key" | "get_onboarding_state" | "onboarding_save_org" | "onboarding_connect_ocs_token" | "onboarding_start_managed_account" | "onboarding_save_plan" | "onboarding_skip_plan" | "onboarding_test_esim" | "onboarding_complete" | "operator_billing_stripe_webhook" | "receive_bridge4ip_webhook" | "affect_subscriber_phone_number" | "modify_subscriber_mobile_plan" | "modify_subscriber_voip_plan" | "push_steering_to_subscriber" | "modify_subscriber_package_active_period" | "get_subscriber_location_by_cell_id" | "reset_subscriber_gz_counter" | "list_destination_lists" | "list_subscriber_voip_tariff" | "list_voip_tariff_rule" | "change_network_profile_of_location_zone" | "get_network_default" | "set_network_default" | "plan_network_default" | "carrier_webhook_config" | "ai_chat" | "ai_insights" | "ai_quota" | "list_invoice_periods" | "get_billing_config" | "update_billing_config" | "stripe_connect_begin" | "stripe_connect_status" | "list_invoices" | "create_invoice" | "get_invoice" | "update_invoice" | "void_invoice" | "get_invoice_document" | "list_connectivity_plans" | "list_connectivity_products" | "create_connectivity_product" | "get_connectivity_product" | "list_connectivity_intents" | "create_connectivity_intent" | "get_connectivity_intent" | "confirm_connectivity_intent" | "create_connectivity_webhook_endpoint" | "list_connectivity_webhook_endpoints" | "delete_connectivity_webhook_endpoint" | "list_connectivity_events" | "get_connectivity_event" | "create_connectivity_usage_record" | "list_connectivity_usage_records" | "retry_connectivity_event" | "issue_esim_from_inventory" | "rollback_esim_issuance" | "subscriber_country_history" | "get_subscriber_notes" | "add_subscriber_note" | "put_subscriber_notes" | "observe_connectivity_event" | "ingest_connectivity_usage" | "ingest_cdr_events" | "aggregate_cdr" | "list_storefront_templates" | "list_storefront_buyer_orders" | "get_storefront_order_usage" | "get_storefront_order_top_up_options" | "cancel_storefront_order" | "get_storefront_order" | "rollback_storefront_order" | "get_hosted_storefront" | "list_storefronts" | "create_storefront" | "list_storefront_orders" | "get_storefront" | "update_storefront" | "upsert_storefront_plan" | "update_storefront_plan" | "health_check";
|
|
5
|
+
export type OperationId = "list_reseller_accounts" | "get_reseller_info" | "esim_status_per_account" | "list_sponsors" | "list_steering_lists" | "get_subscriber" | "list_subscribers" | "create_subscriber" | "get_sim_provider_status" | "change_sim_status" | "get_subscriber_location" | "hlr_get_bitrate" | "hlr_set_bitrate" | "list_subscriber_packages" | "assign_package" | "clean_all_packages" | "list_package_templates" | "create_package_template" | "list_location_zones" | "create_location_zone" | "list_detailed_location_zones" | "list_destination_prefixes" | "subscriber_usage" | "subscriber_network_events" | "subscriber_active_period" | "get_tariff" | "list_network_profiles" | "modify_subscriber_balance" | "modify_subscriber_status" | "modify_subscriber_contact_info" | "set_subscriber_traffic_restrictions" | "modify_subscriber_steering_list" | "move_subscriber_range_to_account" | "assign_recurring_package" | "modify_package_limits" | "modify_package_expiry" | "modify_package_status" | "stop_resume_recurring_package" | "modify_account_balance" | "delete_subscriber_package" | "modify_template_core" | "modify_template_recurring" | "modify_template_throttling" | "send_sms" | "fleet_health" | "churn_risk" | "audit_network_coverage" | "diagnose_subscriber" | "detect_usage_anomalies" | "optimize_package" | "marketing_intelligence" | "high_cost_subscribers" | "high_cost_subscribers_method_guard" | "detect_country_entry" | "list_intelligence_schedules" | "create_intelligence_schedule" | "delete_intelligence_schedule" | "run_intelligence_schedule" | "get_intelligence_schedule_report" | "get_intelligence_share" | "operator_billing_connect_begin" | "operator_billing_connect_oauth_begin" | "operator_billing_connect_oauth_complete" | "operator_billing_connect_status" | "operator_billing_connect_dashboard_link" | "operator_billing_list_payouts" | "operator_billing_create_manual_payout" | "operator_billing_get_payout_schedule" | "operator_billing_update_payout_schedule" | "operator_billing_list_fees" | "operator_billing_list_refunds" | "operator_billing_create_refund" | "operator_billing_list_disputes" | "operator_billing_submit_dispute_evidence" | "operator_billing_list_fraud_reviews" | "operator_billing_approve_fraud_review" | "operator_billing_decline_fraud_review" | "operator_billing_list_value_lists" | "operator_billing_add_value_list_item" | "affiliates_me_get" | "affiliates_me_create" | "affiliates_me_commissions_list" | "affiliates_link" | "operator_identity_status" | "operator_identity_create_session" | "operator_identity_update_session" | "operator_list_promotions" | "operator_create_promotion" | "signup_start" | "signup_verify" | "create_api_key" | "get_onboarding_state" | "onboarding_save_org" | "onboarding_connect_ocs_token" | "onboarding_start_managed_account" | "onboarding_save_plan" | "onboarding_skip_plan" | "onboarding_test_esim" | "onboarding_complete" | "operator_billing_stripe_webhook" | "receive_bridge4ip_webhook" | "affect_subscriber_phone_number" | "modify_subscriber_mobile_plan" | "modify_subscriber_voip_plan" | "push_steering_to_subscriber" | "modify_subscriber_package_active_period" | "get_subscriber_location_by_cell_id" | "reset_subscriber_gz_counter" | "list_destination_lists" | "list_subscriber_voip_tariff" | "list_voip_tariff_rule" | "change_network_profile_of_location_zone" | "get_network_default" | "set_network_default" | "plan_network_default" | "carrier_webhook_config" | "ai_chat" | "ai_insights" | "ai_quota" | "list_invoice_periods" | "get_billing_config" | "update_billing_config" | "stripe_connect_begin" | "stripe_connect_status" | "list_invoices" | "create_invoice" | "get_invoice" | "update_invoice" | "void_invoice" | "get_invoice_document" | "list_connectivity_plans" | "list_connectivity_products" | "create_connectivity_product" | "get_connectivity_product" | "list_connectivity_intents" | "create_connectivity_intent" | "get_connectivity_intent" | "confirm_connectivity_intent" | "create_connectivity_webhook_endpoint" | "list_connectivity_webhook_endpoints" | "delete_connectivity_webhook_endpoint" | "list_connectivity_events" | "get_connectivity_event" | "create_connectivity_usage_record" | "list_connectivity_usage_records" | "retry_connectivity_event" | "issue_esim_from_inventory" | "rollback_esim_issuance" | "subscriber_country_history" | "get_subscriber_notes" | "add_subscriber_note" | "put_subscriber_notes" | "observe_connectivity_event" | "ingest_connectivity_usage" | "ingest_cdr_events" | "aggregate_cdr" | "list_storefront_templates" | "list_storefront_buyer_orders" | "get_storefront_order_usage" | "get_storefront_order_top_up_options" | "cancel_storefront_order" | "get_storefront_order" | "rollback_storefront_order" | "get_hosted_storefront" | "get_hosted_storefront_plan_readiness" | "list_storefronts" | "create_storefront" | "list_storefront_orders" | "get_storefront" | "update_storefront" | "upsert_storefront_plan" | "update_storefront_plan" | "health_check";
|
|
@@ -22,6 +22,7 @@ export interface StorefrontPlanInput {
|
|
|
22
22
|
priceCents?: number;
|
|
23
23
|
currency?: string;
|
|
24
24
|
templateId?: number;
|
|
25
|
+
accountId?: number;
|
|
25
26
|
dataGb?: number;
|
|
26
27
|
/** The only way a plan becomes unlimited. A 0 or missing dataGb without this stays finite. */
|
|
27
28
|
unlimited?: boolean;
|
|
@@ -43,6 +44,7 @@ export interface StorefrontPlanBody {
|
|
|
43
44
|
price_cents?: number;
|
|
44
45
|
currency?: string;
|
|
45
46
|
ocs_package_template_id?: number;
|
|
47
|
+
ocs_account_id?: number;
|
|
46
48
|
data_gb?: number;
|
|
47
49
|
unlimited?: boolean;
|
|
48
50
|
validity_days?: number;
|
package/dist/storefront-write.js
CHANGED
|
@@ -35,6 +35,7 @@ export function completePlanInput(input, plans) {
|
|
|
35
35
|
input.priceCents,
|
|
36
36
|
input.currency,
|
|
37
37
|
input.templateId,
|
|
38
|
+
input.accountId,
|
|
38
39
|
input.dataGb,
|
|
39
40
|
input.unlimited,
|
|
40
41
|
input.validityDays,
|
|
@@ -68,9 +69,14 @@ function sharedCurrency(plans) {
|
|
|
68
69
|
return [...codes][0];
|
|
69
70
|
}
|
|
70
71
|
export function storefrontPlanBody(input) {
|
|
72
|
+
if (input.accountId !== undefined && (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)) {
|
|
73
|
+
return { error: "OCS account id must be a positive integer." };
|
|
74
|
+
}
|
|
71
75
|
const productId = input.productId?.trim() ?? "";
|
|
72
76
|
if (productId !== "") {
|
|
73
77
|
const body = { product_id: productId };
|
|
78
|
+
if (input.accountId !== undefined)
|
|
79
|
+
body.ocs_account_id = input.accountId;
|
|
74
80
|
if (input.priceCents !== undefined)
|
|
75
81
|
body.price_cents = input.priceCents;
|
|
76
82
|
if (input.active !== undefined)
|
|
@@ -85,6 +91,7 @@ export function storefrontPlanBody(input) {
|
|
|
85
91
|
input.priceCents,
|
|
86
92
|
input.currency,
|
|
87
93
|
input.templateId,
|
|
94
|
+
input.accountId,
|
|
88
95
|
input.dataGb,
|
|
89
96
|
input.unlimited,
|
|
90
97
|
input.validityDays,
|
|
@@ -112,6 +119,8 @@ export function storefrontPlanBody(input) {
|
|
|
112
119
|
currency: input.currency,
|
|
113
120
|
ocs_package_template_id: input.templateId,
|
|
114
121
|
};
|
|
122
|
+
if (input.accountId !== undefined)
|
|
123
|
+
body.ocs_account_id = input.accountId;
|
|
115
124
|
if (input.dataGb !== undefined)
|
|
116
125
|
body.data_gb = input.dataGb;
|
|
117
126
|
if (input.unlimited !== undefined)
|
package/dist/types.d.ts
CHANGED
|
@@ -69,14 +69,20 @@ export interface HostedStorefront {
|
|
|
69
69
|
name: string;
|
|
70
70
|
currency: string;
|
|
71
71
|
ocs_package_template_id: number;
|
|
72
|
+
ocs_account_id: number | null;
|
|
73
|
+
account_status: "owned" | "not_owned" | "unset" | "unknown";
|
|
72
74
|
}>;
|
|
73
75
|
}
|
|
76
|
+
export type StorefrontPlanUpdateParams = Pick<StorefrontPlanParams, "price_cents" | "active" | "ocs_account_id"> & {
|
|
77
|
+
sort_order?: number;
|
|
78
|
+
};
|
|
74
79
|
export interface StorefrontPlanParams {
|
|
75
80
|
slug?: string;
|
|
76
81
|
name?: string;
|
|
77
82
|
price_cents?: number;
|
|
78
83
|
currency?: string;
|
|
79
84
|
ocs_package_template_id?: number;
|
|
85
|
+
ocs_account_id?: number;
|
|
80
86
|
product_id?: string;
|
|
81
87
|
description?: string;
|
|
82
88
|
data_gb?: number;
|
package/dist/version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Published version. Keep this equal to package.json. */
|
|
2
|
-
export declare const SDK_VERSION = "0.2.
|
|
3
|
-
export declare const USER_AGENT = "@carrierllc/sdk/0.2.
|
|
2
|
+
export declare const SDK_VERSION = "0.2.8";
|
|
3
|
+
export declare const USER_AGENT = "@carrierllc/sdk/0.2.8";
|
package/dist/version.js
CHANGED