Skip to content

Commit d14ae14

Browse files
authored
fix(api): customerIdOrKey entitlement param type (#3093)
1 parent 1670e68 commit d14ae14

File tree

7 files changed

+1168
-1167
lines changed

7 files changed

+1168
-1167
lines changed

api/api.gen.go

Lines changed: 630 additions & 630 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/client/go/client.gen.go

Lines changed: 502 additions & 502 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/client/javascript/src/client/schemas.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15181,7 +15181,7 @@ export interface operations {
1518115181
query?: never
1518215182
header?: never
1518315183
path: {
15184-
customerIdOrKey: string
15184+
customerIdOrKey: components['schemas']['ULIDOrExternalKey']
1518515185
}
1518615186
cookie?: never
1518715187
}
@@ -15573,7 +15573,7 @@ export interface operations {
1557315573
}
1557415574
header?: never
1557515575
path: {
15576-
customerIdOrKey: string
15576+
customerIdOrKey: components['schemas']['ULIDOrExternalKey']
1557715577
featureKey: string
1557815578
}
1557915579
cookie?: never

api/client/javascript/src/zod/index.ts

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6966,18 +6966,25 @@ export const deleteCustomerParams = zod.object({
69666966
* Get the overall access of a customer.
69676967
* @summary Get customer access
69686968
*/
6969-
export const getCustomerAccessPathCustomerIdOrKeyMax = 64
6970-
6971-
export const getCustomerAccessPathCustomerIdOrKeyRegExp = new RegExp(
6972-
'^[a-z0-9]+(?:_[a-z0-9]+)*$|^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$'
6969+
export const getCustomerAccessPathCustomerIdOrKeyRegExpOne = new RegExp(
6970+
'^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$'
69736971
)
6972+
export const getCustomerAccessPathCustomerIdOrKeyMaxTwo = 256
69746973

69756974
export const getCustomerAccessParams = zod.object({
69766975
customerIdOrKey: zod.coerce
69776976
.string()
6978-
.min(1)
6979-
.max(getCustomerAccessPathCustomerIdOrKeyMax)
6980-
.regex(getCustomerAccessPathCustomerIdOrKeyRegExp),
6977+
.regex(getCustomerAccessPathCustomerIdOrKeyRegExpOne)
6978+
.describe(
6979+
'ULID (Universally Unique Lexicographically Sortable Identifier).'
6980+
)
6981+
.or(
6982+
zod.coerce
6983+
.string()
6984+
.min(1)
6985+
.max(getCustomerAccessPathCustomerIdOrKeyMaxTwo)
6986+
.describe('ExternalKey is a looser version of key.')
6987+
),
69816988
})
69826989

69836990
/**
@@ -7415,11 +7422,9 @@ export const deleteCustomerAppDataParams = zod.object({
74157422
* Checks customer access to a given feature (by key). All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type.
74167423
* @summary Get customer entitlement value
74177424
*/
7418-
export const getCustomerEntitlementValuePathCustomerIdOrKeyMax = 64
7419-
7420-
export const getCustomerEntitlementValuePathCustomerIdOrKeyRegExp = new RegExp(
7421-
'^[a-z0-9]+(?:_[a-z0-9]+)*$|^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$'
7422-
)
7425+
export const getCustomerEntitlementValuePathCustomerIdOrKeyRegExpOne =
7426+
new RegExp('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$')
7427+
export const getCustomerEntitlementValuePathCustomerIdOrKeyMaxTwo = 256
74237428
export const getCustomerEntitlementValuePathFeatureKeyMax = 64
74247429

74257430
export const getCustomerEntitlementValuePathFeatureKeyRegExp = new RegExp(
@@ -7429,9 +7434,17 @@ export const getCustomerEntitlementValuePathFeatureKeyRegExp = new RegExp(
74297434
export const getCustomerEntitlementValueParams = zod.object({
74307435
customerIdOrKey: zod.coerce
74317436
.string()
7432-
.min(1)
7433-
.max(getCustomerEntitlementValuePathCustomerIdOrKeyMax)
7434-
.regex(getCustomerEntitlementValuePathCustomerIdOrKeyRegExp),
7437+
.regex(getCustomerEntitlementValuePathCustomerIdOrKeyRegExpOne)
7438+
.describe(
7439+
'ULID (Universally Unique Lexicographically Sortable Identifier).'
7440+
)
7441+
.or(
7442+
zod.coerce
7443+
.string()
7444+
.min(1)
7445+
.max(getCustomerEntitlementValuePathCustomerIdOrKeyMaxTwo)
7446+
.describe('ExternalKey is a looser version of key.')
7447+
),
74357448
featureKey: zod.coerce
74367449
.string()
74377450
.min(1)

api/openapi.cloud.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3247,10 +3247,7 @@ paths:
32473247
in: path
32483248
required: true
32493249
schema:
3250-
type: string
3251-
minLength: 1
3252-
maxLength: 64
3253-
pattern: ^[a-z0-9]+(?:_[a-z0-9]+)*$|^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
3250+
$ref: '#/components/schemas/ULIDOrExternalKey'
32543251
responses:
32553252
'200':
32563253
description: The request has succeeded.
@@ -3538,10 +3535,7 @@ paths:
35383535
in: path
35393536
required: true
35403537
schema:
3541-
type: string
3542-
minLength: 1
3543-
maxLength: 64
3544-
pattern: ^[a-z0-9]+(?:_[a-z0-9]+)*$|^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
3538+
$ref: '#/components/schemas/ULIDOrExternalKey'
35453539
- name: featureKey
35463540
in: path
35473541
required: true

api/openapi.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3246,10 +3246,7 @@ paths:
32463246
in: path
32473247
required: true
32483248
schema:
3249-
type: string
3250-
minLength: 1
3251-
maxLength: 64
3252-
pattern: ^[a-z0-9]+(?:_[a-z0-9]+)*$|^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
3249+
$ref: '#/components/schemas/ULIDOrExternalKey'
32533250
responses:
32543251
'200':
32553252
description: The request has succeeded.
@@ -3537,10 +3534,7 @@ paths:
35373534
in: path
35383535
required: true
35393536
schema:
3540-
type: string
3541-
minLength: 1
3542-
maxLength: 64
3543-
pattern: ^[a-z0-9]+(?:_[a-z0-9]+)*$|^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
3537+
$ref: '#/components/schemas/ULIDOrExternalKey'
35443538
- name: featureKey
35453539
in: path
35463540
required: true

api/spec/src/entitlements/customer.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface Customer {
1919
@route("/entitlements/{featureKey}/value")
2020
@summary("Get customer entitlement value")
2121
getCustomerEntitlementValue(
22-
@path customerIdOrKey: ULIDOrKey,
22+
@path customerIdOrKey: ULIDOrExternalKey,
2323
@path featureKey: Key,
2424
@query(#{ explode: true }) time?: DateTime,
2525
): EntitlementValue | OpenMeter.CommonErrors | OpenMeter.NotFoundError;
@@ -32,7 +32,7 @@ interface Customer {
3232
@route("/access")
3333
@summary("Get customer access")
3434
getCustomerAccess(
35-
@path customerIdOrKey: ULIDOrKey,
35+
@path customerIdOrKey: ULIDOrExternalKey,
3636
): CustomerAccess | OpenMeter.CommonErrors | OpenMeter.NotFoundError;
3737
}
3838

0 commit comments

Comments
 (0)