-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #221 from DestinyItemManager/stately
Initial Stately schema, generated code, and usage in GlobalSettings
- Loading branch information
Showing
31 changed files
with
2,601 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { createClient } from './generated/stately_item_types.js'; | ||
|
||
/** | ||
* Our StatelyDB client, bound to our types and store. | ||
*/ | ||
export const client = createClient(BigInt(process.env.STATELY_STORE_ID!)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Code generated by Stately. DO NOT EDIT. | ||
|
||
export * from "./stately_pb.js"; | ||
export * from "./stately_item_types.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Code generated by Stately. DO NOT EDIT. | ||
|
||
export * from './stately_item_types.js'; | ||
export * from './stately_pb.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// Code generated by Stately. DO NOT EDIT. | ||
|
||
import type { DatabaseClient as GenericDatabaseClient, StoreID, ClientOptions } from "@stately-cloud/client"; | ||
import type { | ||
ApiApp, | ||
GlobalSettings, | ||
ItemAnnotation, | ||
ItemHashTag, | ||
Loadout, | ||
LoadoutShare, | ||
Search, | ||
Settings, | ||
Triumph, | ||
ApiAppSchema, | ||
GlobalSettingsSchema, | ||
ItemAnnotationSchema, | ||
ItemHashTagSchema, | ||
LoadoutSchema, | ||
LoadoutShareSchema, | ||
SearchSchema, | ||
SettingsSchema, | ||
TriumphSchema, | ||
ArtifactUnlocksSchema, | ||
CollapsedSectionSchema, | ||
CustomStatDefSchema, | ||
CustomStatWeightsEntrySchema, | ||
CustomStatsEntrySchema, | ||
InGameLoadoutIdentifiersSchema, | ||
LoadoutItemSchema, | ||
LoadoutParametersSchema, | ||
ModsByBucketEntrySchema, | ||
SocketOverrideSchema, | ||
StatConstraintSchema, | ||
StatConstraintsEntrySchema, | ||
} from "./stately_pb.js"; | ||
|
||
export declare const itemTypeToSchema: { | ||
"ApiApp": typeof ApiAppSchema, | ||
"GlobalSettings": typeof GlobalSettingsSchema, | ||
"ItemAnnotation": typeof ItemAnnotationSchema, | ||
"ItemHashTag": typeof ItemHashTagSchema, | ||
"Loadout": typeof LoadoutSchema, | ||
"LoadoutShare": typeof LoadoutShareSchema, | ||
"Search": typeof SearchSchema, | ||
"Settings": typeof SettingsSchema, | ||
"Triumph": typeof TriumphSchema, | ||
"ArtifactUnlocks": typeof ArtifactUnlocksSchema, | ||
"CollapsedSection": typeof CollapsedSectionSchema, | ||
"CustomStatDef": typeof CustomStatDefSchema, | ||
"CustomStatWeightsEntry": typeof CustomStatWeightsEntrySchema, | ||
"CustomStatsEntry": typeof CustomStatsEntrySchema, | ||
"InGameLoadoutIdentifiers": typeof InGameLoadoutIdentifiersSchema, | ||
"LoadoutItem": typeof LoadoutItemSchema, | ||
"LoadoutParameters": typeof LoadoutParametersSchema, | ||
"ModsByBucketEntry": typeof ModsByBucketEntrySchema, | ||
"SocketOverride": typeof SocketOverrideSchema, | ||
"StatConstraint": typeof StatConstraintSchema, | ||
"StatConstraintsEntry": typeof StatConstraintsEntrySchema, | ||
}; | ||
|
||
// AllItemTypes is a convenience type that represents all item type names in your schema. | ||
export type AllItemTypes = | ||
| "ApiApp" | ||
| "GlobalSettings" | ||
| "ItemAnnotation" | ||
| "ItemHashTag" | ||
| "Loadout" | ||
| "LoadoutShare" | ||
| "Search" | ||
| "Settings" | ||
| "Triumph"; | ||
|
||
// AnyItem is a convenience type that represents any item shape in your schema. | ||
export type AnyItem = | ||
| ApiApp | ||
| GlobalSettings | ||
| ItemAnnotation | ||
| ItemHashTag | ||
| Loadout | ||
| LoadoutShare | ||
| Search | ||
| Settings | ||
| Triumph; | ||
|
||
// DatabaseClient is a database client that has been customized with your schema. | ||
export type DatabaseClient = GenericDatabaseClient<typeof itemTypeToSchema, AllItemTypes>; | ||
|
||
// createClient creates a new database client with your schema. | ||
export declare function createClient( | ||
storeId: StoreID, | ||
opts?: ClientOptions, | ||
): DatabaseClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Code generated by Stately. DO NOT EDIT. | ||
|
||
import { createClient as createGenericClient } from '@stately-cloud/client'; | ||
import { | ||
ApiAppSchema, | ||
ArtifactUnlocksSchema, | ||
CollapsedSectionSchema, | ||
CustomStatDefSchema, | ||
CustomStatWeightsEntrySchema, | ||
CustomStatsEntrySchema, | ||
GlobalSettingsSchema, | ||
InGameLoadoutIdentifiersSchema, | ||
ItemAnnotationSchema, | ||
ItemHashTagSchema, | ||
LoadoutItemSchema, | ||
LoadoutParametersSchema, | ||
LoadoutSchema, | ||
LoadoutShareSchema, | ||
ModsByBucketEntrySchema, | ||
SearchSchema, | ||
SettingsSchema, | ||
SocketOverrideSchema, | ||
StatConstraintSchema, | ||
StatConstraintsEntrySchema, | ||
TriumphSchema, | ||
} from './stately_pb.js'; | ||
|
||
export const typeToSchema = { | ||
// itemTypes | ||
ApiApp: ApiAppSchema, | ||
GlobalSettings: GlobalSettingsSchema, | ||
ItemAnnotation: ItemAnnotationSchema, | ||
ItemHashTag: ItemHashTagSchema, | ||
Loadout: LoadoutSchema, | ||
LoadoutShare: LoadoutShareSchema, | ||
Search: SearchSchema, | ||
Settings: SettingsSchema, | ||
Triumph: TriumphSchema, | ||
|
||
// objectTypes | ||
ArtifactUnlocks: ArtifactUnlocksSchema, | ||
CollapsedSection: CollapsedSectionSchema, | ||
CustomStatDef: CustomStatDefSchema, | ||
CustomStatWeightsEntry: CustomStatWeightsEntrySchema, | ||
CustomStatsEntry: CustomStatsEntrySchema, | ||
InGameLoadoutIdentifiers: InGameLoadoutIdentifiersSchema, | ||
LoadoutItem: LoadoutItemSchema, | ||
LoadoutParameters: LoadoutParametersSchema, | ||
ModsByBucketEntry: ModsByBucketEntrySchema, | ||
SocketOverride: SocketOverrideSchema, | ||
StatConstraint: StatConstraintSchema, | ||
StatConstraintsEntry: StatConstraintsEntrySchema, | ||
}; | ||
|
||
export function createClient(storeId, opts) { | ||
return createGenericClient(storeId, typeToSchema, opts); | ||
} |
Oops, something went wrong.