Skip to content

Commit a96785b

Browse files
Update api spec (#325)
* YOYO NEW API SPEC! * Generated new lib * 2.0.34 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 0b3226e commit a96785b

File tree

6 files changed

+114
-61
lines changed

6 files changed

+114
-61
lines changed

__tests__/gen/payments-update_payment_balance_for_any_org.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ async function example() {
44
const response = await payments.update_payment_balance_for_any_org({
55
id: '00000000-0000-0000-0000-000000000000',
66
body: {
7-
monthly_credits_remaining: 7,
8-
pre_pay_cash_remaining: 7,
9-
pre_pay_credits_remaining: 7,
7+
monthly_api_credits_remaining_monetary_value: 7,
8+
stable_api_credits_remaining_monetary_value: 7,
109
},
1110
});
1211
if ('error_code' in response) throw response;

__tests__/gen/payments-update_payment_balance_for_any_user.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ async function example() {
44
const response = await payments.update_payment_balance_for_any_user({
55
id: '31337',
66
body: {
7-
monthly_credits_remaining: 7,
8-
pre_pay_cash_remaining: 7,
9-
pre_pay_credits_remaining: 7,
7+
monthly_api_credits_remaining_monetary_value: 7,
8+
stable_api_credits_remaining_monetary_value: 7,
109
},
1110
});
1211
if ('error_code' in response) throw response;

kittycad.ts.patch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"op": "add",
2020
"path": "/paths/~1users~1{id}~1payment~1balance/put/x-typescript",
2121
"value": {
22-
"example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.update_payment_balance_for_any_user({\n id: '31337',\n body: {\n monthly_credits_remaining: 7,\n pre_pay_cash_remaining: 7,\n pre_pay_credits_remaining: 7,\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
22+
"example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.update_payment_balance_for_any_user({\n id: '31337',\n body: {\n monthly_api_credits_remaining_monetary_value: 7,\n stable_api_credits_remaining_monetary_value: 7,\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
2323
"libDocsLink": ""
2424
}
2525
},
@@ -491,7 +491,7 @@
491491
"op": "add",
492492
"path": "/paths/~1orgs~1{id}~1payment~1balance/put/x-typescript",
493493
"value": {
494-
"example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.update_payment_balance_for_any_org({\n id: '00000000-0000-0000-0000-000000000000',\n body: {\n monthly_credits_remaining: 7,\n pre_pay_cash_remaining: 7,\n pre_pay_credits_remaining: 7,\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
494+
"example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.update_payment_balance_for_any_org({\n id: '00000000-0000-0000-0000-000000000000',\n body: {\n monthly_api_credits_remaining_monetary_value: 7,\n stable_api_credits_remaining_monetary_value: 7,\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
495495
"libDocsLink": ""
496496
}
497497
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kittycad/lib",
3-
"version": "2.0.33",
3+
"version": "2.0.34",
44
"description": "Javascript library for KittyCAD API",
55
"type": "module",
66
"keywords": [

spec.json

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19874,21 +19874,27 @@
1987419874
}
1987519875
]
1987619876
},
19877-
"monthly_credits_remaining": {
19878-
"title": "double",
19879-
"description": "The monthy credits remaining in the balance. This gets re-upped every month, but if the credits are not used for a month they do not carry over to the next month. It is a stable amount granted to the customer per month.",
19880-
"type": "number",
19881-
"format": "money-usd"
19877+
"monthly_api_credits_remaining": {
19878+
"description": "The number of monthly API credits remaining in the balance. This is the number of credits remaining in the balance.\n\nBoth the monetary value and the number of credits are returned, but they reflect the same value in the database.",
19879+
"type": "integer",
19880+
"format": "uint64",
19881+
"minimum": 0
1988219882
},
19883-
"pre_pay_cash_remaining": {
19883+
"monthly_api_credits_remaining_monetary_value": {
1988419884
"title": "double",
19885-
"description": "The amount of pre-pay cash remaining in the balance. This number goes down as the customer uses their pre-paid credits. The reason we track this amount is if a customer ever wants to withdraw their pre-pay cash, we can use this amount to determine how much to give them. Say a customer has $100 in pre-paid cash, their bill is worth, $50 after subtracting any other credits (like monthly etc.) Their bill is $50, their pre-pay cash remaining will be subtracted by 50 to pay the bill and their `pre_pay_credits_remaining` will be subtracted by 50 to pay the bill. This way if they want to withdraw money after, they can only withdraw $50 since that is the amount of cash they have remaining.",
19885+
"description": "The monetary value of the monthy API credits remaining in the balance. This gets re-upped every month, but if the credits are not used for a month they do not carry over to the next month.\n\nBoth the monetary value and the number of credits are returned, but they reflect the same value in the database.",
1988619886
"type": "number",
1988719887
"format": "money-usd"
1988819888
},
19889-
"pre_pay_credits_remaining": {
19889+
"stable_api_credits_remaining": {
19890+
"description": "The number of stable API credits remaining in the balance. These do not get reset or re-upped every month. This is separate from the monthly credits. Credits will first pull from the monthly credits, then the stable credits. Stable just means that they do not get reset every month. A user will have stable credits if a Zoo employee granted them credits.\n\nBoth the monetary value and the number of credits are returned, but they reflect the same value in the database.",
19891+
"type": "integer",
19892+
"format": "uint64",
19893+
"minimum": 0
19894+
},
19895+
"stable_api_credits_remaining_monetary_value": {
1989019896
"title": "double",
19891-
"description": "The amount of credits remaining in the balance. This is typically the amount of cash * some multiplier they get for pre-paying their account. This number lowers every time a bill is paid with the balance. This number increases every time a customer adds funds to their balance. This may be through a subscription or a one off payment.",
19897+
"description": "The monetary value of stable API credits remaining in the balance. These do not get reset or re-upped every month. This is separate from the monthly credits. Credits will first pull from the monthly credits, then the stable credits. Stable just means that they do not get reset every month. A user will have stable credits if a Zoo employee granted them credits.\n\nBoth the monetary value and the number of credits are returned, but they reflect the same value in the database.",
1989219898
"type": "number",
1989319899
"format": "money-usd"
1989419900
},
@@ -19923,9 +19929,10 @@
1992319929
"created_at",
1992419930
"id",
1992519931
"map_id",
19926-
"monthly_credits_remaining",
19927-
"pre_pay_cash_remaining",
19928-
"pre_pay_credits_remaining",
19932+
"monthly_api_credits_remaining",
19933+
"monthly_api_credits_remaining_monetary_value",
19934+
"stable_api_credits_remaining",
19935+
"stable_api_credits_remaining_monetary_value",
1992919936
"total_due",
1993019937
"updated_at"
1993119938
]
@@ -23745,6 +23752,19 @@
2374523752
"minItems": 0,
2374623753
"maxItems": 15
2374723754
},
23755+
"monthly_pay_as_you_go_api_credits": {
23756+
"description": "The amount of pay-as-you-go API credits the individual or org gets outside the modeling app per month. This re-ups on the 1st of each month. This is equivalent to the monetary value divided by the price of an API credit.",
23757+
"default": 0,
23758+
"type": "integer",
23759+
"format": "uint64",
23760+
"minimum": 0
23761+
},
23762+
"monthly_pay_as_you_go_api_credits_monetary_value": {
23763+
"title": "double",
23764+
"description": "The monetary value of pay-as-you-go API credits the individual or org gets outside the modeling app per month. This re-ups on the 1st of each month.",
23765+
"type": "number",
23766+
"format": "money-usd"
23767+
},
2374823768
"name": {
2374923769
"description": "The name of the tier.",
2375023770
"allOf": [
@@ -23753,9 +23773,10 @@
2375323773
}
2375423774
]
2375523775
},
23756-
"pay_as_you_go_credits": {
23776+
"pay_as_you_go_api_credit_price": {
2375723777
"title": "double",
23758-
"description": "The amount of pay-as-you-go credits the individual or org gets outside the modeling app.",
23778+
"description": "The price of an API credit (meaning 1 credit = 1 minute of API usage).",
23779+
"default": 0.0,
2375923780
"type": "number",
2376023781
"format": "money-usd"
2376123782
},
@@ -23808,8 +23829,8 @@
2380823829
},
2380923830
"required": [
2381023831
"description",
23832+
"monthly_pay_as_you_go_api_credits_monetary_value",
2381123833
"name",
23812-
"pay_as_you_go_credits",
2381323834
"price",
2381423835
"support_tier",
2381523836
"training_data_behavior",
@@ -35762,24 +35783,17 @@
3576235783
"description": "The data for updating a balance.",
3576335784
"type": "object",
3576435785
"properties": {
35765-
"monthly_credits_remaining": {
35766-
"nullable": true,
35767-
"title": "double",
35768-
"description": "The monthy credits remaining in the balance. This gets re-upped every month, but if the credits are not used for a month they do not carry over to the next month. It is a stable amount granted to the user per month.",
35769-
"type": "number",
35770-
"format": "money-usd"
35771-
},
35772-
"pre_pay_cash_remaining": {
35786+
"monthly_api_credits_remaining_monetary_value": {
3577335787
"nullable": true,
3577435788
"title": "double",
35775-
"description": "The amount of pre-pay cash remaining in the balance. This number goes down as the user uses their pre-paid credits. The reason we track this amount is if a user ever wants to withdraw their pre-pay cash, we can use this amount to determine how much to give them. Say a user has $100 in pre-paid cash, their bill is worth, $50 after subtracting any other credits (like monthly etc.) Their bill is $50, their pre-pay cash remaining will be subtracted by 50 to pay the bill and their `pre_pay_credits_remaining` will be subtracted by 50 to pay the bill. This way if they want to withdraw money after, they can only withdraw $50 since that is the amount of cash they have remaining.",
35789+
"description": "The monetary value of the monthy API credits remaining in the balance. This gets re-upped every month,",
3577635790
"type": "number",
3577735791
"format": "money-usd"
3577835792
},
35779-
"pre_pay_credits_remaining": {
35793+
"stable_api_credits_remaining_monetary_value": {
3578035794
"nullable": true,
3578135795
"title": "double",
35782-
"description": "The amount of credits remaining in the balance. This is typically the amount of cash * some multiplier they get for pre-paying their account. This number lowers every time a bill is paid with the balance. This number increases every time a user adds funds to their balance. This may be through a subscription or a one off payment.",
35796+
"description": "The monetary value of stable API credits remaining in the balance. These do not get reset or re-upped every month. This is separate from the monthly credits. Credits will first pull from the monthly credits, then the stable credits. Stable just means that they do not get reset every month. A user will have stable credits if a Zoo employee granted them credits.",
3578335797
"type": "number",
3578435798
"format": "money-usd"
3578535799
}
@@ -36444,6 +36458,19 @@
3644436458
"minItems": 0,
3644536459
"maxItems": 15
3644636460
},
36461+
"monthly_pay_as_you_go_api_credits": {
36462+
"description": "The amount of pay-as-you-go API credits the individual or org gets outside the modeling app per month. This re-ups on the 1st of each month. This is equivalent to the monetary value divided by the price of an API credit.",
36463+
"default": 0,
36464+
"type": "integer",
36465+
"format": "uint64",
36466+
"minimum": 0
36467+
},
36468+
"monthly_pay_as_you_go_api_credits_monetary_value": {
36469+
"title": "double",
36470+
"description": "The monetary value of pay-as-you-go API credits the individual or org gets outside the modeling app per month. This re-ups on the 1st of each month.",
36471+
"type": "number",
36472+
"format": "money-usd"
36473+
},
3644736474
"name": {
3644836475
"description": "The name of the tier.",
3644936476
"allOf": [
@@ -36452,9 +36479,10 @@
3645236479
}
3645336480
]
3645436481
},
36455-
"pay_as_you_go_credits": {
36482+
"pay_as_you_go_api_credit_price": {
3645636483
"title": "double",
36457-
"description": "The amount of pay-as-you-go credits the individual or org gets outside the modeling app.",
36484+
"description": "The price of an API credit (meaning 1 credit = 1 minute of API usage).",
36485+
"default": 0.0,
3645836486
"type": "number",
3645936487
"format": "money-usd"
3646036488
},
@@ -36507,8 +36535,8 @@
3650736535
},
3650836536
"required": [
3650936537
"description",
36538+
"monthly_pay_as_you_go_api_credits_monetary_value",
3651036539
"name",
36511-
"pay_as_you_go_credits",
3651236540
"price",
3651336541
"support_tier",
3651436542
"training_data_behavior",

0 commit comments

Comments
 (0)