@scalemule/sdk 0.0.10 → 0.0.11

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.mts CHANGED
@@ -2231,6 +2231,193 @@ declare class AnalyticsService extends ServiceModule {
2231
2231
  query(filters?: Record<string, unknown>): Promise<ApiResponse<AnalyticsEvent[]>>;
2232
2232
  }
2233
2233
 
2234
+ interface FlagDefinition {
2235
+ id: string;
2236
+ application_id: string;
2237
+ flag_key: string;
2238
+ name: string;
2239
+ description?: string | null;
2240
+ flag_type: 'boolean' | 'string' | 'number' | 'json';
2241
+ default_value: unknown;
2242
+ status: 'active' | 'inactive' | 'archived';
2243
+ tags: string[];
2244
+ created_by?: string | null;
2245
+ created_at: string;
2246
+ updated_at: string;
2247
+ }
2248
+ interface FlagEnvironment {
2249
+ id: string;
2250
+ application_id: string;
2251
+ flag_id: string;
2252
+ environment: string;
2253
+ enabled: boolean;
2254
+ default_value?: unknown;
2255
+ }
2256
+ interface FlagCondition {
2257
+ attribute: string;
2258
+ operator: 'eq' | 'neq' | 'in' | 'not_in' | 'contains' | 'starts_with' | 'ends_with' | 'gt' | 'gte' | 'lt' | 'lte' | 'regex' | 'semver_eq' | 'semver_neq' | 'semver_gt' | 'semver_gte' | 'semver_lt' | 'semver_lte' | 'exists' | 'not_exists' | string;
2259
+ value?: unknown;
2260
+ values?: unknown[];
2261
+ }
2262
+ interface TargetingRule {
2263
+ id: string;
2264
+ application_id: string;
2265
+ flag_id: string;
2266
+ environment: string;
2267
+ name: string;
2268
+ priority: number;
2269
+ serve_value: unknown;
2270
+ rollout_percentage?: number | null;
2271
+ conditions: FlagCondition[];
2272
+ enabled: boolean;
2273
+ created_at: string;
2274
+ updated_at: string;
2275
+ }
2276
+ interface FlagVariant {
2277
+ id: string;
2278
+ application_id: string;
2279
+ flag_id: string;
2280
+ variant_key: string;
2281
+ value: unknown;
2282
+ weight: number;
2283
+ created_at: string;
2284
+ updated_at: string;
2285
+ }
2286
+ interface FlagSegment {
2287
+ id: string;
2288
+ application_id: string;
2289
+ segment_key: string;
2290
+ name: string;
2291
+ description?: string | null;
2292
+ conditions: FlagCondition[];
2293
+ included_users: string[];
2294
+ excluded_users: string[];
2295
+ created_at: string;
2296
+ updated_at: string;
2297
+ }
2298
+ interface FlagAuditEntry {
2299
+ id: string;
2300
+ application_id: string;
2301
+ flag_id?: string | null;
2302
+ actor_type: string;
2303
+ actor_id: string;
2304
+ actor_email?: string | null;
2305
+ action: string;
2306
+ before_value?: unknown;
2307
+ after_value?: unknown;
2308
+ metadata?: unknown;
2309
+ created_at: string;
2310
+ }
2311
+ interface FlagDetail {
2312
+ flag: FlagDefinition;
2313
+ environments: FlagEnvironment[];
2314
+ rules: TargetingRule[];
2315
+ variants: FlagVariant[];
2316
+ }
2317
+ interface FlagEvaluation<T = unknown> {
2318
+ flag_id: string;
2319
+ flag_key: string;
2320
+ environment: string;
2321
+ value: T;
2322
+ reason: 'disabled' | 'rule_match' | 'variant' | 'default' | string;
2323
+ matched_rule_id?: string | null;
2324
+ variant_key?: string | null;
2325
+ bucket?: number | null;
2326
+ }
2327
+ interface CreateFlagRequest {
2328
+ flag_key: string;
2329
+ name: string;
2330
+ description?: string;
2331
+ flag_type?: 'boolean' | 'string' | 'number' | 'json';
2332
+ default_value?: unknown;
2333
+ tags?: string[];
2334
+ }
2335
+ interface UpdateFlagRequest {
2336
+ flag_key?: string;
2337
+ name?: string;
2338
+ description?: string | null;
2339
+ flag_type?: 'boolean' | 'string' | 'number' | 'json';
2340
+ default_value?: unknown;
2341
+ tags?: string[];
2342
+ status?: 'active' | 'inactive' | 'archived';
2343
+ }
2344
+ interface CreateRuleRequest {
2345
+ environment: string;
2346
+ name: string;
2347
+ priority?: number;
2348
+ serve_value: unknown;
2349
+ rollout_percentage?: number | null;
2350
+ conditions?: FlagCondition[];
2351
+ enabled?: boolean;
2352
+ }
2353
+ interface UpdateRuleRequest extends Partial<CreateRuleRequest> {
2354
+ }
2355
+ interface CreateVariantRequest {
2356
+ variant_key: string;
2357
+ value: unknown;
2358
+ weight: number;
2359
+ }
2360
+ interface UpdateVariantRequest extends Partial<CreateVariantRequest> {
2361
+ }
2362
+ interface CreateSegmentRequest {
2363
+ segment_key: string;
2364
+ name: string;
2365
+ description?: string;
2366
+ conditions?: FlagCondition[];
2367
+ included_users?: string[];
2368
+ excluded_users?: string[];
2369
+ }
2370
+ interface UpdateSegmentRequest extends Partial<CreateSegmentRequest> {
2371
+ }
2372
+ interface UpsertEnvironmentRequest {
2373
+ enabled: boolean;
2374
+ default_value?: unknown;
2375
+ }
2376
+ declare class FlagsService extends ServiceModule {
2377
+ protected basePath: string;
2378
+ evaluate<T = unknown>(flagKey: string, context?: Record<string, unknown>, environment?: string, options?: RequestOptions): Promise<ApiResponse<FlagEvaluation<T>>>;
2379
+ evaluateBatch(flagKeys: string[], context?: Record<string, unknown>, environment?: string, options?: RequestOptions): Promise<ApiResponse<Record<string, FlagEvaluation>>>;
2380
+ evaluateAll(context?: Record<string, unknown>, environment?: string, options?: RequestOptions): Promise<ApiResponse<Record<string, FlagEvaluation>>>;
2381
+ list(params?: {
2382
+ applicationId?: string;
2383
+ status?: string;
2384
+ search?: string;
2385
+ }, options?: RequestOptions): Promise<ApiResponse<FlagDefinition[]>>;
2386
+ get(id: string, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2387
+ create(data: CreateFlagRequest, params?: {
2388
+ applicationId?: string;
2389
+ }, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2390
+ update(id: string, data: UpdateFlagRequest, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2391
+ archive(id: string, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2392
+ activate(id: string, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2393
+ deactivate(id: string, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2394
+ listRules(id: string, options?: RequestOptions): Promise<ApiResponse<TargetingRule[]>>;
2395
+ createRule(id: string, data: CreateRuleRequest, options?: RequestOptions): Promise<ApiResponse<TargetingRule>>;
2396
+ updateRule(id: string, data: UpdateRuleRequest, options?: RequestOptions): Promise<ApiResponse<TargetingRule>>;
2397
+ deleteRule(id: string, options?: RequestOptions): Promise<ApiResponse<{
2398
+ deleted: boolean;
2399
+ }>>;
2400
+ listVariants(id: string, options?: RequestOptions): Promise<ApiResponse<FlagVariant[]>>;
2401
+ createVariant(id: string, data: CreateVariantRequest, options?: RequestOptions): Promise<ApiResponse<FlagVariant>>;
2402
+ updateVariant(id: string, data: UpdateVariantRequest, options?: RequestOptions): Promise<ApiResponse<FlagVariant>>;
2403
+ deleteVariant(id: string, options?: RequestOptions): Promise<ApiResponse<{
2404
+ deleted: boolean;
2405
+ }>>;
2406
+ listSegments(params?: {
2407
+ applicationId?: string;
2408
+ }, options?: RequestOptions): Promise<ApiResponse<FlagSegment[]>>;
2409
+ createSegment(data: CreateSegmentRequest, params?: {
2410
+ applicationId?: string;
2411
+ }, options?: RequestOptions): Promise<ApiResponse<FlagSegment>>;
2412
+ updateSegment(id: string, data: UpdateSegmentRequest, options?: RequestOptions): Promise<ApiResponse<FlagSegment>>;
2413
+ deleteSegment(id: string, options?: RequestOptions): Promise<ApiResponse<{
2414
+ deleted: boolean;
2415
+ }>>;
2416
+ listEnvironments(id: string, options?: RequestOptions): Promise<ApiResponse<FlagEnvironment[]>>;
2417
+ upsertEnvironment(id: string, environment: string, data: UpsertEnvironmentRequest, options?: RequestOptions): Promise<ApiResponse<FlagEnvironment>>;
2418
+ listAudit(id: string, limit?: number, options?: RequestOptions): Promise<ApiResponse<FlagAuditEntry[]>>;
2419
+ }
2420
+
2234
2421
  /**
2235
2422
  * Communication Service Module
2236
2423
  *
@@ -4902,6 +5089,7 @@ declare class ScaleMule {
4902
5089
  readonly social: SocialService;
4903
5090
  readonly billing: BillingService;
4904
5091
  readonly analytics: AnalyticsService;
5092
+ readonly flags: FlagsService;
4905
5093
  readonly communication: CommunicationService;
4906
5094
  readonly scheduler: SchedulerService;
4907
5095
  readonly permissions: PermissionsService;
@@ -4964,4 +5152,4 @@ declare class ScaleMule {
4964
5152
  getClient(): ScaleMuleClient;
4965
5153
  }
4966
5154
 
4967
- export { type AccountBalance, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateSessionResponse, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagCheck, FlagContentService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushToken, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RequestOptions, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type Severity, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type SubmitResult, type Subscription, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UploadCompleteResponse, type UploadEngineConfig, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type Webhook, WebhooksService, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, validateIP };
5155
+ export { type AccountBalance, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushToken, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RequestOptions, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type Severity, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type Webhook, WebhooksService, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, validateIP };
package/dist/index.d.ts CHANGED
@@ -2231,6 +2231,193 @@ declare class AnalyticsService extends ServiceModule {
2231
2231
  query(filters?: Record<string, unknown>): Promise<ApiResponse<AnalyticsEvent[]>>;
2232
2232
  }
2233
2233
 
2234
+ interface FlagDefinition {
2235
+ id: string;
2236
+ application_id: string;
2237
+ flag_key: string;
2238
+ name: string;
2239
+ description?: string | null;
2240
+ flag_type: 'boolean' | 'string' | 'number' | 'json';
2241
+ default_value: unknown;
2242
+ status: 'active' | 'inactive' | 'archived';
2243
+ tags: string[];
2244
+ created_by?: string | null;
2245
+ created_at: string;
2246
+ updated_at: string;
2247
+ }
2248
+ interface FlagEnvironment {
2249
+ id: string;
2250
+ application_id: string;
2251
+ flag_id: string;
2252
+ environment: string;
2253
+ enabled: boolean;
2254
+ default_value?: unknown;
2255
+ }
2256
+ interface FlagCondition {
2257
+ attribute: string;
2258
+ operator: 'eq' | 'neq' | 'in' | 'not_in' | 'contains' | 'starts_with' | 'ends_with' | 'gt' | 'gte' | 'lt' | 'lte' | 'regex' | 'semver_eq' | 'semver_neq' | 'semver_gt' | 'semver_gte' | 'semver_lt' | 'semver_lte' | 'exists' | 'not_exists' | string;
2259
+ value?: unknown;
2260
+ values?: unknown[];
2261
+ }
2262
+ interface TargetingRule {
2263
+ id: string;
2264
+ application_id: string;
2265
+ flag_id: string;
2266
+ environment: string;
2267
+ name: string;
2268
+ priority: number;
2269
+ serve_value: unknown;
2270
+ rollout_percentage?: number | null;
2271
+ conditions: FlagCondition[];
2272
+ enabled: boolean;
2273
+ created_at: string;
2274
+ updated_at: string;
2275
+ }
2276
+ interface FlagVariant {
2277
+ id: string;
2278
+ application_id: string;
2279
+ flag_id: string;
2280
+ variant_key: string;
2281
+ value: unknown;
2282
+ weight: number;
2283
+ created_at: string;
2284
+ updated_at: string;
2285
+ }
2286
+ interface FlagSegment {
2287
+ id: string;
2288
+ application_id: string;
2289
+ segment_key: string;
2290
+ name: string;
2291
+ description?: string | null;
2292
+ conditions: FlagCondition[];
2293
+ included_users: string[];
2294
+ excluded_users: string[];
2295
+ created_at: string;
2296
+ updated_at: string;
2297
+ }
2298
+ interface FlagAuditEntry {
2299
+ id: string;
2300
+ application_id: string;
2301
+ flag_id?: string | null;
2302
+ actor_type: string;
2303
+ actor_id: string;
2304
+ actor_email?: string | null;
2305
+ action: string;
2306
+ before_value?: unknown;
2307
+ after_value?: unknown;
2308
+ metadata?: unknown;
2309
+ created_at: string;
2310
+ }
2311
+ interface FlagDetail {
2312
+ flag: FlagDefinition;
2313
+ environments: FlagEnvironment[];
2314
+ rules: TargetingRule[];
2315
+ variants: FlagVariant[];
2316
+ }
2317
+ interface FlagEvaluation<T = unknown> {
2318
+ flag_id: string;
2319
+ flag_key: string;
2320
+ environment: string;
2321
+ value: T;
2322
+ reason: 'disabled' | 'rule_match' | 'variant' | 'default' | string;
2323
+ matched_rule_id?: string | null;
2324
+ variant_key?: string | null;
2325
+ bucket?: number | null;
2326
+ }
2327
+ interface CreateFlagRequest {
2328
+ flag_key: string;
2329
+ name: string;
2330
+ description?: string;
2331
+ flag_type?: 'boolean' | 'string' | 'number' | 'json';
2332
+ default_value?: unknown;
2333
+ tags?: string[];
2334
+ }
2335
+ interface UpdateFlagRequest {
2336
+ flag_key?: string;
2337
+ name?: string;
2338
+ description?: string | null;
2339
+ flag_type?: 'boolean' | 'string' | 'number' | 'json';
2340
+ default_value?: unknown;
2341
+ tags?: string[];
2342
+ status?: 'active' | 'inactive' | 'archived';
2343
+ }
2344
+ interface CreateRuleRequest {
2345
+ environment: string;
2346
+ name: string;
2347
+ priority?: number;
2348
+ serve_value: unknown;
2349
+ rollout_percentage?: number | null;
2350
+ conditions?: FlagCondition[];
2351
+ enabled?: boolean;
2352
+ }
2353
+ interface UpdateRuleRequest extends Partial<CreateRuleRequest> {
2354
+ }
2355
+ interface CreateVariantRequest {
2356
+ variant_key: string;
2357
+ value: unknown;
2358
+ weight: number;
2359
+ }
2360
+ interface UpdateVariantRequest extends Partial<CreateVariantRequest> {
2361
+ }
2362
+ interface CreateSegmentRequest {
2363
+ segment_key: string;
2364
+ name: string;
2365
+ description?: string;
2366
+ conditions?: FlagCondition[];
2367
+ included_users?: string[];
2368
+ excluded_users?: string[];
2369
+ }
2370
+ interface UpdateSegmentRequest extends Partial<CreateSegmentRequest> {
2371
+ }
2372
+ interface UpsertEnvironmentRequest {
2373
+ enabled: boolean;
2374
+ default_value?: unknown;
2375
+ }
2376
+ declare class FlagsService extends ServiceModule {
2377
+ protected basePath: string;
2378
+ evaluate<T = unknown>(flagKey: string, context?: Record<string, unknown>, environment?: string, options?: RequestOptions): Promise<ApiResponse<FlagEvaluation<T>>>;
2379
+ evaluateBatch(flagKeys: string[], context?: Record<string, unknown>, environment?: string, options?: RequestOptions): Promise<ApiResponse<Record<string, FlagEvaluation>>>;
2380
+ evaluateAll(context?: Record<string, unknown>, environment?: string, options?: RequestOptions): Promise<ApiResponse<Record<string, FlagEvaluation>>>;
2381
+ list(params?: {
2382
+ applicationId?: string;
2383
+ status?: string;
2384
+ search?: string;
2385
+ }, options?: RequestOptions): Promise<ApiResponse<FlagDefinition[]>>;
2386
+ get(id: string, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2387
+ create(data: CreateFlagRequest, params?: {
2388
+ applicationId?: string;
2389
+ }, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2390
+ update(id: string, data: UpdateFlagRequest, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2391
+ archive(id: string, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2392
+ activate(id: string, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2393
+ deactivate(id: string, options?: RequestOptions): Promise<ApiResponse<FlagDetail>>;
2394
+ listRules(id: string, options?: RequestOptions): Promise<ApiResponse<TargetingRule[]>>;
2395
+ createRule(id: string, data: CreateRuleRequest, options?: RequestOptions): Promise<ApiResponse<TargetingRule>>;
2396
+ updateRule(id: string, data: UpdateRuleRequest, options?: RequestOptions): Promise<ApiResponse<TargetingRule>>;
2397
+ deleteRule(id: string, options?: RequestOptions): Promise<ApiResponse<{
2398
+ deleted: boolean;
2399
+ }>>;
2400
+ listVariants(id: string, options?: RequestOptions): Promise<ApiResponse<FlagVariant[]>>;
2401
+ createVariant(id: string, data: CreateVariantRequest, options?: RequestOptions): Promise<ApiResponse<FlagVariant>>;
2402
+ updateVariant(id: string, data: UpdateVariantRequest, options?: RequestOptions): Promise<ApiResponse<FlagVariant>>;
2403
+ deleteVariant(id: string, options?: RequestOptions): Promise<ApiResponse<{
2404
+ deleted: boolean;
2405
+ }>>;
2406
+ listSegments(params?: {
2407
+ applicationId?: string;
2408
+ }, options?: RequestOptions): Promise<ApiResponse<FlagSegment[]>>;
2409
+ createSegment(data: CreateSegmentRequest, params?: {
2410
+ applicationId?: string;
2411
+ }, options?: RequestOptions): Promise<ApiResponse<FlagSegment>>;
2412
+ updateSegment(id: string, data: UpdateSegmentRequest, options?: RequestOptions): Promise<ApiResponse<FlagSegment>>;
2413
+ deleteSegment(id: string, options?: RequestOptions): Promise<ApiResponse<{
2414
+ deleted: boolean;
2415
+ }>>;
2416
+ listEnvironments(id: string, options?: RequestOptions): Promise<ApiResponse<FlagEnvironment[]>>;
2417
+ upsertEnvironment(id: string, environment: string, data: UpsertEnvironmentRequest, options?: RequestOptions): Promise<ApiResponse<FlagEnvironment>>;
2418
+ listAudit(id: string, limit?: number, options?: RequestOptions): Promise<ApiResponse<FlagAuditEntry[]>>;
2419
+ }
2420
+
2234
2421
  /**
2235
2422
  * Communication Service Module
2236
2423
  *
@@ -4902,6 +5089,7 @@ declare class ScaleMule {
4902
5089
  readonly social: SocialService;
4903
5090
  readonly billing: BillingService;
4904
5091
  readonly analytics: AnalyticsService;
5092
+ readonly flags: FlagsService;
4905
5093
  readonly communication: CommunicationService;
4906
5094
  readonly scheduler: SchedulerService;
4907
5095
  readonly permissions: PermissionsService;
@@ -4964,4 +5152,4 @@ declare class ScaleMule {
4964
5152
  getClient(): ScaleMuleClient;
4965
5153
  }
4966
5154
 
4967
- export { type AccountBalance, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateSessionResponse, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagCheck, FlagContentService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushToken, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RequestOptions, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type Severity, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type SubmitResult, type Subscription, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UploadCompleteResponse, type UploadEngineConfig, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type Webhook, WebhooksService, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, validateIP };
5155
+ export { type AccountBalance, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushToken, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RequestOptions, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type Severity, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type Webhook, WebhooksService, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, validateIP };
package/dist/index.js CHANGED
@@ -312,6 +312,7 @@ __export(index_exports, {
312
312
  ErrorCodes: () => ErrorCodes,
313
313
  EventsService: () => EventsService,
314
314
  FlagContentService: () => FlagContentService,
315
+ FlagsService: () => FlagsService,
315
316
  FunctionsService: () => FunctionsService,
316
317
  GraphService: () => GraphService,
317
318
  IdentityService: () => IdentityService,
@@ -3731,6 +3732,105 @@ var AnalyticsService = class extends ServiceModule {
3731
3732
  }
3732
3733
  };
3733
3734
 
3735
+ // src/services/flags.ts
3736
+ var FlagsService = class extends ServiceModule {
3737
+ constructor() {
3738
+ super(...arguments);
3739
+ this.basePath = "/v1/flags";
3740
+ }
3741
+ async evaluate(flagKey, context = {}, environment = "prod", options) {
3742
+ return this.post("/evaluate", { flag_key: flagKey, environment, context }, options);
3743
+ }
3744
+ async evaluateBatch(flagKeys, context = {}, environment = "prod", options) {
3745
+ return this.post(
3746
+ "/evaluate/batch",
3747
+ { flag_keys: flagKeys, environment, context },
3748
+ options
3749
+ );
3750
+ }
3751
+ async evaluateAll(context = {}, environment = "prod", options) {
3752
+ return this.post("/evaluate/all", { environment, context }, options);
3753
+ }
3754
+ async list(params, options) {
3755
+ return this._get(
3756
+ this.withQuery("", {
3757
+ application_id: params?.applicationId,
3758
+ status: params?.status,
3759
+ search: params?.search
3760
+ }),
3761
+ options
3762
+ );
3763
+ }
3764
+ async get(id, options) {
3765
+ return this._get(`/${id}`, options);
3766
+ }
3767
+ async create(data, params, options) {
3768
+ const path = this.withQuery("", { application_id: params?.applicationId });
3769
+ return this.post(path, data, options);
3770
+ }
3771
+ async update(id, data, options) {
3772
+ return this.patch(`/${id}`, data, options);
3773
+ }
3774
+ async archive(id, options) {
3775
+ return this.del(`/${id}`, options);
3776
+ }
3777
+ async activate(id, options) {
3778
+ return this.post(`/${id}/activate`, void 0, options);
3779
+ }
3780
+ async deactivate(id, options) {
3781
+ return this.post(`/${id}/deactivate`, void 0, options);
3782
+ }
3783
+ async listRules(id, options) {
3784
+ return this._get(`/${id}/rules`, options);
3785
+ }
3786
+ async createRule(id, data, options) {
3787
+ return this.post(`/${id}/rules`, data, options);
3788
+ }
3789
+ async updateRule(id, data, options) {
3790
+ return this.patch(`/rules/${id}`, data, options);
3791
+ }
3792
+ async deleteRule(id, options) {
3793
+ return this.del(`/rules/${id}`, options);
3794
+ }
3795
+ async listVariants(id, options) {
3796
+ return this._get(`/${id}/variants`, options);
3797
+ }
3798
+ async createVariant(id, data, options) {
3799
+ return this.post(`/${id}/variants`, data, options);
3800
+ }
3801
+ async updateVariant(id, data, options) {
3802
+ return this.patch(`/variants/${id}`, data, options);
3803
+ }
3804
+ async deleteVariant(id, options) {
3805
+ return this.del(`/variants/${id}`, options);
3806
+ }
3807
+ async listSegments(params, options) {
3808
+ return this._get(this.withQuery("/segments", { application_id: params?.applicationId }), options);
3809
+ }
3810
+ async createSegment(data, params, options) {
3811
+ return this.post(
3812
+ this.withQuery("/segments", { application_id: params?.applicationId }),
3813
+ data,
3814
+ options
3815
+ );
3816
+ }
3817
+ async updateSegment(id, data, options) {
3818
+ return this.patch(`/segments/${id}`, data, options);
3819
+ }
3820
+ async deleteSegment(id, options) {
3821
+ return this.del(`/segments/${id}`, options);
3822
+ }
3823
+ async listEnvironments(id, options) {
3824
+ return this._get(`/${id}/environments`, options);
3825
+ }
3826
+ async upsertEnvironment(id, environment, data, options) {
3827
+ return this.put(`/${id}/environments/${encodeURIComponent(environment)}`, data, options);
3828
+ }
3829
+ async listAudit(id, limit, options) {
3830
+ return this._get(this.withQuery(`/${id}/audit`, { limit }), options);
3831
+ }
3832
+ };
3833
+
3734
3834
  // src/services/communication.ts
3735
3835
  var CommunicationService = class extends ServiceModule {
3736
3836
  constructor() {
@@ -5190,6 +5290,7 @@ var ScaleMule = class {
5190
5290
  this.social = new SocialService(this._client);
5191
5291
  this.billing = new BillingService(this._client);
5192
5292
  this.analytics = new AnalyticsService(this._client);
5293
+ this.flags = new FlagsService(this._client);
5193
5294
  this.communication = new CommunicationService(this._client);
5194
5295
  this.scheduler = new SchedulerService(this._client);
5195
5296
  this.permissions = new PermissionsService(this._client);
@@ -5295,6 +5396,7 @@ var index_default = ScaleMule;
5295
5396
  ErrorCodes,
5296
5397
  EventsService,
5297
5398
  FlagContentService,
5399
+ FlagsService,
5298
5400
  FunctionsService,
5299
5401
  GraphService,
5300
5402
  IdentityService,
package/dist/index.mjs CHANGED
@@ -3378,6 +3378,105 @@ var AnalyticsService = class extends ServiceModule {
3378
3378
  }
3379
3379
  };
3380
3380
 
3381
+ // src/services/flags.ts
3382
+ var FlagsService = class extends ServiceModule {
3383
+ constructor() {
3384
+ super(...arguments);
3385
+ this.basePath = "/v1/flags";
3386
+ }
3387
+ async evaluate(flagKey, context = {}, environment = "prod", options) {
3388
+ return this.post("/evaluate", { flag_key: flagKey, environment, context }, options);
3389
+ }
3390
+ async evaluateBatch(flagKeys, context = {}, environment = "prod", options) {
3391
+ return this.post(
3392
+ "/evaluate/batch",
3393
+ { flag_keys: flagKeys, environment, context },
3394
+ options
3395
+ );
3396
+ }
3397
+ async evaluateAll(context = {}, environment = "prod", options) {
3398
+ return this.post("/evaluate/all", { environment, context }, options);
3399
+ }
3400
+ async list(params, options) {
3401
+ return this._get(
3402
+ this.withQuery("", {
3403
+ application_id: params?.applicationId,
3404
+ status: params?.status,
3405
+ search: params?.search
3406
+ }),
3407
+ options
3408
+ );
3409
+ }
3410
+ async get(id, options) {
3411
+ return this._get(`/${id}`, options);
3412
+ }
3413
+ async create(data, params, options) {
3414
+ const path = this.withQuery("", { application_id: params?.applicationId });
3415
+ return this.post(path, data, options);
3416
+ }
3417
+ async update(id, data, options) {
3418
+ return this.patch(`/${id}`, data, options);
3419
+ }
3420
+ async archive(id, options) {
3421
+ return this.del(`/${id}`, options);
3422
+ }
3423
+ async activate(id, options) {
3424
+ return this.post(`/${id}/activate`, void 0, options);
3425
+ }
3426
+ async deactivate(id, options) {
3427
+ return this.post(`/${id}/deactivate`, void 0, options);
3428
+ }
3429
+ async listRules(id, options) {
3430
+ return this._get(`/${id}/rules`, options);
3431
+ }
3432
+ async createRule(id, data, options) {
3433
+ return this.post(`/${id}/rules`, data, options);
3434
+ }
3435
+ async updateRule(id, data, options) {
3436
+ return this.patch(`/rules/${id}`, data, options);
3437
+ }
3438
+ async deleteRule(id, options) {
3439
+ return this.del(`/rules/${id}`, options);
3440
+ }
3441
+ async listVariants(id, options) {
3442
+ return this._get(`/${id}/variants`, options);
3443
+ }
3444
+ async createVariant(id, data, options) {
3445
+ return this.post(`/${id}/variants`, data, options);
3446
+ }
3447
+ async updateVariant(id, data, options) {
3448
+ return this.patch(`/variants/${id}`, data, options);
3449
+ }
3450
+ async deleteVariant(id, options) {
3451
+ return this.del(`/variants/${id}`, options);
3452
+ }
3453
+ async listSegments(params, options) {
3454
+ return this._get(this.withQuery("/segments", { application_id: params?.applicationId }), options);
3455
+ }
3456
+ async createSegment(data, params, options) {
3457
+ return this.post(
3458
+ this.withQuery("/segments", { application_id: params?.applicationId }),
3459
+ data,
3460
+ options
3461
+ );
3462
+ }
3463
+ async updateSegment(id, data, options) {
3464
+ return this.patch(`/segments/${id}`, data, options);
3465
+ }
3466
+ async deleteSegment(id, options) {
3467
+ return this.del(`/segments/${id}`, options);
3468
+ }
3469
+ async listEnvironments(id, options) {
3470
+ return this._get(`/${id}/environments`, options);
3471
+ }
3472
+ async upsertEnvironment(id, environment, data, options) {
3473
+ return this.put(`/${id}/environments/${encodeURIComponent(environment)}`, data, options);
3474
+ }
3475
+ async listAudit(id, limit, options) {
3476
+ return this._get(this.withQuery(`/${id}/audit`, { limit }), options);
3477
+ }
3478
+ };
3479
+
3381
3480
  // src/services/communication.ts
3382
3481
  var CommunicationService = class extends ServiceModule {
3383
3482
  constructor() {
@@ -4837,6 +4936,7 @@ var ScaleMule = class {
4837
4936
  this.social = new SocialService(this._client);
4838
4937
  this.billing = new BillingService(this._client);
4839
4938
  this.analytics = new AnalyticsService(this._client);
4939
+ this.flags = new FlagsService(this._client);
4840
4940
  this.communication = new CommunicationService(this._client);
4841
4941
  this.scheduler = new SchedulerService(this._client);
4842
4942
  this.permissions = new PermissionsService(this._client);
@@ -4941,6 +5041,7 @@ export {
4941
5041
  ErrorCodes,
4942
5042
  EventsService,
4943
5043
  FlagContentService,
5044
+ FlagsService,
4944
5045
  FunctionsService,
4945
5046
  GraphService,
4946
5047
  IdentityService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/sdk",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Official TypeScript/JavaScript SDK for ScaleMule Backend-as-a-Service",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",