@crowdedkingdoms/crowdyjs 17.4.0 → 17.5.0-test.1

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.
@@ -2371,6 +2371,8 @@ export type CreateSessionInput = {
2371
2371
  participantUserIds?: InputMaybe<Array<Scalars['BigInt']['input']>>;
2372
2372
  /** How the roster is judged: 'actor' (default) expires a joined participant with no fresh Buddy actor in the app after the join grace window; 'none' never expires anybody. Use 'none' for turn-based play that talks GraphQL and channel pings and never replicates an actor (kit.matches does), where the roster's only exits are leave and end. */
2373
2373
  presence?: InputMaybe<Scalars['String']['input']>;
2374
+ /** Optional: copy the app's template rows of the listed container types into the new session at creation (see SessionSeedInput). At most 2,000 rows per session; above that the creation is refused with the count and no session exists. The count of rows stamped is on the session's `created` event (containersSeeded) and on GmSession.seededContainerCount of the create response. */
2375
+ seedFromApp?: InputMaybe<SessionSeedInput>;
2374
2376
  };
2375
2377
  /** Create a team in an app. */
2376
2378
  export type CreateTeamInput = {
@@ -4180,6 +4182,8 @@ export type GmContainerType = {
4180
4182
  instantiableBy: Scalars['String']['output'];
4181
4183
  /** JSON object of developer metadata. */
4182
4184
  metadataJson: Scalars['String']['output'];
4185
+ /** Where this type's rows live. 'session' (default): one row per bindingKey per session, and a client inside a session binds the session's row. 'app': one row per bindingKey for the whole app, shared by every session (state that outlives matches: territory, landmarks, a persistent world). On an app-scoped type, gameModelEnsureContainer / gameModelCreateContainer with a sessionId are refused (CONTAINER_TYPE_APP_SCOPED); bind at app scope and pass the session on gameModelInvoke, where is_participant / is_current_turn are judged against the call's session. Changing 'session' to 'app' is refused while the type holds session-scoped rows. */
4186
+ scope: Scalars['String']['output'];
4183
4187
  /** Stable type name (unique per app); used to reference the type. */
4184
4188
  typeName: Scalars['String']['output'];
4185
4189
  };
@@ -4594,6 +4598,8 @@ export type GmSession = {
4594
4598
  presence: Scalars['String']['output'];
4595
4599
  /** Monotonic change counter. Every event in gameModelSessionChanged carries the revision that produced it; gameModelSessionSnapshot returns the revision it describes. Compare as integers. */
4596
4600
  revision: Scalars['String']['output'];
4601
+ /** On the gameModelCreateSession response only: how many container rows seedFromApp stamped into the session (0 when seedFromApp was given and matched nothing). Null on every other read; the durable record is the containersSeeded field of the created event. */
4602
+ seededContainerCount: Maybe<Scalars['Int']['output']>;
4597
4603
  /** Unique session id. */
4598
4604
  sessionId: Scalars['String']['output'];
4599
4605
  /** Lifecycle status (e.g. active). */
@@ -5442,7 +5448,7 @@ export type Mutation = {
5442
5448
  gameModelCancelTimer: Scalars['Int']['output'];
5443
5449
  /** Instantiate a container (a runtime entity of a given type), optionally within a session, with an owner and initial properties. Subject to the type's instantiableBy rule (admin | member | owner). Requires a valid token. */
5444
5450
  gameModelCreateContainer: GmContainer;
5445
- /** Create a runtime session: an isolated instance scope for containers (e.g. a match, room, or save) with its own roster, host, admission and capacity. Subject to the app's session creation policy. The caller becomes creator, host (term 1) and a joined participant. Presence is actor presence: a participant with no fresh Buddy actor in the app after the join grace window is expired by the server. Requires a valid token. */
5451
+ /** Create a runtime session: an isolated instance scope for containers (e.g. a match, room, or save) with its own roster, host, admission and capacity. Subject to the app's session creation policy. The caller becomes creator, host (term 1) and a joined participant. Presence is actor presence: a participant with no fresh Buddy actor in the app after the join grace window is expired by the server. With seedFromApp, the app's keyed template rows of the listed types are copied into the new session in the same transaction (max 2000 rows, refused above; no per-row events; count on the created event and on seededContainerCount). The copies seedFromApp stamps are dropped by the retention sweep once the session has been ended for GM_SESSION_CONTAINER_RETENTION_DAYS, when the tier's operator has set it (default 0, disabled); hand-made rows are never purged. Requires a valid token. */
5446
5452
  gameModelCreateSession: GmSession;
5447
5453
  /** Define an app feature key that functions can gate on (via a tier_feature authority rule) and that access tiers can be granted. Idempotent on (app, featureKey). Requires app-admin ('manage_apps'). */
5448
5454
  gameModelDefineFeature: GmAppFeature;
@@ -5478,7 +5484,7 @@ export type Mutation = {
5478
5484
  gameModelRunAutomation: GmAutomationRun;
5479
5485
  /** Arm a one-shot timer: invoke a function once, after a delay. The timer is durable (it survives an API restart) and claimed by exactly one replica, so it fires once. A timer whose deadline passes while the app has no players WAITS rather than firing into an empty world, and fires when somebody returns: late, not lost. Read the clock in the handler rather than assuming the delay you asked for is the delay that elapsed. The target function must be autonomousInvocable, because the fire is headless and runs with system authority rather than a player's — which is also why this needs app-admin ('manage_apps'). For player-driven delays, author a timers effect on a function instead so the delay is part of your game logic. Supply dedupeKey to make re-arming replace the pending timer rather than queue another fire. */
5480
5486
  gameModelScheduleInvoke: GmTimer;
5481
- /** Bulk-create game-model definitions (container types, property defs, functions) and upsert instances (containers + edges) in one transaction — used to initialize or import a model. Seed containers bind as `seed:` + tempId and re-seed maps tempId to the existing id (containersCreated increments only on insert). Requires app-admin ('manage_apps'). */
5487
+ /** Bulk-create game-model definitions (container types, property defs, functions) and upsert instances (containers + edges) in one transaction — used to initialize or import a model. Seed containers bind as `seed:` + tempId, or as the row's own bindingKey when given (admin-instantiable or bind-policied types only, so a runtime gameModelEnsureContainer later resolves the same row; an existing row is adopted only if its owner matches, so a player who claimed the key first is never written onto); re-seed maps tempId to the existing id and containersCreated increments only on insert. At most 1000 containers per call (BAD_REQUEST above, nothing written); the call is all-or-nothing. Seeded rows fire no container_created automation or change-feed events. Requires app-admin ('manage_apps'). */
5482
5488
  gameModelSeed: GmSeedResult;
5483
5489
  /** Enable or disable an automation. Re-enabling also resets its circuit breaker (closed, zero failures, no pause) so a tripped automation resumes. Requires app-admin ('manage_apps'). */
5484
5490
  gameModelSetAutomationEnabled: GmAutomation;
@@ -6831,7 +6837,7 @@ export type OrgTokenWithSecret = {
6831
6837
  orgId: Scalars['BigInt']['output'];
6832
6838
  /** Unique token id (BigInt as string). */
6833
6839
  orgTokenId: Scalars['BigInt']['output'];
6834
- /** The plaintext token. Save it now; it is not stored. */
6840
+ /** The plaintext token, returned exactly once. Save it now: only its hash is stored and it cannot be shown again. */
6835
6841
  token: Scalars['String']['output'];
6836
6842
  };
6837
6843
  /** Org-level rollup of per-app monthly egress projections for all shared apps. */
@@ -8029,9 +8035,11 @@ export type Query = {
8029
8035
  gameModelContainer: GmContainer;
8030
8036
  /** Fetch a container with its property values filtered to what the CALLER may see (public always; owner/hidden depend on the caller's relationship to the container). Use this for a player-facing view of an entity. Requires a valid token. */
8031
8037
  gameModelContainerState: GmContainerState;
8038
+ /** Bulk twin of gameModelContainerState: identity plus visible property state for up to 500 containers in one call (BAD_REQUEST above). The same visibility rules apply per row (public always; owner/hidden depend on the CALLER's relationship to each container). Ids the app does not hold are omitted rather than errors; duplicates are returned once; order follows the input. Use it after paging gameModelContainers to pull a level's state in a few calls instead of one per object. Requires a valid token. */
8039
+ gameModelContainerStates: Array<GmContainerState>;
8032
8040
  /** List all container types defined for an app. Requires app-admin ('manage_apps'). */
8033
8041
  gameModelContainerTypes: Array<GmContainerType>;
8034
- /** List containers in an app, optionally filtered by container type and/or session, by bindingKey (get-by-key read of an ensured container), by property predicates (`where`, requires typeName; the same predicate shape automation selectors use — missing properties fall back to the type default), and paged with offset/limit over the stable created-at ordering. Requires a valid token. */
8042
+ /** List containers in an app, optionally filtered by container type and/or session, by bindingKey (get-by-key read of an ensured container), by property predicates (`where`, requires typeName; the same predicate shape automation selectors use — missing properties fall back to the type default), and paged with offset/limit over the stable (createdAt, containerId) ordering. Pages: an omitted limit returns 200 rows; the maximum is 1000 (BAD_REQUEST above it). Without `where` the page is read in SQL; with `where` the predicates are evaluated after reading up to 10000 rows of the type, and a larger type is refused (narrow with sessionId / bindingKey, or page without where). Requires a valid token. */
8035
8043
  gameModelContainers: Array<GmContainer>;
8036
8044
  /** Query the function-invocation event log (audit trail) with optional filters and pagination. Useful for debugging functions or showing recent activity. Requires a valid token. */
8037
8045
  gameModelEvents: Array<GmEvent>;
@@ -8618,6 +8626,10 @@ export type QueryGameModelContainerStateArgs = {
8618
8626
  appId: Scalars['BigInt']['input'];
8619
8627
  containerId: Scalars['String']['input'];
8620
8628
  };
8629
+ export type QueryGameModelContainerStatesArgs = {
8630
+ appId: Scalars['BigInt']['input'];
8631
+ containerIds: Array<Scalars['String']['input']>;
8632
+ };
8621
8633
  export type QueryGameModelContainerTypesArgs = {
8622
8634
  appId: Scalars['BigInt']['input'];
8623
8635
  };
@@ -9318,6 +9330,8 @@ export type ScheduleInvokeInput = {
9318
9330
  };
9319
9331
  /** A container (instance) to upsert as part of a seed. Re-seed matches on binding_key `seed:` + tempId; same-name instances are allowed. */
9320
9332
  export type SeedContainerInput = {
9333
+ /** Optional caller-supplied binding key (max 128 chars, opaque) the row upserts on INSTEAD of `seed:` + tempId, on the same unique index gameModelEnsureContainer uses (unique per app + type + the batch sessionId). Lets a deploy tool pre-create the exact rows a runtime gameModelEnsureContainer will later ask for, e.g. a placement-id digest per level object. Allowed only on a type that is admin-instantiable or carries a bindPolicy, so a player cannot have squatted the key first (BAD_REQUEST naming the tempId otherwise). May not begin with `seed:`. A row that already exists under this key is adopted only when its ownerUserId equals this row's (a re-seed); a row with a different owner -- one a player claimed first under a permissive or shadow-mode bind policy -- is a per-row BAD_REQUEST and nothing is written. On adoption properties are upserted onto it and idMapJson maps the tempId to it; containersCreated does not count it. */
9334
+ bindingKey?: InputMaybe<Scalars['String']['input']>;
9321
9335
  /** Optional description. */
9322
9336
  description?: InputMaybe<Scalars['String']['input']>;
9323
9337
  /** Human-friendly display name. */
@@ -9328,7 +9342,7 @@ export type SeedContainerInput = {
9328
9342
  ownerUserId?: InputMaybe<Scalars['BigInt']['input']>;
9329
9343
  /** Initial property values for the container. */
9330
9344
  properties?: InputMaybe<Array<SeedPropertyInput>>;
9331
- /** Developer-assigned id used for edge references and as the seed binding key (`seed:` + tempId). Re-seed maps this tempId to the existing container id. */
9345
+ /** Developer-assigned id used for edge references and, when bindingKey is omitted, as the seed binding key (`seed:` + tempId). Re-seed maps this tempId to the existing container id. */
9332
9346
  tempId: Scalars['String']['input'];
9333
9347
  /** The container type to instantiate. */
9334
9348
  typeName: Scalars['String']['input'];
@@ -9347,6 +9361,8 @@ export type SeedContainerTypeInput = {
9347
9361
  instantiableBy?: InputMaybe<Scalars['String']['input']>;
9348
9362
  /** JSON object of metadata. */
9349
9363
  metadataJson?: InputMaybe<Scalars['String']['input']>;
9364
+ /** Where this type's rows live. 'session' (default): one row per bindingKey per session, and a client inside a session binds the session's row. 'app': one row per bindingKey for the whole app, shared by every session (state that outlives matches: territory, landmarks, a persistent world). On an app-scoped type, gameModelEnsureContainer / gameModelCreateContainer with a sessionId are refused (CONTAINER_TYPE_APP_SCOPED); bind at app scope and pass the session on gameModelInvoke, where is_participant / is_current_turn are judged against the call's session. Changing 'session' to 'app' is refused while the type holds session-scoped rows. */
9365
+ scope?: InputMaybe<Scalars['String']['input']>;
9350
9366
  /** Stable type name (unique per app). */
9351
9367
  typeName: Scalars['String']['input'];
9352
9368
  };
@@ -9567,6 +9583,13 @@ export type ServiceQuota = {
9567
9583
  /** When the rule was last updated (ISO-8601 UTC timestamp). */
9568
9584
  updatedAt: Scalars['DateTime']['output'];
9569
9585
  };
9586
+ /** Stamp a new session's world rows from the app's template rows at creation. For every app-scoped (sessionId null) container of each listed type that carries a bindingKey, one row is created in the new session with the same bindingKey, displayName, description, metadata and ownerUserId, inside the session creation transaction: the session exists with its rows or does not exist. The template rows were written by an admin (gameModelSeed), so the copy is not subject to the creator's instantiableBy or bindPolicy. Later changes to an app row do not propagate and a session row never writes back. Copies are marked (seeded_from_container_id) and are the only rows the ended-session retention sweep may drop, on a tier that has enabled it. */
9587
+ export type SessionSeedInput = {
9588
+ /** 'defaults' (default): the copies start at the type's property defaults, no property rows written. 'app': each app row's current property rows are copied onto its copy, raw (not visibility-filtered; the copy is server-side and the source is admin-authored). */
9589
+ initialState?: InputMaybe<Scalars['String']['input']>;
9590
+ /** Container types whose app-scoped keyed rows are copied into the new session. Each must be instantiableBy 'admin' or carry a bindPolicy (the same rule gameModelSeed applies to a caller bindingKey: no player may have claimed one of its keys); a plain member type is BAD_REQUEST, as is an undefined type. Types with no app-scoped keyed rows contribute nothing. */
9591
+ typeNames: Array<Scalars['String']['input']>;
9592
+ };
9570
9593
  /** Register/update an app's OAuth client settings for the portal handoff (requires manage_apps on the app). */
9571
9594
  export type SetAppClientSettingsInput = {
9572
9595
  appId: Scalars['BigInt']['input'];
@@ -10499,6 +10522,8 @@ export type UpsertContainerTypeInput = {
10499
10522
  instantiableBy?: InputMaybe<Scalars['String']['input']>;
10500
10523
  /** JSON object of metadata. */
10501
10524
  metadataJson?: InputMaybe<Scalars['String']['input']>;
10525
+ /** Where this type's rows live. 'session' (default): one row per bindingKey per session, and a client inside a session binds the session's row. 'app': one row per bindingKey for the whole app, shared by every session (state that outlives matches: territory, landmarks, a persistent world). On an app-scoped type, gameModelEnsureContainer / gameModelCreateContainer with a sessionId are refused (CONTAINER_TYPE_APP_SCOPED); bind at app scope and pass the session on gameModelInvoke, where is_participant / is_current_turn are judged against the call's session. Changing 'session' to 'app' is refused while the type holds session-scoped rows. */
10526
+ scope?: InputMaybe<Scalars['String']['input']>;
10502
10527
  /** Stable type name (unique per app). Acts as the upsert key. */
10503
10528
  typeName: Scalars['String']['input'];
10504
10529
  };
@@ -14678,6 +14703,7 @@ export type GmSessionFieldsFragment = {
14678
14703
  endReason: string | null;
14679
14704
  createdAt: string;
14680
14705
  presence: string;
14706
+ seededContainerCount: number | null;
14681
14707
  };
14682
14708
  export type GmSessionParticipantFieldsFragment = {
14683
14709
  __typename?: 'GmSessionParticipant';
@@ -14758,6 +14784,7 @@ export type GameModelCreateSessionMutation = {
14758
14784
  endReason: string | null;
14759
14785
  createdAt: string;
14760
14786
  presence: string;
14787
+ seededContainerCount: number | null;
14761
14788
  };
14762
14789
  };
14763
14790
  export type GameModelJoinSessionMutationVariables = Exact<{
@@ -14820,6 +14847,7 @@ export type GameModelSetSessionTurnMutation = {
14820
14847
  endReason: string | null;
14821
14848
  createdAt: string;
14822
14849
  presence: string;
14850
+ seededContainerCount: number | null;
14823
14851
  };
14824
14852
  };
14825
14853
  export type GameModelSetSessionAdmissionMutationVariables = Exact<{
@@ -14846,6 +14874,7 @@ export type GameModelSetSessionAdmissionMutation = {
14846
14874
  endReason: string | null;
14847
14875
  createdAt: string;
14848
14876
  presence: string;
14877
+ seededContainerCount: number | null;
14849
14878
  };
14850
14879
  };
14851
14880
  export type GameModelTransferSessionHostMutationVariables = Exact<{
@@ -14872,6 +14901,7 @@ export type GameModelTransferSessionHostMutation = {
14872
14901
  endReason: string | null;
14873
14902
  createdAt: string;
14874
14903
  presence: string;
14904
+ seededContainerCount: number | null;
14875
14905
  };
14876
14906
  };
14877
14907
  export type GameModelEndSessionMutationVariables = Exact<{
@@ -14898,6 +14928,7 @@ export type GameModelEndSessionMutation = {
14898
14928
  endReason: string | null;
14899
14929
  createdAt: string;
14900
14930
  presence: string;
14931
+ seededContainerCount: number | null;
14901
14932
  };
14902
14933
  };
14903
14934
  export type GameModelCreateContainerMutationVariables = Exact<{
@@ -15015,6 +15046,7 @@ export type GameModelContainersQueryVariables = Exact<{
15015
15046
  appId: Scalars['BigInt']['input'];
15016
15047
  typeName?: InputMaybe<Scalars['String']['input']>;
15017
15048
  sessionId?: InputMaybe<Scalars['String']['input']>;
15049
+ bindingKey?: InputMaybe<Scalars['String']['input']>;
15018
15050
  where?: InputMaybe<Array<GmPropertyPredicateInput> | GmPropertyPredicateInput>;
15019
15051
  limit?: InputMaybe<Scalars['Int']['input']>;
15020
15052
  offset?: InputMaybe<Scalars['Int']['input']>;
@@ -15069,6 +15101,23 @@ export type GameModelContainerStateQuery = {
15069
15101
  propertiesJson: string;
15070
15102
  };
15071
15103
  };
15104
+ export type GameModelContainerStatesQueryVariables = Exact<{
15105
+ appId: Scalars['BigInt']['input'];
15106
+ containerIds: Array<Scalars['String']['input']> | Scalars['String']['input'];
15107
+ }>;
15108
+ export type GameModelContainerStatesQuery = {
15109
+ __typename?: 'Query';
15110
+ gameModelContainerStates: Array<{
15111
+ __typename?: 'GmContainerState';
15112
+ containerId: string;
15113
+ appId: string;
15114
+ sessionId: string | null;
15115
+ typeName: string;
15116
+ displayName: string;
15117
+ ownerUserId: string | null;
15118
+ propertiesJson: string;
15119
+ }>;
15120
+ };
15072
15121
  export type GameModelTraverseQueryVariables = Exact<{
15073
15122
  appId: Scalars['BigInt']['input'];
15074
15123
  rootId: Scalars['String']['input'];
@@ -15126,6 +15175,7 @@ export type GameModelSessionQuery = {
15126
15175
  endReason: string | null;
15127
15176
  createdAt: string;
15128
15177
  presence: string;
15178
+ seededContainerCount: number | null;
15129
15179
  };
15130
15180
  };
15131
15181
  export type GameModelSessionsQueryVariables = Exact<{
@@ -15156,6 +15206,7 @@ export type GameModelSessionsQuery = {
15156
15206
  endReason: string | null;
15157
15207
  createdAt: string;
15158
15208
  presence: string;
15209
+ seededContainerCount: number | null;
15159
15210
  }>;
15160
15211
  };
15161
15212
  export type GameModelSessionSnapshotQueryVariables = Exact<{
@@ -15186,6 +15237,7 @@ export type GameModelSessionSnapshotQuery = {
15186
15237
  endReason: string | null;
15187
15238
  createdAt: string;
15188
15239
  presence: string;
15240
+ seededContainerCount: number | null;
15189
15241
  };
15190
15242
  participants: Array<{
15191
15243
  __typename?: 'GmSessionParticipant';
@@ -15246,6 +15298,7 @@ export type GameModelSessionInspectQuery = {
15246
15298
  endReason: string | null;
15247
15299
  createdAt: string;
15248
15300
  presence: string;
15301
+ seededContainerCount: number | null;
15249
15302
  };
15250
15303
  participants: Array<{
15251
15304
  __typename?: 'GmSessionParticipantInspection';
@@ -15540,6 +15593,7 @@ export type GameModelUpsertContainerTypeMutation = {
15540
15593
  instantiableBy: string;
15541
15594
  defaultPropertyVisibility: string;
15542
15595
  bindPolicyJson: string | null;
15596
+ scope: string;
15543
15597
  metadataJson: string;
15544
15598
  };
15545
15599
  };
@@ -15781,6 +15835,7 @@ export type GameModelContainerTypesQuery = {
15781
15835
  instantiableBy: string;
15782
15836
  defaultPropertyVisibility: string;
15783
15837
  bindPolicyJson: string | null;
15838
+ scope: string;
15784
15839
  metadataJson: string;
15785
15840
  }>;
15786
15841
  };
@@ -20039,6 +20094,7 @@ export declare const GameModelContainerDocument: DocumentNode<GameModelContainer
20039
20094
  export declare const GameModelContainersDocument: DocumentNode<GameModelContainersQuery, GameModelContainersQueryVariables>;
20040
20095
  export declare const GameModelContainerChangedDocument: DocumentNode<GameModelContainerChangedSubscription, GameModelContainerChangedSubscriptionVariables>;
20041
20096
  export declare const GameModelContainerStateDocument: DocumentNode<GameModelContainerStateQuery, GameModelContainerStateQueryVariables>;
20097
+ export declare const GameModelContainerStatesDocument: DocumentNode<GameModelContainerStatesQuery, GameModelContainerStatesQueryVariables>;
20042
20098
  export declare const GameModelTraverseDocument: DocumentNode<GameModelTraverseQuery, GameModelTraverseQueryVariables>;
20043
20099
  export declare const GameModelSessionDocument: DocumentNode<GameModelSessionQuery, GameModelSessionQueryVariables>;
20044
20100
  export declare const GameModelSessionsDocument: DocumentNode<GameModelSessionsQuery, GameModelSessionsQueryVariables>;