@stigg/typescript-mcp 0.1.0-beta.35 → 0.1.0-beta.36

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.
@@ -3059,6 +3059,110 @@ const EMBEDDED_METHODS = [
3059
3059
  },
3060
3060
  },
3061
3061
  },
3062
+ {
3063
+ name: 'consume',
3064
+ endpoint: '/api/v1/credits/consumption',
3065
+ httpMethod: 'post',
3066
+ summary: 'Consume credits',
3067
+ description: 'Consumes a specified amount of credits directly from a customer wallet, with no feature mapping. Returns the optimistic balance.',
3068
+ stainlessPath: '(resource) v1.credits.consumption > (method) consume',
3069
+ qualified: 'client.v1.credits.consumption.consume',
3070
+ params: [
3071
+ 'amount: number;',
3072
+ 'currencyId: string;',
3073
+ 'customerId: string;',
3074
+ 'idempotencyKey: string;',
3075
+ 'createdAt?: string;',
3076
+ 'dimensions?: object;',
3077
+ 'resourceId?: string;',
3078
+ 'X-ACCOUNT-ID?: string;',
3079
+ 'X-ENVIRONMENT-ID?: string;',
3080
+ ],
3081
+ response: '{ data: { amount: number; currencyId: string; customerId: string; timestamp: string; credit?: { currencyId: string; currentUsage: number; timestamp: string; usageLimit: number; usagePeriodEnd?: string; }; resourceId?: string; }; }',
3082
+ markdown: "## consume\n\n`client.v1.credits.consumption.consume(amount: number, currencyId: string, customerId: string, idempotencyKey: string, createdAt?: string, dimensions?: object, resourceId?: string, X-ACCOUNT-ID?: string, X-ENVIRONMENT-ID?: string): { data: object; }`\n\n**post** `/api/v1/credits/consumption`\n\nConsumes a specified amount of credits directly from a customer wallet, with no feature mapping. Returns the optimistic balance.\n\n### Parameters\n\n- `amount: number`\n The amount of credits to consume\n\n- `currencyId: string`\n The credit currency to consume from (required)\n\n- `customerId: string`\n The customer to consume credits from (required)\n\n- `idempotencyKey: string`\n A unique key used to deduplicate the consumption (required)\n\n- `createdAt?: string`\n Optional timestamp the consumption is attributed to\n\n- `dimensions?: object`\n Optional dimensions describing the consumption\n\n- `resourceId?: string`\n Optional resource the consumption is attributed to\n\n- `X-ACCOUNT-ID?: string`\n\n- `X-ENVIRONMENT-ID?: string`\n\n### Returns\n\n- `{ data: { amount: number; currencyId: string; customerId: string; timestamp: string; credit?: { currencyId: string; currentUsage: number; timestamp: string; usageLimit: number; usagePeriodEnd?: string; }; resourceId?: string; }; }`\n Response object\n\n - `data: { amount: number; currencyId: string; customerId: string; timestamp: string; credit?: { currencyId: string; currentUsage: number; timestamp: string; usageLimit: number; usagePeriodEnd?: string; }; resourceId?: string; }`\n\n### Example\n\n```typescript\nimport Stigg from '@stigg/typescript';\n\nconst client = new Stigg();\n\nconst response = await client.v1.credits.consumption.consume({\n amount: 1,\n currencyId: 'currencyId',\n customerId: 'customerId',\n idempotencyKey: 'x',\n});\n\nconsole.log(response);\n```",
3083
+ perLanguage: {
3084
+ typescript: {
3085
+ method: 'client.v1.credits.consumption.consume',
3086
+ example: "import Stigg from '@stigg/typescript';\n\nconst client = new Stigg({\n apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.credits.consumption.consume({\n amount: 1,\n currencyId: 'currencyId',\n customerId: 'customerId',\n idempotencyKey: 'x',\n});\n\nconsole.log(response.data);",
3087
+ },
3088
+ python: {
3089
+ method: 'v1.credits.consumption.consume',
3090
+ example: 'import os\nfrom stigg import Stigg\n\nclient = Stigg(\n api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.credits.consumption.consume(\n amount=1,\n currency_id="currencyId",\n customer_id="customerId",\n idempotency_key="x",\n)\nprint(response.data)',
3091
+ },
3092
+ java: {
3093
+ method: 'v1().credits().consumption().consume',
3094
+ example: 'package io.stigg.example;\n\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.models.v1.credits.consumption.ConsumptionConsumeParams;\nimport io.stigg.models.v1.credits.consumption.ConsumptionConsumeResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n StiggClient client = StiggOkHttpClient.fromEnv();\n\n ConsumptionConsumeParams params = ConsumptionConsumeParams.builder()\n .amount(1.0)\n .currencyId("currencyId")\n .customerId("customerId")\n .idempotencyKey("x")\n .build();\n ConsumptionConsumeResponse response = client.v1().credits().consumption().consume(params);\n }\n}',
3095
+ },
3096
+ go: {
3097
+ method: 'client.V1.Credits.Consumption.Consume',
3098
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stiggio/stigg-go"\n\t"github.com/stiggio/stigg-go/option"\n)\n\nfunc main() {\n\tclient := stigg.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Credits.Consumption.Consume(context.TODO(), stigg.V1CreditConsumptionConsumeParams{\n\t\tAmount: 1,\n\t\tCurrencyID: "currencyId",\n\t\tCustomerID: "customerId",\n\t\tIdempotencyKey: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n',
3099
+ },
3100
+ ruby: {
3101
+ method: 'v1.credits.consumption.consume',
3102
+ example: 'require "stigg"\n\nstigg = Stigg::Client.new(api_key: "My API Key")\n\nresponse = stigg.v1.credits.consumption.consume(\n amount: 1,\n currency_id: "currencyId",\n customer_id: "customerId",\n idempotency_key: "x"\n)\n\nputs(response)',
3103
+ },
3104
+ cli: {
3105
+ method: 'consumption consume',
3106
+ example: "stigg v1:credits:consumption consume \\\n --api-key 'My API Key' \\\n --amount 1 \\\n --currency-id currencyId \\\n --customer-id customerId \\\n --idempotency-key x",
3107
+ },
3108
+ csharp: {
3109
+ method: 'V1.Credits.Consumption.Consume',
3110
+ example: 'ConsumptionConsumeParams parameters = new()\n{\n Amount = 1,\n CurrencyID = "currencyId",\n CustomerID = "customerId",\n IdempotencyKey = "x",\n};\n\nvar response = await client.V1.Credits.Consumption.Consume(parameters);\n\nConsole.WriteLine(response);',
3111
+ },
3112
+ http: {
3113
+ example: 'curl https://api.stigg.io/api/v1/credits/consumption \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "amount": 1,\n "currencyId": "currencyId",\n "customerId": "customerId",\n "idempotencyKey": "x"\n }\'',
3114
+ },
3115
+ },
3116
+ },
3117
+ {
3118
+ name: 'consume_async',
3119
+ endpoint: '/api/v1/credits/consumption/async',
3120
+ httpMethod: 'post',
3121
+ summary: 'Consume credits asynchronously',
3122
+ description: 'Consumes credits directly from customer wallets asynchronously. Consumptions are reconciled asynchronously into the credit balances.',
3123
+ stainlessPath: '(resource) v1.credits.consumption > (method) consume_async',
3124
+ qualified: 'client.v1.credits.consumption.consumeAsync',
3125
+ params: [
3126
+ 'consumptions: { amount: number; currencyId: string; customerId: string; idempotencyKey: string; createdAt?: string; dimensions?: object; resourceId?: string; }[];',
3127
+ 'X-ACCOUNT-ID?: string;',
3128
+ 'X-ENVIRONMENT-ID?: string;',
3129
+ ],
3130
+ response: '{ data: object; }',
3131
+ markdown: "## consume_async\n\n`client.v1.credits.consumption.consumeAsync(consumptions: { amount: number; currencyId: string; customerId: string; idempotencyKey: string; createdAt?: string; dimensions?: object; resourceId?: string; }[], X-ACCOUNT-ID?: string, X-ENVIRONMENT-ID?: string): { data: object; }`\n\n**post** `/api/v1/credits/consumption/async`\n\nConsumes credits directly from customer wallets asynchronously. Consumptions are reconciled asynchronously into the credit balances.\n\n### Parameters\n\n- `consumptions: { amount: number; currencyId: string; customerId: string; idempotencyKey: string; createdAt?: string; dimensions?: object; resourceId?: string; }[]`\n The credit consumptions to report (up to 1000)\n\n- `X-ACCOUNT-ID?: string`\n\n- `X-ENVIRONMENT-ID?: string`\n\n### Returns\n\n- `{ data: object; }`\n Response object\n\n - `data: object`\n\n### Example\n\n```typescript\nimport Stigg from '@stigg/typescript';\n\nconst client = new Stigg();\n\nconst response = await client.v1.credits.consumption.consumeAsync({ consumptions: [{\n amount: 1,\n currencyId: 'currencyId',\n customerId: 'customerId',\n idempotencyKey: 'x',\n}] });\n\nconsole.log(response);\n```",
3132
+ perLanguage: {
3133
+ typescript: {
3134
+ method: 'client.v1.credits.consumption.consumeAsync',
3135
+ example: "import Stigg from '@stigg/typescript';\n\nconst client = new Stigg({\n apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.credits.consumption.consumeAsync({\n consumptions: [\n {\n amount: 1,\n currencyId: 'currencyId',\n customerId: 'customerId',\n idempotencyKey: 'x',\n },\n ],\n});\n\nconsole.log(response.data);",
3136
+ },
3137
+ python: {
3138
+ method: 'v1.credits.consumption.consume_async',
3139
+ example: 'import os\nfrom stigg import Stigg\n\nclient = Stigg(\n api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.v1.credits.consumption.consume_async(\n consumptions=[{\n "amount": 1,\n "currency_id": "currencyId",\n "customer_id": "customerId",\n "idempotency_key": "x",\n }],\n)\nprint(response.data)',
3140
+ },
3141
+ java: {
3142
+ method: 'v1().credits().consumption().consumeAsync',
3143
+ example: 'package io.stigg.example;\n\nimport io.stigg.client.StiggClient;\nimport io.stigg.client.okhttp.StiggOkHttpClient;\nimport io.stigg.models.v1.credits.consumption.ConsumptionConsumeAsyncParams;\nimport io.stigg.models.v1.credits.consumption.ConsumptionConsumeAsyncResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n StiggClient client = StiggOkHttpClient.fromEnv();\n\n ConsumptionConsumeAsyncParams params = ConsumptionConsumeAsyncParams.builder()\n .addConsumption(ConsumptionConsumeAsyncParams.Consumption.builder()\n .amount(1.0)\n .currencyId("currencyId")\n .customerId("customerId")\n .idempotencyKey("x")\n .build())\n .build();\n ConsumptionConsumeAsyncResponse response = client.v1().credits().consumption().consumeAsync(params);\n }\n}',
3144
+ },
3145
+ go: {
3146
+ method: 'client.V1.Credits.Consumption.ConsumeAsync',
3147
+ example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stiggio/stigg-go"\n\t"github.com/stiggio/stigg-go/option"\n)\n\nfunc main() {\n\tclient := stigg.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.V1.Credits.Consumption.ConsumeAsync(context.TODO(), stigg.V1CreditConsumptionConsumeAsyncParams{\n\t\tConsumptions: []stigg.V1CreditConsumptionConsumeAsyncParamsConsumption{{\n\t\t\tAmount: 1,\n\t\t\tCurrencyID: "currencyId",\n\t\t\tCustomerID: "customerId",\n\t\t\tIdempotencyKey: "x",\n\t\t}},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n',
3148
+ },
3149
+ ruby: {
3150
+ method: 'v1.credits.consumption.consume_async',
3151
+ example: 'require "stigg"\n\nstigg = Stigg::Client.new(api_key: "My API Key")\n\nresponse = stigg.v1.credits.consumption.consume_async(\n consumptions: [{amount: 1, currencyId: "currencyId", customerId: "customerId", idempotencyKey: "x"}]\n)\n\nputs(response)',
3152
+ },
3153
+ cli: {
3154
+ method: 'consumption consume_async',
3155
+ example: "stigg v1:credits:consumption consume-async \\\n --api-key 'My API Key' \\\n --consumption '{amount: 1, currencyId: currencyId, customerId: customerId, idempotencyKey: x}'",
3156
+ },
3157
+ csharp: {
3158
+ method: 'V1.Credits.Consumption.ConsumeAsync',
3159
+ example: 'ConsumptionConsumeAsyncParams parameters = new()\n{\n Consumptions =\n [\n new()\n {\n Amount = 1,\n CurrencyID = "currencyId",\n CustomerID = "customerId",\n IdempotencyKey = "x",\n CreatedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"),\n Dimensions = new Dictionary<string, Dimension>()\n {\n { "foo", "string" }\n },\n ResourceID = "resourceId",\n },\n ],\n};\n\nvar response = await client.V1.Credits.Consumption.ConsumeAsync(parameters);\n\nConsole.WriteLine(response);',
3160
+ },
3161
+ http: {
3162
+ example: 'curl https://api.stigg.io/api/v1/credits/consumption/async \\\n -H \'Content-Type: application/json\' \\\n -H "X-API-KEY: $STIGG_API_KEY" \\\n -d \'{\n "consumptions": [\n {\n "amount": 1,\n "currencyId": "currencyId",\n "customerId": "customerId",\n "idempotencyKey": "x"\n }\n ]\n }\'',
3163
+ },
3164
+ },
3165
+ },
3062
3166
  {
3063
3167
  name: 'retrieve_feature',
3064
3168
  endpoint: '/api/v1/features/{id}',