@layer_ai/sdk 1.0.0

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/README.md ADDED
@@ -0,0 +1,166 @@
1
+ # @layer_ai/sdk
2
+
3
+ Official JavaScript and TypeScript SDK for [Layer](https://www.layer.ai) — AI asset
4
+ creation for game studios.
5
+
6
+ Reaches the same models, workspaces, and Creative Unit balance as the app, from Node, a
7
+ build script, a game-tooling service, or an agent.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install @layer_ai/sdk
13
+ ```
14
+
15
+ Node 20.6 and up, or any runtime with `fetch`. ESM only. No dependencies.
16
+
17
+ ## Authenticate
18
+
19
+ Create a Personal Access Token in the app under **Settings → Personal Access Tokens**,
20
+ then either pass it or leave it in `LAYER_API_KEY`:
21
+
22
+ ```ts
23
+ import { Layer } from "@layer_ai/sdk";
24
+
25
+ const layer = new Layer({ apiKey: process.env.LAYER_API_KEY });
26
+ ```
27
+
28
+ For a browser-based app holding an OAuth access token, pass a function instead — it is
29
+ called per request, so a refreshed token is picked up without rebuilding the client:
30
+
31
+ ```ts
32
+ const layer = new Layer({ apiKey: () => session.getAccessToken() });
33
+ ```
34
+
35
+ ## Generate
36
+
37
+ ```ts
38
+ const run = await layer.inferences.generate({
39
+ prompt: "a crystal sword icon, transparent background",
40
+ batch_size: 4,
41
+ });
42
+
43
+ for (const asset of run.outputs ?? []) {
44
+ console.log(asset.url, asset.content_type);
45
+ }
46
+ ```
47
+
48
+ `generate()` prices the run, submits it, and polls until it finishes. Leave
49
+ `base_model_id` off and Layer picks the recommended model for the modality; the run
50
+ reports which one it used.
51
+
52
+ Put a ceiling on what one call may spend, and nothing is submitted when it trips:
53
+
54
+ ```ts
55
+ await layer.inferences.generate({ prompt: "..." }, { maxCreativeUnits: 8 });
56
+ ```
57
+
58
+ For a long render, submit and collect later:
59
+
60
+ ```ts
61
+ const accepted = await layer.inferences.create({ prompt: "...", modality: "video" });
62
+ const run = await layer.inferences.wait(accepted.inference_id, {
63
+ onProgress: (state) => console.error(state.status),
64
+ });
65
+ ```
66
+
67
+ ## Reference images and other inputs
68
+
69
+ Uploads go straight to storage rather than through the API, so a large file never crosses
70
+ the server:
71
+
72
+ ```ts
73
+ const uploaded = await layer.files.upload(await readFile("hero.png"), {
74
+ contentType: "image/png",
75
+ fileName: "hero.png",
76
+ });
77
+
78
+ await layer.inferences.generate({
79
+ prompt: "the same hero, mid-swing",
80
+ guidance_files: [{ file_id: uploaded.file_id, type: "init_image" }],
81
+ });
82
+ ```
83
+
84
+ ## Browse the catalogue
85
+
86
+ Which models a workspace can run depends on its plan and its policy, so read the
87
+ catalogue rather than hard-coding ids:
88
+
89
+ ```ts
90
+ for await (const model of layer.baseModels.listAll({ modality: "video" })) {
91
+ console.log(model.base_model_id, model.name);
92
+ }
93
+
94
+ const defaults = await layer.baseModels.defaults();
95
+ console.log(defaults.featured_by_modality.image?.[0]);
96
+ ```
97
+
98
+ Every list endpoint comes in two shapes: `list()` returns one page with its cursor, and
99
+ `listAll()` walks every page and yields items.
100
+
101
+ ## Workspaces
102
+
103
+ A client with no `workspaceId` resolves one from the credential, which works when it
104
+ reaches exactly one workspace. Name it when there are several — on the client, or per
105
+ call:
106
+
107
+ ```ts
108
+ const layer = new Layer({ apiKey, workspaceId: "…" });
109
+ await layer.projects.list({ workspaceId: "…" });
110
+ ```
111
+
112
+ ## Errors
113
+
114
+ Every failure is a `LayerError`. Branch on `code` — the machine-readable identifier —
115
+ never on the message, which is prose and may be reworded:
116
+
117
+ ```ts
118
+ import { LayerApiError, LayerRunFailedError } from "@layer_ai/sdk";
119
+
120
+ try {
121
+ await layer.inferences.generate({ prompt: "..." });
122
+ } catch (error) {
123
+ if (error instanceof LayerRunFailedError && error.isInsufficientBalance) {
124
+ // Top up and resubmit.
125
+ }
126
+ if (error instanceof LayerApiError && error.isRateLimited) {
127
+ console.error(`Retry in ${error.retryAfterSeconds}s`);
128
+ }
129
+ throw error;
130
+ }
131
+ ```
132
+
133
+ Requests that the server said were worth retrying — a 429, a 503, a dropped connection —
134
+ are retried automatically with backoff. Every unsafe request carries an idempotency key,
135
+ so a retried generation is replayed rather than run, and paid for, twice.
136
+
137
+ ## What else is here
138
+
139
+ | Namespace | What it reaches |
140
+ | ---------------------- | ------------------------------------------------------- |
141
+ | `layer.inferences` | Generation: estimate, create, wait, cancel |
142
+ | `layer.baseModels` | The model catalogue, defaults, and per-model schemas |
143
+ | `layer.referenceSets` | Trained subjects, styles, and characters |
144
+ | `layer.trainingRuns` | Training a reference set, and the model it produces |
145
+ | `layer.files` | Uploads and per-file quality scores |
146
+ | `layer.workflows` | Saved multi-step Blueprints and their runs |
147
+ | `layer.projects` | Projects and their members |
148
+ | `layer.workspaces` | Workspaces, balance, and usage |
149
+ | `layer.scores` | Output scoring rules, and running them |
150
+
151
+ Anything the SDK has no method for is still one call away through the transport, which
152
+ keeps the auth, retries, and error handling:
153
+
154
+ ```ts
155
+ await layer.http.get("/v2/workspaces/…/groups");
156
+ ```
157
+
158
+ ## Links
159
+
160
+ - Documentation: <https://www.layer.ai/docs>
161
+ - REST API reference: <https://www.layer.ai/docs/api>
162
+ - Command-line interface: [`layer` on PyPI](https://pypi.org/project/layer/)
163
+
164
+ ## License
165
+
166
+ Apache-2.0
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The client every call goes through.
3
+ *
4
+ * One credential, one deployment, one default workspace. Resources hang off it as
5
+ * namespaces (`client.inferences`, `client.files`, …) so the surface stays discoverable
6
+ * from an editor without reading the docs first.
7
+ */
8
+ import { HttpClient, type DeprecationNotice, type FetchLike, type RetryPolicy, type TokenSource } from "./http.js";
9
+ import { BaseModels } from "./resources/base-models.js";
10
+ import { Files } from "./resources/files.js";
11
+ import { Inferences } from "./resources/inferences.js";
12
+ import { Projects } from "./resources/projects.js";
13
+ import { ReferenceSets } from "./resources/reference-sets.js";
14
+ import { Scores } from "./resources/scores.js";
15
+ import { TrainingRuns } from "./resources/training-runs.js";
16
+ import { Workflows } from "./resources/workflows.js";
17
+ import { Workspaces } from "./resources/workspaces.js";
18
+ /** The production deployment, and the server the OpenAPI description names. */
19
+ export declare const DEFAULT_BASE_URL = "https://api.app.layer.ai/api";
20
+ export interface LayerOptions {
21
+ /**
22
+ * A Personal Access Token, or a function returning a bearer token.
23
+ *
24
+ * A function is called per request, so an OAuth access token can be refreshed without
25
+ * rebuilding the client. Defaults to the `LAYER_API_KEY` environment variable where one
26
+ * is readable.
27
+ */
28
+ apiKey?: TokenSource;
29
+ /** Base URL of the deployment. Defaults to production. */
30
+ baseUrl?: string;
31
+ /**
32
+ * Workspace every call runs against.
33
+ *
34
+ * Optional: with no default, the first call that needs one resolves it from the
35
+ * credential's workspaces, which works when there is exactly one. Per-call
36
+ * `workspaceId` always wins.
37
+ */
38
+ workspaceId?: string;
39
+ /** Per-request deadline in milliseconds. Defaults to 60s. */
40
+ timeoutMs?: number;
41
+ /** How failed requests are re-sent. Set `maxRetries: 0` to send each request once. */
42
+ retry?: Partial<RetryPolicy>;
43
+ /** Replaces the global `fetch`, for tests and for a caller with their own transport. */
44
+ fetch?: FetchLike;
45
+ /** Called the first time an endpoint reports itself deprecated. */
46
+ onDeprecation?: (notice: DeprecationNotice) => void;
47
+ /** Appended to the SDK's own User-Agent, to identify an integration in API metrics. */
48
+ userAgent?: string;
49
+ }
50
+ export declare class Layer {
51
+ readonly workspaces: Workspaces;
52
+ readonly projects: Projects;
53
+ readonly baseModels: BaseModels;
54
+ readonly referenceSets: ReferenceSets;
55
+ readonly inferences: Inferences;
56
+ readonly trainingRuns: TrainingRuns;
57
+ readonly files: Files;
58
+ readonly workflows: Workflows;
59
+ readonly scores: Scores;
60
+ /** The transport, exposed so a caller can reach an endpoint the SDK has no method for. */
61
+ readonly http: HttpClient;
62
+ private readonly defaultWorkspaceId;
63
+ /** Resolved at most once, and shared by every call that needs it. */
64
+ private resolvingWorkspace;
65
+ constructor(options?: LayerOptions);
66
+ /**
67
+ * The workspace a call runs against.
68
+ *
69
+ * Guessing is only safe when there is nothing to guess between, so a credential that
70
+ * reaches several workspaces is told to name one rather than having one picked for it.
71
+ */
72
+ resolveWorkspace(override?: string): Promise<string>;
73
+ private discoverSoleWorkspace;
74
+ }
package/dist/client.js ADDED
@@ -0,0 +1,108 @@
1
+ /**
2
+ * The client every call goes through.
3
+ *
4
+ * One credential, one deployment, one default workspace. Resources hang off it as
5
+ * namespaces (`client.inferences`, `client.files`, …) so the surface stays discoverable
6
+ * from an editor without reading the docs first.
7
+ */
8
+ import { LayerError } from "./errors.js";
9
+ import { DEFAULT_RETRY_POLICY, HttpClient, } from "./http.js";
10
+ import { BaseModels } from "./resources/base-models.js";
11
+ import { Files } from "./resources/files.js";
12
+ import { Inferences } from "./resources/inferences.js";
13
+ import { Projects } from "./resources/projects.js";
14
+ import { ReferenceSets } from "./resources/reference-sets.js";
15
+ import { Scores } from "./resources/scores.js";
16
+ import { TrainingRuns } from "./resources/training-runs.js";
17
+ import { Workflows } from "./resources/workflows.js";
18
+ import { Workspaces } from "./resources/workspaces.js";
19
+ import { VERSION } from "./version.js";
20
+ /** The production deployment, and the server the OpenAPI description names. */
21
+ export const DEFAULT_BASE_URL = "https://api.app.layer.ai/api";
22
+ /** Read the ambient token where a runtime has an environment to read it from. */
23
+ const environmentApiKey = () => {
24
+ const environment = globalThis
25
+ .process?.env;
26
+ return environment?.LAYER_API_KEY;
27
+ };
28
+ const runtimeTag = () => {
29
+ const versions = globalThis.process?.versions;
30
+ return versions?.node ? `node/${versions.node}` : "browser";
31
+ };
32
+ export class Layer {
33
+ workspaces;
34
+ projects;
35
+ baseModels;
36
+ referenceSets;
37
+ inferences;
38
+ trainingRuns;
39
+ files;
40
+ workflows;
41
+ scores;
42
+ /** The transport, exposed so a caller can reach an endpoint the SDK has no method for. */
43
+ http;
44
+ defaultWorkspaceId;
45
+ /** Resolved at most once, and shared by every call that needs it. */
46
+ resolvingWorkspace;
47
+ constructor(options = {}) {
48
+ const apiKey = options.apiKey ?? environmentApiKey();
49
+ if (apiKey === undefined) {
50
+ throw new LayerError("No credential. Pass `apiKey` to the Layer client, or set LAYER_API_KEY to a " +
51
+ "Personal Access Token from Settings > Personal Access Tokens.");
52
+ }
53
+ const fetchImpl = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
54
+ const suffix = options.userAgent ? ` ${options.userAgent}` : "";
55
+ this.defaultWorkspaceId = options.workspaceId;
56
+ this.http = new HttpClient({
57
+ baseUrl: (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, ""),
58
+ token: apiKey,
59
+ userAgent: `layer-sdk-js/${VERSION} (${runtimeTag()})${suffix}`,
60
+ timeoutMs: options.timeoutMs ?? 60_000,
61
+ retry: { ...DEFAULT_RETRY_POLICY, ...options.retry },
62
+ fetch: fetchImpl,
63
+ onDeprecation: options.onDeprecation,
64
+ });
65
+ const workspace = (override) => this.resolveWorkspace(override);
66
+ this.workspaces = new Workspaces(this.http, workspace);
67
+ this.projects = new Projects(this.http, workspace);
68
+ this.baseModels = new BaseModels(this.http, workspace);
69
+ this.referenceSets = new ReferenceSets(this.http, workspace);
70
+ this.inferences = new Inferences(this.http, workspace);
71
+ this.trainingRuns = new TrainingRuns(this.http, workspace);
72
+ this.files = new Files(this.http, workspace, fetchImpl);
73
+ this.workflows = new Workflows(this.http, workspace);
74
+ this.scores = new Scores(this.http, workspace);
75
+ }
76
+ /**
77
+ * The workspace a call runs against.
78
+ *
79
+ * Guessing is only safe when there is nothing to guess between, so a credential that
80
+ * reaches several workspaces is told to name one rather than having one picked for it.
81
+ */
82
+ async resolveWorkspace(override) {
83
+ if (override !== undefined)
84
+ return override;
85
+ if (this.defaultWorkspaceId !== undefined)
86
+ return this.defaultWorkspaceId;
87
+ // A failed discovery is not cached, so a call after a transient one can try again.
88
+ this.resolvingWorkspace ??= this.discoverSoleWorkspace().catch((error) => {
89
+ this.resolvingWorkspace = undefined;
90
+ throw error;
91
+ });
92
+ return this.resolvingWorkspace;
93
+ }
94
+ async discoverSoleWorkspace() {
95
+ const body = await this.http.get("/v2/workspaces", {
96
+ query: { limit: 2 },
97
+ });
98
+ const [first, second] = body.workspaces;
99
+ if (first === undefined) {
100
+ throw new LayerError("This credential belongs to no workspace.");
101
+ }
102
+ if (second !== undefined) {
103
+ throw new LayerError("This credential reaches more than one workspace. Pass `workspaceId` to the Layer " +
104
+ "client, or to the call. `client.workspaces.listAll()` lists them.");
105
+ }
106
+ return first.workspace_id;
107
+ }
108
+ }
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Every failure the SDK surfaces, as one class hierarchy.
3
+ *
4
+ * Callers branch on `error.code` — the machine-readable last segment of the API's RFC
5
+ * 9457 `type` URI — never on the prose in `message`, which is documented as rewordable.
6
+ */
7
+ /** Error codes the API returns that a caller is expected to branch on. */
8
+ export declare const ERROR_CODES: readonly ["UNAUTHENTICATED", "FORBIDDEN", "NOT_FOUND", "INVALID_INPUT", "INSUFFICIENT_BALANCE", "BALANCE_UNAVAILABLE", "CONTENT_POLICY_VIOLATION", "RATE_LIMITED", "IDEMPOTENCY_KEY_REUSED", "IDEMPOTENT_REQUEST_IN_PROGRESS", "INTERNAL_ERROR"];
9
+ export type KnownErrorCode = (typeof ERROR_CODES)[number];
10
+ /** New codes ship without a major version, so an unrecognized one is still a string. */
11
+ export type ErrorCode = KnownErrorCode | (string & Record<never, never>);
12
+ /** The quota state the API reports alongside a rate-limited response. */
13
+ export interface RateLimitState {
14
+ /** Requests allowed in the window. */
15
+ limit: number | null;
16
+ /** Requests left in the current window. */
17
+ remaining: number | null;
18
+ /** Seconds until the quota is fully restored. */
19
+ resetSeconds: number | null;
20
+ }
21
+ /** Base class for everything thrown by the SDK, so one `catch` can cover it. */
22
+ export declare class LayerError extends Error {
23
+ constructor(message: string, options?: {
24
+ cause?: unknown;
25
+ });
26
+ }
27
+ /** The API answered with a problem document. */
28
+ export declare class LayerApiError extends LayerError {
29
+ /** HTTP status of the response. */
30
+ readonly status: number;
31
+ /** Last path segment of the problem's `type` URI, or `"UNKNOWN"` when it carried none. */
32
+ readonly code: ErrorCode;
33
+ /** The problem's `type` URI verbatim. Opaque: it is an identifier, not a live page. */
34
+ readonly type: string | null;
35
+ /** The problem's short `title`. */
36
+ readonly title: string | null;
37
+ /** The problem's `detail` — what to do about it. */
38
+ readonly detail: string | null;
39
+ /** Seconds the server asked the caller to wait, from `Retry-After`. */
40
+ readonly retryAfterSeconds: number | null;
41
+ /** Quota state at the time of the response. */
42
+ readonly rateLimit: RateLimitState | null;
43
+ /** The request that failed, for logs. */
44
+ readonly method: string;
45
+ readonly path: string;
46
+ constructor(init: {
47
+ message: string;
48
+ status: number;
49
+ code: ErrorCode;
50
+ type: string | null;
51
+ title: string | null;
52
+ detail: string | null;
53
+ retryAfterSeconds: number | null;
54
+ rateLimit: RateLimitState | null;
55
+ method: string;
56
+ path: string;
57
+ });
58
+ /** Whether the credential was missing, rejected, or lacked the permission. */
59
+ get isAuthError(): boolean;
60
+ /** Whether the workspace is out of Creative Units. */
61
+ get isInsufficientBalance(): boolean;
62
+ /** Whether a quota rejected the request. */
63
+ get isRateLimited(): boolean;
64
+ }
65
+ /** The request never got an answer — DNS, TLS, a dropped socket, an offline host. */
66
+ export declare class LayerConnectionError extends LayerError {
67
+ }
68
+ /** The request, or a wait for a run, outlived its deadline. */
69
+ export declare class LayerTimeoutError extends LayerError {
70
+ }
71
+ /** A generation or training run reached a terminal state that is not success. */
72
+ export declare class LayerRunFailedError extends LayerError {
73
+ /** The run's id, so a caller can look it up after the throw. */
74
+ readonly runId: string;
75
+ /** The terminal status the run reached. */
76
+ readonly status: string;
77
+ /** The run's `error_code`, when it carried one. */
78
+ readonly code: ErrorCode | null;
79
+ constructor(init: {
80
+ message: string;
81
+ runId: string;
82
+ status: string;
83
+ code: ErrorCode | null;
84
+ });
85
+ /** Whether the run failed for want of Creative Units rather than for its inputs. */
86
+ get isInsufficientBalance(): boolean;
87
+ }
88
+ /** A run would cost more than the caller allowed, so nothing was submitted. */
89
+ export declare class LayerBudgetExceededError extends LayerError {
90
+ /** What the run was priced at, in Creative Units. */
91
+ readonly estimatedCreativeUnits: number;
92
+ /** The ceiling the caller set. */
93
+ readonly maxCreativeUnits: number;
94
+ constructor(init: {
95
+ estimatedCreativeUnits: number;
96
+ maxCreativeUnits: number;
97
+ });
98
+ }
package/dist/errors.js ADDED
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Every failure the SDK surfaces, as one class hierarchy.
3
+ *
4
+ * Callers branch on `error.code` — the machine-readable last segment of the API's RFC
5
+ * 9457 `type` URI — never on the prose in `message`, which is documented as rewordable.
6
+ */
7
+ /** Error codes the API returns that a caller is expected to branch on. */
8
+ export const ERROR_CODES = [
9
+ "UNAUTHENTICATED",
10
+ "FORBIDDEN",
11
+ "NOT_FOUND",
12
+ "INVALID_INPUT",
13
+ "INSUFFICIENT_BALANCE",
14
+ "BALANCE_UNAVAILABLE",
15
+ "CONTENT_POLICY_VIOLATION",
16
+ "RATE_LIMITED",
17
+ "IDEMPOTENCY_KEY_REUSED",
18
+ "IDEMPOTENT_REQUEST_IN_PROGRESS",
19
+ "INTERNAL_ERROR",
20
+ ];
21
+ /** Base class for everything thrown by the SDK, so one `catch` can cover it. */
22
+ export class LayerError extends Error {
23
+ constructor(message, options) {
24
+ super(message, options);
25
+ this.name = new.target.name;
26
+ }
27
+ }
28
+ /** The API answered with a problem document. */
29
+ export class LayerApiError extends LayerError {
30
+ /** HTTP status of the response. */
31
+ status;
32
+ /** Last path segment of the problem's `type` URI, or `"UNKNOWN"` when it carried none. */
33
+ code;
34
+ /** The problem's `type` URI verbatim. Opaque: it is an identifier, not a live page. */
35
+ type;
36
+ /** The problem's short `title`. */
37
+ title;
38
+ /** The problem's `detail` — what to do about it. */
39
+ detail;
40
+ /** Seconds the server asked the caller to wait, from `Retry-After`. */
41
+ retryAfterSeconds;
42
+ /** Quota state at the time of the response. */
43
+ rateLimit;
44
+ /** The request that failed, for logs. */
45
+ method;
46
+ path;
47
+ constructor(init) {
48
+ super(init.message);
49
+ this.status = init.status;
50
+ this.code = init.code;
51
+ this.type = init.type;
52
+ this.title = init.title;
53
+ this.detail = init.detail;
54
+ this.retryAfterSeconds = init.retryAfterSeconds;
55
+ this.rateLimit = init.rateLimit;
56
+ this.method = init.method;
57
+ this.path = init.path;
58
+ }
59
+ /** Whether the credential was missing, rejected, or lacked the permission. */
60
+ get isAuthError() {
61
+ return this.status === 401 || this.status === 403;
62
+ }
63
+ /** Whether the workspace is out of Creative Units. */
64
+ get isInsufficientBalance() {
65
+ return this.code === "INSUFFICIENT_BALANCE";
66
+ }
67
+ /** Whether a quota rejected the request. */
68
+ get isRateLimited() {
69
+ return this.status === 429;
70
+ }
71
+ }
72
+ /** The request never got an answer — DNS, TLS, a dropped socket, an offline host. */
73
+ export class LayerConnectionError extends LayerError {
74
+ }
75
+ /** The request, or a wait for a run, outlived its deadline. */
76
+ export class LayerTimeoutError extends LayerError {
77
+ }
78
+ /** A generation or training run reached a terminal state that is not success. */
79
+ export class LayerRunFailedError extends LayerError {
80
+ /** The run's id, so a caller can look it up after the throw. */
81
+ runId;
82
+ /** The terminal status the run reached. */
83
+ status;
84
+ /** The run's `error_code`, when it carried one. */
85
+ code;
86
+ constructor(init) {
87
+ super(init.message);
88
+ this.runId = init.runId;
89
+ this.status = init.status;
90
+ this.code = init.code;
91
+ }
92
+ /** Whether the run failed for want of Creative Units rather than for its inputs. */
93
+ get isInsufficientBalance() {
94
+ return this.code === "INSUFFICIENT_BALANCE";
95
+ }
96
+ }
97
+ /** A run would cost more than the caller allowed, so nothing was submitted. */
98
+ export class LayerBudgetExceededError extends LayerError {
99
+ /** What the run was priced at, in Creative Units. */
100
+ estimatedCreativeUnits;
101
+ /** The ceiling the caller set. */
102
+ maxCreativeUnits;
103
+ constructor(init) {
104
+ super(`The run was priced at ${init.estimatedCreativeUnits} Creative Units, ` +
105
+ `above the ${init.maxCreativeUnits} allowed by maxCreativeUnits. Nothing was submitted.`);
106
+ this.estimatedCreativeUnits = init.estimatedCreativeUnits;
107
+ this.maxCreativeUnits = init.maxCreativeUnits;
108
+ }
109
+ }