@kaitencloud/graphql-schema 2.2.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 +93 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaitencloud/graphql-schema",
3
- "version": "2.2.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
  """
@@ -842,9 +910,20 @@ type ConversionRule {
842
910
  maximumCreditsPerRequest: String
843
911
  chargeOnError: ChargeOnErrorPolicy!
844
912
  status: ConversionRuleStatus!
913
+ """Whether the licence itself grants the pool."""
845
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!
846
921
  createdAt: Time!
922
+ """Who created the rule. A service account is a user."""
923
+ createdBy: User!
847
924
  updatedAt: Time!
925
+ """Who last changed the rule: its pricing, or its archival."""
926
+ updatedBy: User!
848
927
  }
849
928
  extend type License {
850
929
  """All rules when status is omitted; an explicit status filters that relation."""
@@ -895,6 +974,15 @@ type LicenseFamily {
895
974
  trialEndWithoutPaymentMethod: TrialEndWithoutPaymentMethod!
896
975
  """How many days before a trial's end trial_will_end fires (1 to 30)."""
897
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
898
986
  }
899
987
 
900
988
  """How a licence or add-on version is sold."""
@@ -973,6 +1061,11 @@ type License {
973
1061
  description: String!
974
1062
  type: LicenseType!
975
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!
976
1069
  versionName: String
977
1070
  isDefault: Boolean!
978
1071