@scalemule/sdk 0.0.10 → 0.0.12

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,
@@ -3665,10 +3666,11 @@ var AnalyticsService = class extends ServiceModule {
3665
3666
  // Event Tracking (v2 — JetStream buffered)
3666
3667
  // --------------------------------------------------------------------------
3667
3668
  async track(event, properties, userId, options) {
3668
- return this.post("/v2/events", { event, properties, user_id: userId }, options);
3669
+ return this.post("/v2/events", { event_name: event, properties, user_id: userId }, options);
3669
3670
  }
3670
3671
  async trackBatch(events, options) {
3671
- return this.post("/v2/events/batch", { events }, options);
3672
+ const mapped = events.map(({ event, ...rest }) => ({ event_name: event, ...rest }));
3673
+ return this.post("/v2/events/batch", { events: mapped }, options);
3672
3674
  }
3673
3675
  async trackPageView(data, options) {
3674
3676
  return this.post("/page-view", data, options);
@@ -3731,6 +3733,105 @@ var AnalyticsService = class extends ServiceModule {
3731
3733
  }
3732
3734
  };
3733
3735
 
3736
+ // src/services/flags.ts
3737
+ var FlagsService = class extends ServiceModule {
3738
+ constructor() {
3739
+ super(...arguments);
3740
+ this.basePath = "/v1/flags";
3741
+ }
3742
+ async evaluate(flagKey, context = {}, environment = "prod", options) {
3743
+ return this.post("/evaluate", { flag_key: flagKey, environment, context }, options);
3744
+ }
3745
+ async evaluateBatch(flagKeys, context = {}, environment = "prod", options) {
3746
+ return this.post(
3747
+ "/evaluate/batch",
3748
+ { flag_keys: flagKeys, environment, context },
3749
+ options
3750
+ );
3751
+ }
3752
+ async evaluateAll(context = {}, environment = "prod", options) {
3753
+ return this.post("/evaluate/all", { environment, context }, options);
3754
+ }
3755
+ async list(params, options) {
3756
+ return this._get(
3757
+ this.withQuery("", {
3758
+ application_id: params?.applicationId,
3759
+ status: params?.status,
3760
+ search: params?.search
3761
+ }),
3762
+ options
3763
+ );
3764
+ }
3765
+ async get(id, options) {
3766
+ return this._get(`/${id}`, options);
3767
+ }
3768
+ async create(data, params, options) {
3769
+ const path = this.withQuery("", { application_id: params?.applicationId });
3770
+ return this.post(path, data, options);
3771
+ }
3772
+ async update(id, data, options) {
3773
+ return this.patch(`/${id}`, data, options);
3774
+ }
3775
+ async archive(id, options) {
3776
+ return this.del(`/${id}`, options);
3777
+ }
3778
+ async activate(id, options) {
3779
+ return this.post(`/${id}/activate`, void 0, options);
3780
+ }
3781
+ async deactivate(id, options) {
3782
+ return this.post(`/${id}/deactivate`, void 0, options);
3783
+ }
3784
+ async listRules(id, options) {
3785
+ return this._get(`/${id}/rules`, options);
3786
+ }
3787
+ async createRule(id, data, options) {
3788
+ return this.post(`/${id}/rules`, data, options);
3789
+ }
3790
+ async updateRule(id, data, options) {
3791
+ return this.patch(`/rules/${id}`, data, options);
3792
+ }
3793
+ async deleteRule(id, options) {
3794
+ return this.del(`/rules/${id}`, options);
3795
+ }
3796
+ async listVariants(id, options) {
3797
+ return this._get(`/${id}/variants`, options);
3798
+ }
3799
+ async createVariant(id, data, options) {
3800
+ return this.post(`/${id}/variants`, data, options);
3801
+ }
3802
+ async updateVariant(id, data, options) {
3803
+ return this.patch(`/variants/${id}`, data, options);
3804
+ }
3805
+ async deleteVariant(id, options) {
3806
+ return this.del(`/variants/${id}`, options);
3807
+ }
3808
+ async listSegments(params, options) {
3809
+ return this._get(this.withQuery("/segments", { application_id: params?.applicationId }), options);
3810
+ }
3811
+ async createSegment(data, params, options) {
3812
+ return this.post(
3813
+ this.withQuery("/segments", { application_id: params?.applicationId }),
3814
+ data,
3815
+ options
3816
+ );
3817
+ }
3818
+ async updateSegment(id, data, options) {
3819
+ return this.patch(`/segments/${id}`, data, options);
3820
+ }
3821
+ async deleteSegment(id, options) {
3822
+ return this.del(`/segments/${id}`, options);
3823
+ }
3824
+ async listEnvironments(id, options) {
3825
+ return this._get(`/${id}/environments`, options);
3826
+ }
3827
+ async upsertEnvironment(id, environment, data, options) {
3828
+ return this.put(`/${id}/environments/${encodeURIComponent(environment)}`, data, options);
3829
+ }
3830
+ async listAudit(id, limit, options) {
3831
+ return this._get(this.withQuery(`/${id}/audit`, { limit }), options);
3832
+ }
3833
+ };
3834
+
3734
3835
  // src/services/communication.ts
3735
3836
  var CommunicationService = class extends ServiceModule {
3736
3837
  constructor() {
@@ -5190,6 +5291,7 @@ var ScaleMule = class {
5190
5291
  this.social = new SocialService(this._client);
5191
5292
  this.billing = new BillingService(this._client);
5192
5293
  this.analytics = new AnalyticsService(this._client);
5294
+ this.flags = new FlagsService(this._client);
5193
5295
  this.communication = new CommunicationService(this._client);
5194
5296
  this.scheduler = new SchedulerService(this._client);
5195
5297
  this.permissions = new PermissionsService(this._client);
@@ -5295,6 +5397,7 @@ var index_default = ScaleMule;
5295
5397
  ErrorCodes,
5296
5398
  EventsService,
5297
5399
  FlagContentService,
5400
+ FlagsService,
5298
5401
  FunctionsService,
5299
5402
  GraphService,
5300
5403
  IdentityService,
package/dist/index.mjs CHANGED
@@ -3312,10 +3312,11 @@ var AnalyticsService = class extends ServiceModule {
3312
3312
  // Event Tracking (v2 — JetStream buffered)
3313
3313
  // --------------------------------------------------------------------------
3314
3314
  async track(event, properties, userId, options) {
3315
- return this.post("/v2/events", { event, properties, user_id: userId }, options);
3315
+ return this.post("/v2/events", { event_name: event, properties, user_id: userId }, options);
3316
3316
  }
3317
3317
  async trackBatch(events, options) {
3318
- return this.post("/v2/events/batch", { events }, options);
3318
+ const mapped = events.map(({ event, ...rest }) => ({ event_name: event, ...rest }));
3319
+ return this.post("/v2/events/batch", { events: mapped }, options);
3319
3320
  }
3320
3321
  async trackPageView(data, options) {
3321
3322
  return this.post("/page-view", data, options);
@@ -3378,6 +3379,105 @@ var AnalyticsService = class extends ServiceModule {
3378
3379
  }
3379
3380
  };
3380
3381
 
3382
+ // src/services/flags.ts
3383
+ var FlagsService = class extends ServiceModule {
3384
+ constructor() {
3385
+ super(...arguments);
3386
+ this.basePath = "/v1/flags";
3387
+ }
3388
+ async evaluate(flagKey, context = {}, environment = "prod", options) {
3389
+ return this.post("/evaluate", { flag_key: flagKey, environment, context }, options);
3390
+ }
3391
+ async evaluateBatch(flagKeys, context = {}, environment = "prod", options) {
3392
+ return this.post(
3393
+ "/evaluate/batch",
3394
+ { flag_keys: flagKeys, environment, context },
3395
+ options
3396
+ );
3397
+ }
3398
+ async evaluateAll(context = {}, environment = "prod", options) {
3399
+ return this.post("/evaluate/all", { environment, context }, options);
3400
+ }
3401
+ async list(params, options) {
3402
+ return this._get(
3403
+ this.withQuery("", {
3404
+ application_id: params?.applicationId,
3405
+ status: params?.status,
3406
+ search: params?.search
3407
+ }),
3408
+ options
3409
+ );
3410
+ }
3411
+ async get(id, options) {
3412
+ return this._get(`/${id}`, options);
3413
+ }
3414
+ async create(data, params, options) {
3415
+ const path = this.withQuery("", { application_id: params?.applicationId });
3416
+ return this.post(path, data, options);
3417
+ }
3418
+ async update(id, data, options) {
3419
+ return this.patch(`/${id}`, data, options);
3420
+ }
3421
+ async archive(id, options) {
3422
+ return this.del(`/${id}`, options);
3423
+ }
3424
+ async activate(id, options) {
3425
+ return this.post(`/${id}/activate`, void 0, options);
3426
+ }
3427
+ async deactivate(id, options) {
3428
+ return this.post(`/${id}/deactivate`, void 0, options);
3429
+ }
3430
+ async listRules(id, options) {
3431
+ return this._get(`/${id}/rules`, options);
3432
+ }
3433
+ async createRule(id, data, options) {
3434
+ return this.post(`/${id}/rules`, data, options);
3435
+ }
3436
+ async updateRule(id, data, options) {
3437
+ return this.patch(`/rules/${id}`, data, options);
3438
+ }
3439
+ async deleteRule(id, options) {
3440
+ return this.del(`/rules/${id}`, options);
3441
+ }
3442
+ async listVariants(id, options) {
3443
+ return this._get(`/${id}/variants`, options);
3444
+ }
3445
+ async createVariant(id, data, options) {
3446
+ return this.post(`/${id}/variants`, data, options);
3447
+ }
3448
+ async updateVariant(id, data, options) {
3449
+ return this.patch(`/variants/${id}`, data, options);
3450
+ }
3451
+ async deleteVariant(id, options) {
3452
+ return this.del(`/variants/${id}`, options);
3453
+ }
3454
+ async listSegments(params, options) {
3455
+ return this._get(this.withQuery("/segments", { application_id: params?.applicationId }), options);
3456
+ }
3457
+ async createSegment(data, params, options) {
3458
+ return this.post(
3459
+ this.withQuery("/segments", { application_id: params?.applicationId }),
3460
+ data,
3461
+ options
3462
+ );
3463
+ }
3464
+ async updateSegment(id, data, options) {
3465
+ return this.patch(`/segments/${id}`, data, options);
3466
+ }
3467
+ async deleteSegment(id, options) {
3468
+ return this.del(`/segments/${id}`, options);
3469
+ }
3470
+ async listEnvironments(id, options) {
3471
+ return this._get(`/${id}/environments`, options);
3472
+ }
3473
+ async upsertEnvironment(id, environment, data, options) {
3474
+ return this.put(`/${id}/environments/${encodeURIComponent(environment)}`, data, options);
3475
+ }
3476
+ async listAudit(id, limit, options) {
3477
+ return this._get(this.withQuery(`/${id}/audit`, { limit }), options);
3478
+ }
3479
+ };
3480
+
3381
3481
  // src/services/communication.ts
3382
3482
  var CommunicationService = class extends ServiceModule {
3383
3483
  constructor() {
@@ -4837,6 +4937,7 @@ var ScaleMule = class {
4837
4937
  this.social = new SocialService(this._client);
4838
4938
  this.billing = new BillingService(this._client);
4839
4939
  this.analytics = new AnalyticsService(this._client);
4940
+ this.flags = new FlagsService(this._client);
4840
4941
  this.communication = new CommunicationService(this._client);
4841
4942
  this.scheduler = new SchedulerService(this._client);
4842
4943
  this.permissions = new PermissionsService(this._client);
@@ -4941,6 +5042,7 @@ export {
4941
5042
  ErrorCodes,
4942
5043
  EventsService,
4943
5044
  FlagContentService,
5045
+ FlagsService,
4944
5046
  FunctionsService,
4945
5047
  GraphService,
4946
5048
  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.12",
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",