@farmart-tech/brave-admin-sdk
    Preparing search index...

    Class WindowWriter

    Client for managing maintenance window configurations and media uploads.

    Provides full write access to the Brave Ship maintenance window system, including creating, updating, and deleting downtime schedules.

    const writer = new WindowWriter({
    api: 'https://api.farmart.com/api/v1',
    getIdToken: async () => await user.getIdToken(),
    workspace: 'production'
    });

    await writer.registerFeatureConfig('my_app', {
    plannedReleases: [{
    downtimeStartAt: '2024-01-01T10:00:00Z',
    downtimeEndAt: '2024-01-01T12:00:00Z',
    scopes: ['web']
    }]
    });
    Index

    Constructors

    Methods

    • Deletes a maintenance window configuration.

      Parameters

      • featureName: string

        Name of the feature to delete

      Returns Promise<void>

    • Registers a new maintenance window configuration.

      Parameters

      • featureName: string

        Name of the feature or application (must be snake_case)

      • featureConfig: FeatureRemoteConfig

        Initial maintenance configuration

      Returns Promise<void>

      await writer.registerFeatureConfig('payment_service', {
      plannedReleases: [...]
      });
    • Uploads a file (e.g., image for maintenance page) to the media storage.

      Parameters

      • file: File

        File object to upload

      • folder: string

        Target folder in storage

      • onUploadProgress: ((progressEvent: AxiosProgressEvent) => void) | undefined

        Optional callback for tracking upload progress

      Returns Promise<string>

      The public download URL of the uploaded file

      const imageUrl = await writer.uploadImage(file, 'maintenance-banners');