Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

FirebaseRules

import { FirebaseRules } from "https://googleapis.deno.dev/v1/firebaserules:v1.ts";

Creates and manages rules that determine when a Firebase Rules-enabled service should permit a request.

class FirebaseRules {
constructor(client?: CredentialsClient, baseUrl?: string);
async projectsReleasesCreate(name: string, req: Release): Promise<Release>;
async projectsReleasesDelete(name: string): Promise<Empty>;
async projectsReleasesGet(name: string): Promise<Release>;
async projectsReleasesGetExecutable(name: string, opts?: ProjectsReleasesGetExecutableOptions): Promise<GetReleaseExecutableResponse>;
async projectsReleasesList(name: string, opts?: ProjectsReleasesListOptions): Promise<ListReleasesResponse>;
async projectsReleasesPatch(name: string, req: UpdateReleaseRequest): Promise<Release>;
async projectsRulesetsCreate(name: string, req: Ruleset): Promise<Ruleset>;
async projectsRulesetsDelete(name: string): Promise<Empty>;
async projectsRulesetsGet(name: string): Promise<Ruleset>;
async projectsRulesetsList(name: string, opts?: ProjectsRulesetsListOptions): Promise<ListRulesetsResponse>;
async projectsTest(name: string, req: TestRulesetRequest): Promise<TestRulesetResponse>;
}

§Constructors

§
new FirebaseRules(client?: CredentialsClient, baseUrl?: string)
[src]

§Methods

§
projectsReleasesCreate(name: string, req: Release): Promise<Release>
[src]

Create a Release. Release names should reflect the developer's deployment practices. For example, the release name may include the environment name, application name, application version, or any other name meaningful to the developer. Once a Release refers to a Ruleset, the rules can be enforced by Firebase Rules-enabled services. More than one Release may be 'live' concurrently. Consider the following three Release names for projects/foo and the Ruleset to which they refer. Release Name -> Ruleset Name * projects/foo/releases/prod -> projects/foo/rulesets/uuid123 * projects/foo/releases/prod/beta -> projects/foo/rulesets/uuid123 * projects/foo/releases/prod/v23 -> projects/foo/rulesets/uuid456 The relationships reflect a Ruleset rollout in progress. The prod and prod/beta releases refer to the same Ruleset. However, prod/v23 refers to a new Ruleset. The Ruleset reference for a Release may be updated using the UpdateRelease method.

@param name

Required. Resource name for the project which owns this Release. Format: projects/{project_id}

§
projectsReleasesDelete(name: string): Promise<Empty>
[src]

Delete a Release by resource name.

@param name

Required. Resource name for the Release to delete. Format: projects/{project_id}/releases/{release_id}

§
projectsReleasesGet(name: string): Promise<Release>
[src]

Get a Release by name.

@param name

Required. Resource name of the Release. Format: projects/{project_id}/releases/{release_id}

§
projectsReleasesGetExecutable(name: string, opts?: ProjectsReleasesGetExecutableOptions): Promise<GetReleaseExecutableResponse>
[src]

Get the Release executable to use when enforcing rules.

@param name

Required. Resource name of the Release. Format: projects/{project_id}/releases/{release_id}

§
projectsReleasesList(name: string, opts?: ProjectsReleasesListOptions): Promise<ListReleasesResponse>
[src]

List the Release values for a project. This list may optionally be filtered by Release name, Ruleset name, TestSuite name, or any combination thereof.

@param name

Required. Resource name for the project. Format: projects/{project_id}

§
projectsReleasesPatch(name: string, req: UpdateReleaseRequest): Promise<Release>
[src]

Update a Release via PATCH. Only updates to ruleset_name will be honored. Release rename is not supported. To create a Release use the CreateRelease method.

@param name

Required. Resource name for the project which owns this Release. Format: projects/{project_id}

§
projectsRulesetsCreate(name: string, req: Ruleset): Promise<Ruleset>
[src]

Create a Ruleset from Source. The Ruleset is given a unique generated name which is returned to the caller. Source containing syntactic or semantics errors will result in an error response indicating the first error encountered. For a detailed view of Source issues, use TestRuleset.

@param name

Required. Resource name for Project which owns this Ruleset. Format: projects/{project_id}

§
projectsRulesetsDelete(name: string): Promise<Empty>
[src]

Delete a Ruleset by resource name. If the Ruleset is referenced by a Release the operation will fail.

@param name

Required. Resource name for the ruleset to delete. Format: projects/{project_id}/rulesets/{ruleset_id}

§
projectsRulesetsGet(name: string): Promise<Ruleset>
[src]

Get a Ruleset by name including the full Source contents.

@param name

Required. Resource name for the ruleset to get. Format: projects/{project_id}/rulesets/{ruleset_id}

§
projectsRulesetsList(name: string, opts?: ProjectsRulesetsListOptions): Promise<ListRulesetsResponse>
[src]

List Ruleset metadata only and optionally filter the results by Ruleset name. The full Source contents of a Ruleset may be retrieved with GetRuleset.

@param name

Required. Resource name for the project. Format: projects/{project_id}

§
projectsTest(name: string, req: TestRulesetRequest): Promise<TestRulesetResponse>
[src]

Test Source for syntactic and semantic correctness. Issues present, if any, will be returned to the caller with a description, severity, and source location. The test method may be executed with Source or a Ruleset name. Passing Source is useful for unit testing new rules. Passing a Ruleset name is useful for regression testing an existing rule. The following is an example of Source that permits users to upload images to a bucket bearing their user id and matching the correct metadata: Example // Users are allowed to subscribe and unsubscribe to the blog. service firebase.storage { match /users/{userId}/images/{imageName} { allow write: if userId == request.auth.uid && (imageName.matches('.png$') || imageName.matches('.jpg$')) && resource.mimeType.matches('^image/') } }

@param name

Required. Tests may either provide source or a Ruleset resource name. For tests against source, the resource name must refer to the project: Format: projects/{project_id} For tests against a Ruleset, this must be the Ruleset resource name: Format: projects/{project_id}/rulesets/{ruleset_id}