@kaitencloud/graphql-schema 2.1.0 → 2.3.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/schema.graphqls +175 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaitencloud/graphql-schema",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "Kaiten API GraphQL schema: the gqlgen fragments, concatenated, published for downstream SDKs.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/schema.graphqls CHANGED
@@ -122,6 +122,74 @@ type AddonPrice {
122
122
  deprecatedAt: Time
123
123
  }
124
124
 
125
+ """How a NUMBER grant of an add-on combines with the licence's own."""
126
+ enum AddonOverrideBehavior {
127
+ ADD
128
+ OVERRIDE
129
+ MAX
130
+ }
131
+
132
+ """
133
+ An entitlement an add-on version grants, on a licence it fits: one way an
134
+ instance of that licence can come to hold the entitlement without the licence
135
+ granting it.
136
+
137
+ An add-on attaches to an instance, never to a licence. What ties it to a
138
+ licence is compatibility, declared per add-on version against a licence
139
+ FAMILY: the grants are therefore the same for every version of a family.
140
+ Nothing here says an instance holds the add-on; Instance.addons does.
141
+ """
142
+ type LicenseAddonGrant {
143
+ entitlementSlug: String!
144
+ entitlementType: String!
145
+ addonId: UUID!
146
+ """The add-on version: what an attachment names."""
147
+ addonSlug: String!
148
+ addonFamilySlug: String!
149
+ addonName: String!
150
+ """The version number in its add-on family."""
151
+ addonVersion: Int!
152
+ """
153
+ DRAFT: attachable to an instance with no live subscription only. PUBLISHED:
154
+ attachable. ARCHIVED: no new attachment, the instances that hold it keep it
155
+ and its grant.
156
+ """
157
+ lifecycleState: AddonLifecycleState!
158
+ """The version its add-on family resolves to. Only a PUBLISHED version."""
159
+ isDefault: Boolean!
160
+ """The most one instance may hold; null when unbounded."""
161
+ maxQuantity: Int
162
+ """
163
+ The grant per unit of quantity, shaped like a licence grant:
164
+ {type:"number",value:N}, {type:"boolean",value:B}, {type:"object",value:{...}}.
165
+ """
166
+ value: Map!
167
+ """True when the value is the unlimited sentinel."""
168
+ unlimited: Boolean!
169
+ """
170
+ The overage the add-on allows; null inherits the licence grant's (0 for an
171
+ entitlement only add-ons grant).
172
+ """
173
+ limitCapExceededOveragePercent: Int
174
+ """
175
+ How a number grant combines with the licence's: ADD sums value x quantity,
176
+ OVERRIDE replaces it with the latest attached add-on's, MAX keeps the larger.
177
+ A boolean always ORs, a config always overrides.
178
+ """
179
+ overrideBehavior: AddonOverrideBehavior!
180
+ }
181
+
182
+ extend type License {
183
+ """
184
+ What add-ons can grant on this licence: every entitlement of every add-on
185
+ version compatible with the licence's family, optionally one entitlement.
186
+ The licence's own grants are License.entitlements. Like the REST add-on
187
+ catalogue, it needs billing to be enabled for the organization, and
188
+ read:addons.
189
+ """
190
+ addonGrants(entitlementSlug: String): [LicenseAddonGrant!]!
191
+ }
192
+
125
193
  """
126
194
  A cursor-paginated page of add-on versions.
127
195
  """
@@ -805,6 +873,63 @@ extend type Query {
805
873
  instance(id: UUID, slug: String): Instance
806
874
  }
807
875
 
876
+ enum ConversionRuleStatus {
877
+ ACTIVE
878
+ ARCHIVED
879
+ }
880
+ enum AiRequestType {
881
+ COMPLETION
882
+ EMBEDDING
883
+ IMAGE_GENERATION
884
+ AUDIO
885
+ VIDEO
886
+ }
887
+ enum ChargeOnErrorPolicy {
888
+ NEVER
889
+ ALWAYS
890
+ PROVIDER_ERROR_ONLY
891
+ }
892
+ type ConversionRates {
893
+ perRequest: String
894
+ perInputToken: String
895
+ perCachedInputToken: String
896
+ perCacheWriteToken: String
897
+ perOutputToken: String
898
+ perUnit: String
899
+ perSecond: String
900
+ }
901
+ """An immutable license/pool/model/request identity with mutable exact pricing."""
902
+ type ConversionRule {
903
+ id: UUID!
904
+ licenseSlug: String!
905
+ entitlementSlug: String!
906
+ modelSlug: String
907
+ requestType: AiRequestType
908
+ rates: ConversionRates!
909
+ minimumCreditsPerRequest: String!
910
+ maximumCreditsPerRequest: String
911
+ chargeOnError: ChargeOnErrorPolicy!
912
+ status: ConversionRuleStatus!
913
+ """Whether the licence itself grants the pool."""
914
+ grantedByLicense: Boolean!
915
+ """
916
+ Whether an add-on version compatible with the licence's family grants the
917
+ pool, whatever its lifecycle state: instances of the licence can then hold
918
+ the pool without the licence granting it. License.addonGrants lists them.
919
+ """
920
+ grantedByAddons: Boolean!
921
+ createdAt: Time!
922
+ """Who created the rule. A service account is a user."""
923
+ createdBy: User!
924
+ updatedAt: Time!
925
+ """Who last changed the rule: its pricing, or its archival."""
926
+ updatedBy: User!
927
+ }
928
+ extend type License {
929
+ """All rules when status is omitted; an explicit status filters that relation."""
930
+ conversionRules(status: ConversionRuleStatus): [ConversionRule!]!
931
+ }
932
+
808
933
  """
809
934
  License type enumeration
810
935
  """
@@ -849,6 +974,15 @@ type LicenseFamily {
849
974
  trialEndWithoutPaymentMethod: TrialEndWithoutPaymentMethod!
850
975
  """How many days before a trial's end trial_will_end fires (1 to 30)."""
851
976
  trialReminderDays: Int!
977
+ """
978
+ The version this family currently serves: its default version, or its
979
+ highest-numbered PUBLISHED version. Null when every version is a draft or has
980
+ been archived. The same resolution as LicenseFamilyView.currentVersion, read
981
+ here so that a list of licenses can label each family (a family has no name
982
+ of its own: it is shown under its current version's) without one
983
+ licenseFamily query per family.
984
+ """
985
+ currentVersion: License
852
986
  }
853
987
 
854
988
  """How a licence or add-on version is sold."""
@@ -927,6 +1061,11 @@ type License {
927
1061
  description: String!
928
1062
  type: LicenseType!
929
1063
  version: String!
1064
+ """
1065
+ version as a number: the order of the versions in their family, 1 being the
1066
+ first. Assigned by the server and never reused within a family.
1067
+ """
1068
+ versionNumber: Int!
930
1069
  versionName: String
931
1070
  isDefault: Boolean!
932
1071
 
@@ -1156,6 +1295,42 @@ extend type Query {
1156
1295
  ): MetadataFieldPage!
1157
1296
  }
1158
1297
 
1298
+ enum ModelModality {
1299
+ TEXT
1300
+ IMAGE
1301
+ AUDIO
1302
+ VIDEO
1303
+ EMBEDDING
1304
+ MULTIMODAL
1305
+ }
1306
+
1307
+ enum ModelStatus {
1308
+ ACTIVE
1309
+ DEPRECATED
1310
+ ARCHIVED
1311
+ }
1312
+
1313
+ """
1314
+ An organization-scoped model catalogue entry. Vendor costs are intentionally
1315
+ REST-only under read:models. Deprecated models keep existing pricing; archived
1316
+ models remain in the catalogue but authorize no usage.
1317
+ """
1318
+ type Model {
1319
+ id: UUID!
1320
+ name: String!
1321
+ slug: String!
1322
+ vendor: String!
1323
+ modality: ModelModality!
1324
+ status: ModelStatus!
1325
+ externalIds: [String!]!
1326
+ metadata: Map
1327
+ }
1328
+
1329
+ extend type Query {
1330
+ """All catalogue models in the current organization, optionally filtered by status."""
1331
+ models(status: ModelStatus): [Model!]!
1332
+ }
1333
+
1159
1334
  """
1160
1335
  Release represents a software release with its components. A release is
1161
1336
  immutable: it is created with its component list and can only be deleted