Skip to content

gi-nx


gi-nx / bulkCreateProjects

ts
const bulkCreateProjects: (this: RpcCallContext, projects: {
  feature: Feature<
     | Point
     | Polygon
    | MultiPolygon>;
  overrides?: {
     blocks?: {
        description?: string;
        features: (
           | PreStackedPoint
           | PreStackedLineString
          | PreStackedPolygon<Record<string, any>>)[];
        id: string;
        keyWords?: string[];
        name: string;
        properties?: Record<string, any>;
     }[];
     flows?: {
        defaults?: Record<string, any>;
        dependencies: GiraffeNodeGraphFeatureDependancy[];
        description?: string;
        edges: GiraffeEdge[];
        id: string;
        inputs: Record<string, GiraffeNodeInputHandle>;
        name: string;
        nodes: GiraffeNode[];
        outputs: Record<string, GiraffeNodeInputHandle>;
        supportedShapes?: string[];
        tags?: string[];
     }[];
     layerTree?: LayerTree;
     layouts?: UserLayout[];
     projectApps?: ProjectAppOverride[];
     projectLayers?: ProjectLayer[];
     scenarios?: Scenario[];
     sections?: (
        | RawPoint
        | RawMultiPoint
        | RawLineString
        | RawMultiLineString
        | RawPolygon
       | RawMultiPolygon)[];
  };
  templateId?: ProjectId;
}[]) => Promise<number[]>;

Bulk-create projects from an array of boundary features, each with optional per-project overrides.

Mirrors createProject for many projects at once, delegating to workspaceStateManager.bulkCreateProjects. Every feature/overrides pair is validated up-front, so nothing is created if any pair is invalid.

Only available to approved apps. Contact us for details.

Parameters ​

ParameterTypeDescription
thisRpcCallContext-
projects{ feature: Feature< | Point | Polygon | MultiPolygon>; overrides?: { blocks?: { description?: string; features: ( | PreStackedPoint | PreStackedLineString | PreStackedPolygon<Record<string, any>>)[]; id: string; keyWords?: string[]; name: string; properties?: Record<string, any>; }[]; flows?: { defaults?: Record<string, any>; dependencies: GiraffeNodeGraphFeatureDependancy[]; description?: string; edges: GiraffeEdge[]; id: string; inputs: Record<string, GiraffeNodeInputHandle>; name: string; nodes: GiraffeNode[]; outputs: Record<string, GiraffeNodeInputHandle>; supportedShapes?: string[]; tags?: string[]; }[]; layerTree?: LayerTree; layouts?: UserLayout[]; projectApps?: ProjectAppOverride[]; projectLayers?: ProjectLayer[]; scenarios?: Scenario[]; sections?: ( | RawPoint | RawMultiPoint | RawLineString | RawMultiLineString | RawPolygon | RawMultiPolygon)[]; }; templateId?: ProjectId; }[]Array of { feature, overrides, templateId } describing each project to create. At most MAX_BULK_PROJECTS projects may be created per call.

Returns ​

Promise<number[]>

Array of created project ids in input order; an entry is null if the backend failed to create that project.

Throws ​

Error if the caller is not an approved Giraffe app, if too many projects are requested, or if any feature/overrides pair fails validation.