@raystack/frontier 0.8.22 → 0.8.24

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/index.d.ts CHANGED
@@ -72,6 +72,17 @@ interface BillingAccountBalance {
72
72
  /** @format date-time */
73
73
  updated_at?: string;
74
74
  }
75
+ interface ProductBehaviorConfig {
76
+ /** @format int64 */
77
+ credit_amount?: string;
78
+ /** @format int64 */
79
+ seat_limit?: string;
80
+ }
81
+ interface SubscriptionPhase {
82
+ /** @format date-time */
83
+ effective_at?: string;
84
+ plan_id?: string;
85
+ }
75
86
  interface ProtobufAny {
76
87
  '@type'?: string;
77
88
  [key: string]: any;
@@ -239,6 +250,9 @@ interface V1Beta1BillingTransaction {
239
250
  updated_at?: string;
240
251
  }
241
252
  type V1Beta1CancelSubscriptionResponse = object;
253
+ interface V1Beta1ChangeSubscriptionResponse {
254
+ phase?: SubscriptionPhase;
255
+ }
242
256
  interface V1Beta1CheckFeatureEntitlementResponse {
243
257
  status?: boolean;
244
258
  }
@@ -275,6 +289,8 @@ interface V1Beta1CheckoutSession {
275
289
  success_url?: string;
276
290
  cancel_url?: string;
277
291
  state?: string;
292
+ plan?: string;
293
+ product?: string;
278
294
  metadata?: object;
279
295
  /** @format date-time */
280
296
  created_at?: string;
@@ -283,6 +299,9 @@ interface V1Beta1CheckoutSession {
283
299
  /** @format date-time */
284
300
  expire_at?: string;
285
301
  }
302
+ interface V1Beta1CheckoutSetupBody {
303
+ payment_method?: boolean;
304
+ }
286
305
  interface V1Beta1CheckoutSubscriptionBody {
287
306
  plan?: string;
288
307
  /** @format int32 */
@@ -395,8 +414,10 @@ interface V1Beta1CreateUserResponse {
395
414
  user?: V1Beta1User;
396
415
  }
397
416
  interface V1Beta1DelegatedCheckoutResponse {
398
- /** Checkout session */
399
- checkout_session?: V1Beta1CheckoutSession;
417
+ /** subscription if created */
418
+ subscription?: V1Beta1Subscription;
419
+ /** product if bought */
420
+ product?: V1Beta1Product;
400
421
  }
401
422
  type V1Beta1DeleteBillingAccountResponse = object;
402
423
  type V1Beta1DeleteGroupResponse = object;
@@ -1053,6 +1074,8 @@ interface V1Beta1Plan {
1053
1074
  products?: V1Beta1Product[];
1054
1075
  /** known intervals are "day", "week", "month", and "year" */
1055
1076
  interval?: string;
1077
+ /** @format int64 */
1078
+ on_start_credits?: string;
1056
1079
  metadata?: object;
1057
1080
  /** @format date-time */
1058
1081
  created_at?: string;
@@ -1066,6 +1089,8 @@ interface V1Beta1PlanRequestBody {
1066
1089
  products?: V1Beta1Product[];
1067
1090
  /** known intervals are "day", "week", "month", and "year" */
1068
1091
  interval?: string;
1092
+ /** @format int64 */
1093
+ on_start_credits?: string;
1069
1094
  metadata?: object;
1070
1095
  }
1071
1096
  interface V1Beta1Policy {
@@ -1182,10 +1207,9 @@ interface V1Beta1Product {
1182
1207
  plan_ids?: string[];
1183
1208
  state?: string;
1184
1209
  prices?: V1Beta1Price[];
1185
- /** @format int64 */
1186
- credit_amount?: string;
1187
1210
  behavior?: string;
1188
1211
  features?: V1Beta1Feature[];
1212
+ behavior_config?: ProductBehaviorConfig;
1189
1213
  metadata?: object;
1190
1214
  /** @format date-time */
1191
1215
  created_at?: string;
@@ -1198,10 +1222,9 @@ interface V1Beta1ProductRequestBody {
1198
1222
  description?: string;
1199
1223
  plan_id?: string;
1200
1224
  prices?: V1Beta1Price[];
1201
- /** @format int64 */
1202
- credit_amount?: string;
1203
1225
  behavior?: string;
1204
1226
  features?: V1Beta1Feature[];
1227
+ behavior_config?: ProductBehaviorConfig;
1205
1228
  metadata?: object;
1206
1229
  }
1207
1230
  interface V1Beta1Project {
@@ -1411,6 +1434,7 @@ interface V1Beta1Subscription {
1411
1434
  canceled_at?: string;
1412
1435
  /** @format date-time */
1413
1436
  ended_at?: string;
1437
+ phases?: SubscriptionPhase[];
1414
1438
  }
1415
1439
  interface V1Beta1UpdateBillingAccountResponse {
1416
1440
  /** Updated billing account */
@@ -2317,6 +2341,8 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2317
2341
  subscription_body?: V1Beta1CheckoutSubscriptionBody;
2318
2342
  /** Product to buy */
2319
2343
  product_body?: V1Beta1CheckoutProductBody;
2344
+ /** Payment method setup */
2345
+ setup_body?: V1Beta1CheckoutSetupBody;
2320
2346
  }, params?: RequestParams) => Promise<HttpResponse<V1Beta1CreateCheckoutResponse, RpcStatus>>;
2321
2347
  /**
2322
2348
  * @description List all invoices of a billing account.
@@ -2347,7 +2373,11 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2347
2373
  * @request GET:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions
2348
2374
  * @secure
2349
2375
  */
2350
- frontierServiceListSubscriptions: (orgId: string, billingId: string, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListSubscriptionsResponse, RpcStatus>>;
2376
+ frontierServiceListSubscriptions: (orgId: string, billingId: string, query?: {
2377
+ /** Filter subscriptions by state */
2378
+ state?: string;
2379
+ plan?: string;
2380
+ }, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListSubscriptionsResponse, RpcStatus>>;
2351
2381
  /**
2352
2382
  * @description Get a subscription by ID.
2353
2383
  *
@@ -2379,7 +2409,23 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2379
2409
  * @request POST:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions/{id}/cancel
2380
2410
  * @secure
2381
2411
  */
2382
- frontierServiceCancelSubscription: (orgId: string, billingId: string, id: string, params?: RequestParams) => Promise<HttpResponse<object, RpcStatus>>;
2412
+ frontierServiceCancelSubscription: (orgId: string, billingId: string, id: string, query?: {
2413
+ immediate?: boolean;
2414
+ }, params?: RequestParams) => Promise<HttpResponse<object, RpcStatus>>;
2415
+ /**
2416
+ * @description Change a subscription plan by ID.
2417
+ *
2418
+ * @tags Subscription
2419
+ * @name FrontierServiceChangeSubscription
2420
+ * @summary Change subscription plan
2421
+ * @request POST:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions/{id}/change
2422
+ * @secure
2423
+ */
2424
+ frontierServiceChangeSubscription: (orgId: string, billingId: string, id: string, body: {
2425
+ /** plan to change to */
2426
+ plan?: string;
2427
+ immediate?: boolean;
2428
+ }, params?: RequestParams) => Promise<HttpResponse<V1Beta1ChangeSubscriptionResponse, RpcStatus>>;
2383
2429
  /**
2384
2430
  * @description List all transactions of a billing account.
2385
2431
  *
@@ -3524,4 +3570,4 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
3524
3570
 
3525
3571
  declare const FrontierClient: typeof V1Beta1;
3526
3572
 
3527
- export { BillingAccountAddress, BillingAccountBalance, FrontierClient, ProtobufAny, ProtobufNullValue, RpcStatus, V1Beta1, V1Beta1AcceptOrganizationInvitationResponse, V1Beta1AddGroupUsersResponse, V1Beta1AddOrganizationUsersResponse, V1Beta1AddPlatformUserRequest, V1Beta1AddPlatformUserResponse, V1Beta1AuditLog, V1Beta1AuditLogActor, V1Beta1AuditLogTarget, V1Beta1AuthCallbackRequest, V1Beta1AuthCallbackResponse, V1Beta1AuthLogoutResponse, V1Beta1AuthStrategy, V1Beta1AuthTokenRequest, V1Beta1AuthTokenResponse, V1Beta1AuthenticateResponse, V1Beta1BatchCheckPermissionBody, V1Beta1BatchCheckPermissionRequest, V1Beta1BatchCheckPermissionResponse, V1Beta1BatchCheckPermissionResponsePair, V1Beta1BillingAccount, V1Beta1BillingAccountRequestBody, V1Beta1BillingTransaction, V1Beta1CancelSubscriptionResponse, V1Beta1CheckFeatureEntitlementResponse, V1Beta1CheckFederatedResourcePermissionRequest, V1Beta1CheckFederatedResourcePermissionResponse, V1Beta1CheckResourcePermissionRequest, V1Beta1CheckResourcePermissionResponse, V1Beta1CheckoutProductBody, V1Beta1CheckoutSession, V1Beta1CheckoutSubscriptionBody, V1Beta1CreateBillingAccountResponse, V1Beta1CreateBillingUsageResponse, V1Beta1CreateCheckoutResponse, V1Beta1CreateCurrentUserPreferencesRequest, V1Beta1CreateCurrentUserPreferencesResponse, V1Beta1CreateGroupPreferencesResponse, V1Beta1CreateGroupResponse, V1Beta1CreateMetaSchemaResponse, V1Beta1CreateOrganizationAuditLogsResponse, V1Beta1CreateOrganizationDomainResponse, V1Beta1CreateOrganizationInvitationResponse, V1Beta1CreateOrganizationPreferencesResponse, V1Beta1CreateOrganizationResponse, V1Beta1CreateOrganizationRoleResponse, V1Beta1CreatePermissionRequest, V1Beta1CreatePermissionResponse, V1Beta1CreatePlanRequest, V1Beta1CreatePlanResponse, V1Beta1CreatePolicyResponse, V1Beta1CreatePreferencesRequest, V1Beta1CreatePreferencesResponse, V1Beta1CreateProductRequest, V1Beta1CreateProductResponse, V1Beta1CreateProjectPreferencesResponse, V1Beta1CreateProjectResourceResponse, V1Beta1CreateProjectResponse, V1Beta1CreateRelationResponse, V1Beta1CreateRoleResponse, V1Beta1CreateServiceUserKeyResponse, V1Beta1CreateServiceUserRequest, V1Beta1CreateServiceUserResponse, V1Beta1CreateServiceUserSecretResponse, V1Beta1CreateUserPreferencesResponse, V1Beta1CreateUserResponse, V1Beta1DelegatedCheckoutResponse, V1Beta1DeleteBillingAccountResponse, V1Beta1DeleteGroupResponse, V1Beta1DeleteMetaSchemaResponse, V1Beta1DeleteOrganizationDomainResponse, V1Beta1DeleteOrganizationInvitationResponse, V1Beta1DeleteOrganizationResponse, V1Beta1DeleteOrganizationRoleResponse, V1Beta1DeletePermissionResponse, V1Beta1DeletePolicyResponse, V1Beta1DeleteProjectResourceResponse, V1Beta1DeleteProjectResponse, V1Beta1DeleteRelationResponse, V1Beta1DeleteRoleResponse, V1Beta1DeleteServiceUserKeyResponse, V1Beta1DeleteServiceUserResponse, V1Beta1DeleteServiceUserSecretResponse, V1Beta1DeleteUserResponse, V1Beta1DescribePreferencesResponse, V1Beta1DisableGroupResponse, V1Beta1DisableOrganizationResponse, V1Beta1DisableProjectResponse, V1Beta1DisableUserResponse, V1Beta1Domain, V1Beta1EnableGroupResponse, V1Beta1EnableOrganizationResponse, V1Beta1EnableProjectResponse, V1Beta1EnableUserResponse, V1Beta1Feature, V1Beta1GetBillingAccountResponse, V1Beta1GetBillingBalanceResponse, V1Beta1GetCurrentUserResponse, V1Beta1GetGroupResponse, V1Beta1GetJWKsResponse, V1Beta1GetMetaSchemaResponse, V1Beta1GetNamespaceResponse, V1Beta1GetOrganizationAuditLogResponse, V1Beta1GetOrganizationDomainResponse, V1Beta1GetOrganizationInvitationResponse, V1Beta1GetOrganizationResponse, V1Beta1GetOrganizationRoleResponse, V1Beta1GetPermissionResponse, V1Beta1GetPlanResponse, V1Beta1GetPolicyResponse, V1Beta1GetProductResponse, V1Beta1GetProjectResourceResponse, V1Beta1GetProjectResponse, V1Beta1GetRelationResponse, V1Beta1GetServiceUserKeyResponse, V1Beta1GetServiceUserResponse, V1Beta1GetSubscriptionResponse, V1Beta1GetUpcomingInvoiceResponse, V1Beta1GetUserResponse, V1Beta1Group, V1Beta1GroupRequestBody, V1Beta1Invitation, V1Beta1Invoice, V1Beta1JSONWebKey, V1Beta1JoinOrganizationResponse, V1Beta1KeyCredential, V1Beta1ListAllOrganizationsResponse, V1Beta1ListAllUsersResponse, V1Beta1ListAuthStrategiesResponse, V1Beta1ListBillingAccountsResponse, V1Beta1ListBillingTransactionsResponse, V1Beta1ListCheckoutsResponse, V1Beta1ListCurrentUserGroupsResponse, V1Beta1ListCurrentUserGroupsResponseAccessPair, V1Beta1ListCurrentUserInvitationsResponse, V1Beta1ListCurrentUserPreferencesResponse, V1Beta1ListGroupPreferencesResponse, V1Beta1ListGroupUsersResponse, V1Beta1ListGroupUsersResponseRolePair, V1Beta1ListGroupsResponse, V1Beta1ListInvoicesResponse, V1Beta1ListMetaSchemasResponse, V1Beta1ListNamespacesResponse, V1Beta1ListOrganizationAdminsResponse, V1Beta1ListOrganizationAuditLogsResponse, V1Beta1ListOrganizationDomainsResponse, V1Beta1ListOrganizationGroupsResponse, V1Beta1ListOrganizationInvitationsResponse, V1Beta1ListOrganizationPreferencesResponse, V1Beta1ListOrganizationProjectsResponse, V1Beta1ListOrganizationRolesResponse, V1Beta1ListOrganizationServiceUsersResponse, V1Beta1ListOrganizationUsersResponse, V1Beta1ListOrganizationUsersResponseRolePair, V1Beta1ListOrganizationsByCurrentUserResponse, V1Beta1ListOrganizationsByUserResponse, V1Beta1ListOrganizationsResponse, V1Beta1ListPermissionsResponse, V1Beta1ListPlansResponse, V1Beta1ListPlatformUsersResponse, V1Beta1ListPoliciesResponse, V1Beta1ListPreferencesResponse, V1Beta1ListProductsResponse, V1Beta1ListProjectAdminsResponse, V1Beta1ListProjectGroupsResponse, V1Beta1ListProjectGroupsResponseRolePair, V1Beta1ListProjectPreferencesResponse, V1Beta1ListProjectResourcesResponse, V1Beta1ListProjectServiceUsersResponse, V1Beta1ListProjectServiceUsersResponseRolePair, V1Beta1ListProjectUsersResponse, V1Beta1ListProjectUsersResponseRolePair, V1Beta1ListProjectsByCurrentUserResponse, V1Beta1ListProjectsByCurrentUserResponseAccessPair, V1Beta1ListProjectsByUserResponse, V1Beta1ListProjectsResponse, V1Beta1ListRelationsResponse, V1Beta1ListResourcesResponse, V1Beta1ListRolesResponse, V1Beta1ListServiceUserKeysResponse, V1Beta1ListServiceUserSecretsResponse, V1Beta1ListServiceUsersResponse, V1Beta1ListSubscriptionsResponse, V1Beta1ListUserGroupsResponse, V1Beta1ListUserInvitationsResponse, V1Beta1ListUserPreferencesResponse, V1Beta1ListUsersResponse, V1Beta1MetaSchema, V1Beta1MetaSchemaRequestBody, V1Beta1Namespace, V1Beta1Organization, V1Beta1OrganizationRequestBody, V1Beta1PaymentMethod, V1Beta1Permission, V1Beta1PermissionRequestBody, V1Beta1Plan, V1Beta1PlanRequestBody, V1Beta1Policy, V1Beta1PolicyRequestBody, V1Beta1Preference, V1Beta1PreferenceRequestBody, V1Beta1PreferenceTrait, V1Beta1Price, V1Beta1Product, V1Beta1ProductRequestBody, V1Beta1Project, V1Beta1ProjectRequestBody, V1Beta1Relation, V1Beta1RelationRequestBody, V1Beta1RemoveGroupUserResponse, V1Beta1RemoveOrganizationUserResponse, V1Beta1Resource, V1Beta1ResourceRequestBody, V1Beta1Role, V1Beta1RoleRequestBody, V1Beta1SecretCredential, V1Beta1ServiceUser, V1Beta1ServiceUserKey, V1Beta1ServiceUserRequestBody, V1Beta1Subscription, V1Beta1UpdateBillingAccountResponse, V1Beta1UpdateCurrentUserResponse, V1Beta1UpdateGroupResponse, V1Beta1UpdateMetaSchemaResponse, V1Beta1UpdateOrganizationResponse, V1Beta1UpdateOrganizationRoleResponse, V1Beta1UpdatePermissionResponse, V1Beta1UpdatePlanResponse, V1Beta1UpdatePolicyResponse, V1Beta1UpdateProductResponse, V1Beta1UpdateProjectResourceResponse, V1Beta1UpdateProjectResponse, V1Beta1UpdateRoleResponse, V1Beta1UpdateSubscriptionResponse, V1Beta1UpdateUserResponse, V1Beta1Usage, V1Beta1User, V1Beta1UserRequestBody, V1Beta1VerifyOrganizationDomainResponse };
3573
+ export { BillingAccountAddress, BillingAccountBalance, FrontierClient, ProductBehaviorConfig, ProtobufAny, ProtobufNullValue, RpcStatus, SubscriptionPhase, V1Beta1, V1Beta1AcceptOrganizationInvitationResponse, V1Beta1AddGroupUsersResponse, V1Beta1AddOrganizationUsersResponse, V1Beta1AddPlatformUserRequest, V1Beta1AddPlatformUserResponse, V1Beta1AuditLog, V1Beta1AuditLogActor, V1Beta1AuditLogTarget, V1Beta1AuthCallbackRequest, V1Beta1AuthCallbackResponse, V1Beta1AuthLogoutResponse, V1Beta1AuthStrategy, V1Beta1AuthTokenRequest, V1Beta1AuthTokenResponse, V1Beta1AuthenticateResponse, V1Beta1BatchCheckPermissionBody, V1Beta1BatchCheckPermissionRequest, V1Beta1BatchCheckPermissionResponse, V1Beta1BatchCheckPermissionResponsePair, V1Beta1BillingAccount, V1Beta1BillingAccountRequestBody, V1Beta1BillingTransaction, V1Beta1CancelSubscriptionResponse, V1Beta1ChangeSubscriptionResponse, V1Beta1CheckFeatureEntitlementResponse, V1Beta1CheckFederatedResourcePermissionRequest, V1Beta1CheckFederatedResourcePermissionResponse, V1Beta1CheckResourcePermissionRequest, V1Beta1CheckResourcePermissionResponse, V1Beta1CheckoutProductBody, V1Beta1CheckoutSession, V1Beta1CheckoutSetupBody, V1Beta1CheckoutSubscriptionBody, V1Beta1CreateBillingAccountResponse, V1Beta1CreateBillingUsageResponse, V1Beta1CreateCheckoutResponse, V1Beta1CreateCurrentUserPreferencesRequest, V1Beta1CreateCurrentUserPreferencesResponse, V1Beta1CreateGroupPreferencesResponse, V1Beta1CreateGroupResponse, V1Beta1CreateMetaSchemaResponse, V1Beta1CreateOrganizationAuditLogsResponse, V1Beta1CreateOrganizationDomainResponse, V1Beta1CreateOrganizationInvitationResponse, V1Beta1CreateOrganizationPreferencesResponse, V1Beta1CreateOrganizationResponse, V1Beta1CreateOrganizationRoleResponse, V1Beta1CreatePermissionRequest, V1Beta1CreatePermissionResponse, V1Beta1CreatePlanRequest, V1Beta1CreatePlanResponse, V1Beta1CreatePolicyResponse, V1Beta1CreatePreferencesRequest, V1Beta1CreatePreferencesResponse, V1Beta1CreateProductRequest, V1Beta1CreateProductResponse, V1Beta1CreateProjectPreferencesResponse, V1Beta1CreateProjectResourceResponse, V1Beta1CreateProjectResponse, V1Beta1CreateRelationResponse, V1Beta1CreateRoleResponse, V1Beta1CreateServiceUserKeyResponse, V1Beta1CreateServiceUserRequest, V1Beta1CreateServiceUserResponse, V1Beta1CreateServiceUserSecretResponse, V1Beta1CreateUserPreferencesResponse, V1Beta1CreateUserResponse, V1Beta1DelegatedCheckoutResponse, V1Beta1DeleteBillingAccountResponse, V1Beta1DeleteGroupResponse, V1Beta1DeleteMetaSchemaResponse, V1Beta1DeleteOrganizationDomainResponse, V1Beta1DeleteOrganizationInvitationResponse, V1Beta1DeleteOrganizationResponse, V1Beta1DeleteOrganizationRoleResponse, V1Beta1DeletePermissionResponse, V1Beta1DeletePolicyResponse, V1Beta1DeleteProjectResourceResponse, V1Beta1DeleteProjectResponse, V1Beta1DeleteRelationResponse, V1Beta1DeleteRoleResponse, V1Beta1DeleteServiceUserKeyResponse, V1Beta1DeleteServiceUserResponse, V1Beta1DeleteServiceUserSecretResponse, V1Beta1DeleteUserResponse, V1Beta1DescribePreferencesResponse, V1Beta1DisableGroupResponse, V1Beta1DisableOrganizationResponse, V1Beta1DisableProjectResponse, V1Beta1DisableUserResponse, V1Beta1Domain, V1Beta1EnableGroupResponse, V1Beta1EnableOrganizationResponse, V1Beta1EnableProjectResponse, V1Beta1EnableUserResponse, V1Beta1Feature, V1Beta1GetBillingAccountResponse, V1Beta1GetBillingBalanceResponse, V1Beta1GetCurrentUserResponse, V1Beta1GetGroupResponse, V1Beta1GetJWKsResponse, V1Beta1GetMetaSchemaResponse, V1Beta1GetNamespaceResponse, V1Beta1GetOrganizationAuditLogResponse, V1Beta1GetOrganizationDomainResponse, V1Beta1GetOrganizationInvitationResponse, V1Beta1GetOrganizationResponse, V1Beta1GetOrganizationRoleResponse, V1Beta1GetPermissionResponse, V1Beta1GetPlanResponse, V1Beta1GetPolicyResponse, V1Beta1GetProductResponse, V1Beta1GetProjectResourceResponse, V1Beta1GetProjectResponse, V1Beta1GetRelationResponse, V1Beta1GetServiceUserKeyResponse, V1Beta1GetServiceUserResponse, V1Beta1GetSubscriptionResponse, V1Beta1GetUpcomingInvoiceResponse, V1Beta1GetUserResponse, V1Beta1Group, V1Beta1GroupRequestBody, V1Beta1Invitation, V1Beta1Invoice, V1Beta1JSONWebKey, V1Beta1JoinOrganizationResponse, V1Beta1KeyCredential, V1Beta1ListAllOrganizationsResponse, V1Beta1ListAllUsersResponse, V1Beta1ListAuthStrategiesResponse, V1Beta1ListBillingAccountsResponse, V1Beta1ListBillingTransactionsResponse, V1Beta1ListCheckoutsResponse, V1Beta1ListCurrentUserGroupsResponse, V1Beta1ListCurrentUserGroupsResponseAccessPair, V1Beta1ListCurrentUserInvitationsResponse, V1Beta1ListCurrentUserPreferencesResponse, V1Beta1ListGroupPreferencesResponse, V1Beta1ListGroupUsersResponse, V1Beta1ListGroupUsersResponseRolePair, V1Beta1ListGroupsResponse, V1Beta1ListInvoicesResponse, V1Beta1ListMetaSchemasResponse, V1Beta1ListNamespacesResponse, V1Beta1ListOrganizationAdminsResponse, V1Beta1ListOrganizationAuditLogsResponse, V1Beta1ListOrganizationDomainsResponse, V1Beta1ListOrganizationGroupsResponse, V1Beta1ListOrganizationInvitationsResponse, V1Beta1ListOrganizationPreferencesResponse, V1Beta1ListOrganizationProjectsResponse, V1Beta1ListOrganizationRolesResponse, V1Beta1ListOrganizationServiceUsersResponse, V1Beta1ListOrganizationUsersResponse, V1Beta1ListOrganizationUsersResponseRolePair, V1Beta1ListOrganizationsByCurrentUserResponse, V1Beta1ListOrganizationsByUserResponse, V1Beta1ListOrganizationsResponse, V1Beta1ListPermissionsResponse, V1Beta1ListPlansResponse, V1Beta1ListPlatformUsersResponse, V1Beta1ListPoliciesResponse, V1Beta1ListPreferencesResponse, V1Beta1ListProductsResponse, V1Beta1ListProjectAdminsResponse, V1Beta1ListProjectGroupsResponse, V1Beta1ListProjectGroupsResponseRolePair, V1Beta1ListProjectPreferencesResponse, V1Beta1ListProjectResourcesResponse, V1Beta1ListProjectServiceUsersResponse, V1Beta1ListProjectServiceUsersResponseRolePair, V1Beta1ListProjectUsersResponse, V1Beta1ListProjectUsersResponseRolePair, V1Beta1ListProjectsByCurrentUserResponse, V1Beta1ListProjectsByCurrentUserResponseAccessPair, V1Beta1ListProjectsByUserResponse, V1Beta1ListProjectsResponse, V1Beta1ListRelationsResponse, V1Beta1ListResourcesResponse, V1Beta1ListRolesResponse, V1Beta1ListServiceUserKeysResponse, V1Beta1ListServiceUserSecretsResponse, V1Beta1ListServiceUsersResponse, V1Beta1ListSubscriptionsResponse, V1Beta1ListUserGroupsResponse, V1Beta1ListUserInvitationsResponse, V1Beta1ListUserPreferencesResponse, V1Beta1ListUsersResponse, V1Beta1MetaSchema, V1Beta1MetaSchemaRequestBody, V1Beta1Namespace, V1Beta1Organization, V1Beta1OrganizationRequestBody, V1Beta1PaymentMethod, V1Beta1Permission, V1Beta1PermissionRequestBody, V1Beta1Plan, V1Beta1PlanRequestBody, V1Beta1Policy, V1Beta1PolicyRequestBody, V1Beta1Preference, V1Beta1PreferenceRequestBody, V1Beta1PreferenceTrait, V1Beta1Price, V1Beta1Product, V1Beta1ProductRequestBody, V1Beta1Project, V1Beta1ProjectRequestBody, V1Beta1Relation, V1Beta1RelationRequestBody, V1Beta1RemoveGroupUserResponse, V1Beta1RemoveOrganizationUserResponse, V1Beta1Resource, V1Beta1ResourceRequestBody, V1Beta1Role, V1Beta1RoleRequestBody, V1Beta1SecretCredential, V1Beta1ServiceUser, V1Beta1ServiceUserKey, V1Beta1ServiceUserRequestBody, V1Beta1Subscription, V1Beta1UpdateBillingAccountResponse, V1Beta1UpdateCurrentUserResponse, V1Beta1UpdateGroupResponse, V1Beta1UpdateMetaSchemaResponse, V1Beta1UpdateOrganizationResponse, V1Beta1UpdateOrganizationRoleResponse, V1Beta1UpdatePermissionResponse, V1Beta1UpdatePlanResponse, V1Beta1UpdatePolicyResponse, V1Beta1UpdateProductResponse, V1Beta1UpdateProjectResourceResponse, V1Beta1UpdateProjectResponse, V1Beta1UpdateRoleResponse, V1Beta1UpdateSubscriptionResponse, V1Beta1UpdateUserResponse, V1Beta1Usage, V1Beta1User, V1Beta1UserRequestBody, V1Beta1VerifyOrganizationDomainResponse };
package/dist/index.js CHANGED
@@ -1216,9 +1216,10 @@ var V1Beta1 = class extends HttpClient {
1216
1216
  * @request GET:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions
1217
1217
  * @secure
1218
1218
  */
1219
- this.frontierServiceListSubscriptions = (orgId, billingId, params = {}) => this.request(__spreadValues({
1219
+ this.frontierServiceListSubscriptions = (orgId, billingId, query, params = {}) => this.request(__spreadValues({
1220
1220
  path: `/v1beta1/organizations/${orgId}/billing/${billingId}/subscriptions`,
1221
1221
  method: "GET",
1222
+ query,
1222
1223
  secure: true,
1223
1224
  format: "json"
1224
1225
  }, params));
@@ -1263,12 +1264,30 @@ var V1Beta1 = class extends HttpClient {
1263
1264
  * @request POST:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions/{id}/cancel
1264
1265
  * @secure
1265
1266
  */
1266
- this.frontierServiceCancelSubscription = (orgId, billingId, id, params = {}) => this.request(__spreadValues({
1267
+ this.frontierServiceCancelSubscription = (orgId, billingId, id, query, params = {}) => this.request(__spreadValues({
1267
1268
  path: `/v1beta1/organizations/${orgId}/billing/${billingId}/subscriptions/${id}/cancel`,
1268
1269
  method: "POST",
1270
+ query,
1269
1271
  secure: true,
1270
1272
  format: "json"
1271
1273
  }, params));
1274
+ /**
1275
+ * @description Change a subscription plan by ID.
1276
+ *
1277
+ * @tags Subscription
1278
+ * @name FrontierServiceChangeSubscription
1279
+ * @summary Change subscription plan
1280
+ * @request POST:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions/{id}/change
1281
+ * @secure
1282
+ */
1283
+ this.frontierServiceChangeSubscription = (orgId, billingId, id, body, params = {}) => this.request(__spreadValues({
1284
+ path: `/v1beta1/organizations/${orgId}/billing/${billingId}/subscriptions/${id}/change`,
1285
+ method: "POST",
1286
+ body,
1287
+ secure: true,
1288
+ type: "application/json" /* Json */,
1289
+ format: "json"
1290
+ }, params));
1272
1291
  /**
1273
1292
  * @description List all transactions of a billing account.
1274
1293
  *
package/dist/index.mjs CHANGED
@@ -1191,9 +1191,10 @@ var V1Beta1 = class extends HttpClient {
1191
1191
  * @request GET:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions
1192
1192
  * @secure
1193
1193
  */
1194
- this.frontierServiceListSubscriptions = (orgId, billingId, params = {}) => this.request(__spreadValues({
1194
+ this.frontierServiceListSubscriptions = (orgId, billingId, query, params = {}) => this.request(__spreadValues({
1195
1195
  path: `/v1beta1/organizations/${orgId}/billing/${billingId}/subscriptions`,
1196
1196
  method: "GET",
1197
+ query,
1197
1198
  secure: true,
1198
1199
  format: "json"
1199
1200
  }, params));
@@ -1238,12 +1239,30 @@ var V1Beta1 = class extends HttpClient {
1238
1239
  * @request POST:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions/{id}/cancel
1239
1240
  * @secure
1240
1241
  */
1241
- this.frontierServiceCancelSubscription = (orgId, billingId, id, params = {}) => this.request(__spreadValues({
1242
+ this.frontierServiceCancelSubscription = (orgId, billingId, id, query, params = {}) => this.request(__spreadValues({
1242
1243
  path: `/v1beta1/organizations/${orgId}/billing/${billingId}/subscriptions/${id}/cancel`,
1243
1244
  method: "POST",
1245
+ query,
1244
1246
  secure: true,
1245
1247
  format: "json"
1246
1248
  }, params));
1249
+ /**
1250
+ * @description Change a subscription plan by ID.
1251
+ *
1252
+ * @tags Subscription
1253
+ * @name FrontierServiceChangeSubscription
1254
+ * @summary Change subscription plan
1255
+ * @request POST:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions/{id}/change
1256
+ * @secure
1257
+ */
1258
+ this.frontierServiceChangeSubscription = (orgId, billingId, id, body, params = {}) => this.request(__spreadValues({
1259
+ path: `/v1beta1/organizations/${orgId}/billing/${billingId}/subscriptions/${id}/change`,
1260
+ method: "POST",
1261
+ body,
1262
+ secure: true,
1263
+ type: "application/json" /* Json */,
1264
+ format: "json"
1265
+ }, params));
1247
1266
  /**
1248
1267
  * @description List all transactions of a billing account.
1249
1268
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raystack/frontier",
3
- "version": "0.8.22",
3
+ "version": "0.8.24",
4
4
  "description": "A js library for frontier",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -195,7 +195,17 @@ declare const router: Router<Route<any, "/", "/", string, "__root__", _tanstack_
195
195
  }, _tanstack_react_router.AnyContext, unknown, _tanstack_react_router.AnyRoute>[], _tanstack_react_router.AnyRoute> | Route<_tanstack_react_router.RootRoute<_tanstack_react_router.AnyContext, unknown, {}, _tanstack_react_router.RouteContext, Pick<OrganizationProfileProps, "organizationId" | "tempShowBilling">>, "/plans", "/plans", string, "/plans", {}, unknown, {}, {}, {}, {}, _tanstack_react_router.RouteContext, {
196
196
  organizationId: string;
197
197
  tempShowBilling?: boolean | undefined;
198
- }, _tanstack_react_router.AnyContext, unknown, _tanstack_react_router.AnyRoute>)[], any>, Record<string, any>>;
198
+ }, _tanstack_react_router.AnyContext, Route<Route<_tanstack_react_router.RootRoute<_tanstack_react_router.AnyContext, unknown, {}, _tanstack_react_router.RouteContext, Pick<OrganizationProfileProps, "organizationId" | "tempShowBilling">>, "/plans", "/plans", string, "/plans", {}, unknown, {}, {}, {}, {}, _tanstack_react_router.RouteContext, {
199
+ organizationId: string;
200
+ tempShowBilling?: boolean | undefined;
201
+ }, _tanstack_react_router.AnyContext, unknown, _tanstack_react_router.AnyRoute>, "/confirm-change/$planId", "/plans/confirm-change/$planId", string, "/plans/confirm-change/$planId", {}, unknown, {}, {}, {
202
+ planId: string;
203
+ }, {
204
+ planId: string;
205
+ }, _tanstack_react_router.RouteContext, {
206
+ organizationId: string;
207
+ tempShowBilling?: boolean | undefined;
208
+ }, _tanstack_react_router.AnyContext, unknown, _tanstack_react_router.AnyRoute>[], _tanstack_react_router.AnyRoute>)[], any>, Record<string, any>>;
199
209
  declare const OrganizationProfile: ({ organizationId, defaultRoute, tempShowBilling }: OrganizationProfileProps) => react_jsx_runtime.JSX.Element;
200
210
  declare module '@tanstack/react-router' {
201
211
  interface Register {
@@ -308,6 +318,17 @@ interface BillingAccountBalance {
308
318
  /** @format date-time */
309
319
  updated_at?: string;
310
320
  }
321
+ interface ProductBehaviorConfig {
322
+ /** @format int64 */
323
+ credit_amount?: string;
324
+ /** @format int64 */
325
+ seat_limit?: string;
326
+ }
327
+ interface SubscriptionPhase {
328
+ /** @format date-time */
329
+ effective_at?: string;
330
+ plan_id?: string;
331
+ }
311
332
  interface ProtobufAny {
312
333
  '@type'?: string;
313
334
  [key: string]: any;
@@ -456,6 +477,9 @@ interface V1Beta1BillingTransaction {
456
477
  /** @format date-time */
457
478
  updated_at?: string;
458
479
  }
480
+ interface V1Beta1ChangeSubscriptionResponse {
481
+ phase?: SubscriptionPhase;
482
+ }
459
483
  interface V1Beta1CheckFeatureEntitlementResponse {
460
484
  status?: boolean;
461
485
  }
@@ -492,6 +516,8 @@ interface V1Beta1CheckoutSession {
492
516
  success_url?: string;
493
517
  cancel_url?: string;
494
518
  state?: string;
519
+ plan?: string;
520
+ product?: string;
495
521
  metadata?: object;
496
522
  /** @format date-time */
497
523
  created_at?: string;
@@ -500,6 +526,9 @@ interface V1Beta1CheckoutSession {
500
526
  /** @format date-time */
501
527
  expire_at?: string;
502
528
  }
529
+ interface V1Beta1CheckoutSetupBody {
530
+ payment_method?: boolean;
531
+ }
503
532
  interface V1Beta1CheckoutSubscriptionBody {
504
533
  plan?: string;
505
534
  /** @format int32 */
@@ -610,8 +639,10 @@ interface V1Beta1CreateUserResponse {
610
639
  user?: V1Beta1User;
611
640
  }
612
641
  interface V1Beta1DelegatedCheckoutResponse {
613
- /** Checkout session */
614
- checkout_session?: V1Beta1CheckoutSession;
642
+ /** subscription if created */
643
+ subscription?: V1Beta1Subscription;
644
+ /** product if bought */
645
+ product?: V1Beta1Product;
615
646
  }
616
647
  interface V1Beta1DescribePreferencesResponse {
617
648
  traits?: V1Beta1PreferenceTrait[];
@@ -1242,6 +1273,8 @@ interface V1Beta1Plan {
1242
1273
  products?: V1Beta1Product[];
1243
1274
  /** known intervals are "day", "week", "month", and "year" */
1244
1275
  interval?: string;
1276
+ /** @format int64 */
1277
+ on_start_credits?: string;
1245
1278
  metadata?: object;
1246
1279
  /** @format date-time */
1247
1280
  created_at?: string;
@@ -1255,6 +1288,8 @@ interface V1Beta1PlanRequestBody {
1255
1288
  products?: V1Beta1Product[];
1256
1289
  /** known intervals are "day", "week", "month", and "year" */
1257
1290
  interval?: string;
1291
+ /** @format int64 */
1292
+ on_start_credits?: string;
1258
1293
  metadata?: object;
1259
1294
  }
1260
1295
  interface V1Beta1Policy {
@@ -1371,10 +1406,9 @@ interface V1Beta1Product {
1371
1406
  plan_ids?: string[];
1372
1407
  state?: string;
1373
1408
  prices?: V1Beta1Price[];
1374
- /** @format int64 */
1375
- credit_amount?: string;
1376
1409
  behavior?: string;
1377
1410
  features?: V1Beta1Feature[];
1411
+ behavior_config?: ProductBehaviorConfig;
1378
1412
  metadata?: object;
1379
1413
  /** @format date-time */
1380
1414
  created_at?: string;
@@ -1387,10 +1421,9 @@ interface V1Beta1ProductRequestBody {
1387
1421
  description?: string;
1388
1422
  plan_id?: string;
1389
1423
  prices?: V1Beta1Price[];
1390
- /** @format int64 */
1391
- credit_amount?: string;
1392
1424
  behavior?: string;
1393
1425
  features?: V1Beta1Feature[];
1426
+ behavior_config?: ProductBehaviorConfig;
1394
1427
  metadata?: object;
1395
1428
  }
1396
1429
  interface V1Beta1Project {
@@ -1598,6 +1631,7 @@ interface V1Beta1Subscription {
1598
1631
  canceled_at?: string;
1599
1632
  /** @format date-time */
1600
1633
  ended_at?: string;
1634
+ phases?: SubscriptionPhase[];
1601
1635
  }
1602
1636
  interface V1Beta1UpdateBillingAccountResponse {
1603
1637
  /** Updated billing account */
@@ -2504,6 +2538,8 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2504
2538
  subscription_body?: V1Beta1CheckoutSubscriptionBody;
2505
2539
  /** Product to buy */
2506
2540
  product_body?: V1Beta1CheckoutProductBody;
2541
+ /** Payment method setup */
2542
+ setup_body?: V1Beta1CheckoutSetupBody;
2507
2543
  }, params?: RequestParams) => Promise<HttpResponse<V1Beta1CreateCheckoutResponse, RpcStatus>>;
2508
2544
  /**
2509
2545
  * @description List all invoices of a billing account.
@@ -2534,7 +2570,11 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2534
2570
  * @request GET:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions
2535
2571
  * @secure
2536
2572
  */
2537
- frontierServiceListSubscriptions: (orgId: string, billingId: string, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListSubscriptionsResponse, RpcStatus>>;
2573
+ frontierServiceListSubscriptions: (orgId: string, billingId: string, query?: {
2574
+ /** Filter subscriptions by state */
2575
+ state?: string;
2576
+ plan?: string;
2577
+ }, params?: RequestParams) => Promise<HttpResponse<V1Beta1ListSubscriptionsResponse, RpcStatus>>;
2538
2578
  /**
2539
2579
  * @description Get a subscription by ID.
2540
2580
  *
@@ -2566,7 +2606,23 @@ declare class V1Beta1<SecurityDataType = unknown> extends HttpClient<SecurityDat
2566
2606
  * @request POST:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions/{id}/cancel
2567
2607
  * @secure
2568
2608
  */
2569
- frontierServiceCancelSubscription: (orgId: string, billingId: string, id: string, params?: RequestParams) => Promise<HttpResponse<object, RpcStatus>>;
2609
+ frontierServiceCancelSubscription: (orgId: string, billingId: string, id: string, query?: {
2610
+ immediate?: boolean;
2611
+ }, params?: RequestParams) => Promise<HttpResponse<object, RpcStatus>>;
2612
+ /**
2613
+ * @description Change a subscription plan by ID.
2614
+ *
2615
+ * @tags Subscription
2616
+ * @name FrontierServiceChangeSubscription
2617
+ * @summary Change subscription plan
2618
+ * @request POST:/v1beta1/organizations/{org_id}/billing/{billing_id}/subscriptions/{id}/change
2619
+ * @secure
2620
+ */
2621
+ frontierServiceChangeSubscription: (orgId: string, billingId: string, id: string, body: {
2622
+ /** plan to change to */
2623
+ plan?: string;
2624
+ immediate?: boolean;
2625
+ }, params?: RequestParams) => Promise<HttpResponse<V1Beta1ChangeSubscriptionResponse, RpcStatus>>;
2570
2626
  /**
2571
2627
  * @description List all transactions of a billing account.
2572
2628
  *
@@ -3734,6 +3790,11 @@ interface FrontierContextProviderProps {
3734
3790
  setActiveSubscription: Dispatch<SetStateAction<V1Beta1Subscription | undefined>>;
3735
3791
  isActiveSubscriptionLoading: boolean;
3736
3792
  setIsActiveSubscriptionLoading: Dispatch<SetStateAction<boolean>>;
3793
+ activePlan: V1Beta1Plan | undefined;
3794
+ setActivePlan: Dispatch<SetStateAction<V1Beta1Plan | undefined>>;
3795
+ isActivePlanLoading: boolean;
3796
+ setIsActivePlanLoading: Dispatch<SetStateAction<boolean>>;
3797
+ fetchActiveSubsciption: () => Promise<V1Beta1Subscription | undefined>;
3737
3798
  }
3738
3799
  declare function useFrontier(): FrontierContextProviderProps;
3739
3800