@databricks/sdk-budgets 0.34.0 → 0.36.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.
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,iFAAiF;AACjF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,kBAAkB,EAAE,oBAAoB;IACxC;;;OAGG;IACH,WAAW,EAAE,aAAa;CAClB,CAAC;AAKX,4FAA4F;AAC5F,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,sBAAsB,EAAE,wBAAwB;CACxC,CAAC;AAKX,mDAAmD;AACnD,4FAA4F;AAC5F,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,wDAAwD;IACxD,qCAAqC,EACnC,uCAAuC;IACzC,0DAA0D;IAC1D,uCAAuC,EACrC,yCAAyC;CACnC,CAAC;AAKX,4FAA4F;AAC5F,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,KAAK,EAAE,OAAO;CACN,CAAC;AAKX,4FAA4F;AAC5F,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,4BAA4B,EAAE,8BAA8B;CACpD,CAAC;AAKX;;;GAGG;AACH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,2DAA2D;IAC3D,kCAAkC,EAAE,oCAAoC;IACxE,4DAA4D;IAC5D,qCAAqC,EACnC,uCAAuC;CACjC,CAAC;AAKX,4FAA4F;AAC5F,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,EAAE,EAAE,IAAI;CACA,CAAC;AA0MX,MAAM,CAAC,MAAM,kCAAkC,GAC7C,CAAC;KACE,MAAM,CAAC;IACN,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAA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,SAAS,EAAE,CAAC,CAAC,QAAQ;IACrB,MAAM,EAAE,CAAC,CAAC,MAAM;CACjB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"model.js","names":[],"sources":["../../src/v1/model.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {z} from 'zod';\n\n/** Type of action that a budget alert executes when its threshold is crossed. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const ActionConfigurationType = {\n EMAIL_NOTIFICATION: 'EMAIL_NOTIFICATION',\n /**\n * Blocks further usage when the alert threshold is reached. Supported only on\n * AI Gateway budgets. No `target` is required for this action type.\n */\n BLOCK_USAGE: 'BLOCK_USAGE',\n} as const;\nexport type ActionConfigurationType =\n | (typeof ActionConfigurationType)[keyof typeof ActionConfigurationType]\n | (string & {});\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const AlertConfigurationQuantityType = {\n LIST_PRICE_DOLLARS_USD: 'LIST_PRICE_DOLLARS_USD',\n} as const;\nexport type AlertConfigurationQuantityType =\n | (typeof AlertConfigurationQuantityType)[keyof typeof AlertConfigurationQuantityType]\n | (string & {});\n\n/** Evaluation scope for an alert configuration. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const AlertConfigurationScopeType = {\n /** Alert evaluates aggregate spend across all users. */\n ALERT_CONFIGURATION_SCOPE_TYPE_SHARED:\n 'ALERT_CONFIGURATION_SCOPE_TYPE_SHARED',\n /** Alert evaluates spend per individual user identity. */\n ALERT_CONFIGURATION_SCOPE_TYPE_PER_USER:\n 'ALERT_CONFIGURATION_SCOPE_TYPE_PER_USER',\n} as const;\nexport type AlertConfigurationScopeType =\n | (typeof AlertConfigurationScopeType)[keyof typeof AlertConfigurationScopeType]\n | (string & {});\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const AlertConfigurationTimePeriod = {\n MONTH: 'MONTH',\n} as const;\nexport type AlertConfigurationTimePeriod =\n | (typeof AlertConfigurationTimePeriod)[keyof typeof AlertConfigurationTimePeriod]\n | (string & {});\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const AlertConfigurationTriggerType = {\n CUMULATIVE_SPENDING_EXCEEDED: 'CUMULATIVE_SPENDING_EXCEEDED',\n} as const;\nexport type AlertConfigurationTriggerType =\n | (typeof AlertConfigurationTriggerType)[keyof typeof AlertConfigurationTriggerType]\n | (string & {});\n\n/**\n * Resource scope for a budget configuration. Determines whether the budget tracks all\n * resources or a specific resource.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const BudgetResourceType = {\n /** The budget applies to spending across all resources. */\n BUDGET_RESOURCE_TYPE_ALL_RESOURCES: 'BUDGET_RESOURCE_TYPE_ALL_RESOURCES',\n /** The budget applies only to Unity AI Gateway spending. */\n BUDGET_RESOURCE_TYPE_UNITY_AI_GATEWAY:\n 'BUDGET_RESOURCE_TYPE_UNITY_AI_GATEWAY',\n} as const;\nexport type BudgetResourceType =\n | (typeof BudgetResourceType)[keyof typeof BudgetResourceType]\n | (string & {});\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const BudgetConfigurationFilter_Operator = {\n IN: 'IN',\n} as const;\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.\nexport type BudgetConfigurationFilter_Operator =\n | (typeof BudgetConfigurationFilter_Operator)[keyof typeof BudgetConfigurationFilter_Operator]\n | (string & {});\n\nexport interface ActionConfiguration {\n /** <Databricks> action configuration ID. */\n actionConfigurationId?: string | undefined;\n /** The type of the action. */\n actionType?: ActionConfigurationType | undefined;\n /** Target for the action. For example, an email address. */\n target?: string | undefined;\n}\n\nexport interface AlertConfiguration {\n /** <Databricks> alert configuration ID. */\n alertConfigurationId?: string | undefined;\n /** The time window of usage data for the budget. */\n timePeriod?: AlertConfigurationTimePeriod | undefined;\n /** The evaluation method to determine when this budget alert is in a triggered state. */\n triggerType?: AlertConfigurationTriggerType | undefined;\n /** The way to calculate cost for this budget alert. This is what `quantity_threshold` is measured in. */\n quantityType?: AlertConfigurationQuantityType | undefined;\n /** The threshold for the budget alert to determine if it is in a triggered state. The number is evaluated based on `quantity_type`. */\n quantityThreshold?: string | undefined;\n /** Configured actions for this alert. These define what happens when an alert enters a triggered state. */\n actionConfigurations?: ActionConfiguration[] | undefined;\n /** How the alert threshold is evaluated. Determines whether spend is tracked in aggregate or per individual user. */\n scopeType?: AlertConfigurationScopeType | undefined;\n /** Per-principal threshold overrides for this alert. Only applies to per-user alerts (`scope_type` = `ALERT_CONFIGURATION_SCOPE_TYPE_PER_USER`); ignored for shared alerts. */\n principalOverrides?: PrincipalOverride[] | undefined;\n}\n\nexport interface BudgetConfiguration {\n /** <Databricks> budget configuration ID. */\n budgetConfigurationId?: string | undefined;\n /** <Databricks> account ID. */\n accountId?: string | undefined;\n /** Creation time of this budget configuration. */\n createTime?: bigint | undefined;\n /** Update time of this budget configuration. */\n updateTime?: bigint | undefined;\n /** Alerts to configure when this budget is in a triggered state. Budgets must have exactly one alert configuration. */\n alertConfigurations?: AlertConfiguration[] | undefined;\n /**\n * Configured filters for this budget. These are applied to your account's usage to limit the scope of what is considered for this budget.\n * Leave empty to include all usage for this account. All provided filters must be matched for usage to be included.\n */\n filter?: BudgetConfigurationFilter | undefined;\n /** Human-readable name of budget configuration. Max Length: 128 */\n displayName?: string | undefined;\n /** The resource scope for this budget. Determines whether the budget tracks all resources or a specific resource. */\n resourceType?: BudgetResourceType | undefined;\n}\n\nexport interface BudgetConfigurationFilter {\n /** If provided, usage must match with the provided <Databricks> workspace IDs. */\n workspaceId?: BudgetConfigurationFilter_WorkspaceIdClause | undefined;\n /**\n * A list of tag keys and values that will limit the budget to usage that includes those specific custom tags.\n * Tags are case-sensitive and should be entered exactly as they appear in your usage data.\n */\n tags?: BudgetConfigurationFilter_TagClause[] | undefined;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.\nexport interface BudgetConfigurationFilter_Clause {\n operator?: BudgetConfigurationFilter_Operator | undefined;\n values?: string[] | undefined;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.\nexport interface BudgetConfigurationFilter_TagClause {\n key?: string | undefined;\n value?: BudgetConfigurationFilter_Clause | undefined;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.\nexport interface BudgetConfigurationFilter_WorkspaceIdClause {\n operator?: BudgetConfigurationFilter_Operator | undefined;\n values?: bigint[] | undefined;\n}\n\nexport interface CreateBudgetConfigurationBudget {\n /** <Databricks> budget configuration ID. */\n budgetConfigurationId?: string | undefined;\n /** <Databricks> account ID. */\n accountId?: string | undefined;\n /** Creation time of this budget configuration. */\n createTime?: bigint | undefined;\n /** Update time of this budget configuration. */\n updateTime?: bigint | undefined;\n /** Alerts to configure when this budget is in a triggered state. Budgets must have exactly one alert configuration. */\n alertConfigurations?: AlertConfiguration[] | undefined;\n /**\n * Configured filters for this budget. These are applied to your account's usage to limit the scope of what is considered for this budget.\n * Leave empty to include all usage for this account. All provided filters must be matched for usage to be included.\n */\n filter?: BudgetConfigurationFilter | undefined;\n /** Human-readable name of budget configuration. Max Length: 128 */\n displayName?: string | undefined;\n /** The resource scope for this budget. Determines whether the budget tracks all resources or a specific resource. */\n resourceType?: BudgetResourceType | undefined;\n}\n\nexport interface CreateBudgetConfigurationRequest {\n /** Properties of the new budget configuration. */\n budget?: CreateBudgetConfigurationBudget | undefined;\n}\n\nexport interface CreateBudgetConfigurationResponse {\n /** The created budget configuration. */\n budget?: BudgetConfiguration | undefined;\n}\n\n/**\n * *\n * Delete budget\n */\nexport interface DeleteBudgetConfigurationRequest {\n /** The <Databricks> budget configuration ID. */\n budgetId?: string | undefined;\n /** <Databricks> account ID. */\n accountId?: string | undefined;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DeleteBudgetConfigurationResponse {}\n\nexport interface GetBudgetConfigurationRequest {\n /** The budget configuration ID */\n budgetId?: string | undefined;\n /** <Databricks> account ID. */\n accountId?: string | undefined;\n includeSpendStatus?: boolean | undefined;\n}\n\nexport interface GetBudgetConfigurationResponse {\n budget?: BudgetConfiguration | undefined;\n}\n\nexport interface ListBudgetConfigurationsRequest {\n /** <Databricks> account ID. */\n accountId?: string | undefined;\n /**\n * A page token received from a previous get all budget configurations call. This token can be used to retrieve the subsequent page.\n * Requests first page if absent.\n */\n pageToken?: string | undefined;\n includeSpendStatus?: boolean | undefined;\n includeWorkspaceBudgets?: boolean | undefined;\n}\n\nexport interface ListBudgetConfigurationsResponse {\n budgets?: BudgetConfiguration[] | undefined;\n /** Token which can be sent as `page_token` to retrieve the next page of results. If this field is omitted, there are no subsequent budgets. */\n nextPageToken?: string | undefined;\n}\n\n/** Per-principal threshold override on a PER_USER alert: bumps the alert's quantity_threshold for one principal_id. */\nexport interface PrincipalOverride {\n /** Account-level principal id (user, group, or service principal). */\n principalId?: bigint | undefined;\n /** Dollar amount that overrides the parent alert's quantity_threshold for this principal. */\n overrideThreshold?: string | undefined;\n}\n\nexport interface UpdateBudgetConfigurationBudget {\n /** <Databricks> budget configuration ID. */\n budgetConfigurationId?: string | undefined;\n /** <Databricks> account ID. */\n accountId?: string | undefined;\n /** Creation time of this budget configuration. */\n createTime?: bigint | undefined;\n /** Update time of this budget configuration. */\n updateTime?: bigint | undefined;\n /** Alerts to configure when this budget is in a triggered state. Budgets must have exactly one alert configuration. */\n alertConfigurations?: AlertConfiguration[] | undefined;\n /**\n * Configured filters for this budget. These are applied to your account's usage to limit the scope of what is considered for this budget.\n * Leave empty to include all usage for this account. All provided filters must be matched for usage to be included.\n */\n filter?: BudgetConfigurationFilter | undefined;\n /** Human-readable name of budget configuration. Max Length: 128 */\n displayName?: string | undefined;\n /** The resource scope for this budget. Determines whether the budget tracks all resources or a specific resource. */\n resourceType?: BudgetResourceType | undefined;\n}\n\nexport interface UpdateBudgetConfigurationRequest {\n /** The <Databricks> budget configuration ID. */\n budgetId?: string | undefined;\n /** The updated budget. This will overwrite the budget specified by the budget ID. */\n budget?: UpdateBudgetConfigurationBudget | undefined;\n}\n\nexport interface UpdateBudgetConfigurationResponse {\n /** The updated budget. */\n budget?: BudgetConfiguration | undefined;\n}\n\nexport const unmarshalActionConfigurationSchema: z.ZodType<ActionConfiguration> =\n z\n .object({\n action_configuration_id: z.string().optional(),\n action_type: z.string().optional(),\n target: z.string().optional(),\n })\n .transform(d => ({\n actionConfigurationId: d.action_configuration_id,\n actionType: d.action_type,\n target: d.target,\n }));\n\nexport const unmarshalAlertConfigurationSchema: z.ZodType<AlertConfiguration> =\n z\n .object({\n alert_configuration_id: z.string().optional(),\n time_period: z.string().optional(),\n trigger_type: z.string().optional(),\n quantity_type: z.string().optional(),\n quantity_threshold: z.string().optional(),\n action_configurations: z\n .array(z.lazy(() => unmarshalActionConfigurationSchema))\n .optional(),\n scope_type: z.string().optional(),\n principal_overrides: z\n .array(z.lazy(() => unmarshalPrincipalOverrideSchema))\n .optional(),\n })\n .transform(d => ({\n alertConfigurationId: d.alert_configuration_id,\n timePeriod: d.time_period,\n triggerType: d.trigger_type,\n quantityType: d.quantity_type,\n quantityThreshold: d.quantity_threshold,\n actionConfigurations: d.action_configurations,\n scopeType: d.scope_type,\n principalOverrides: d.principal_overrides,\n }));\n\nexport const unmarshalBudgetConfigurationSchema: z.ZodType<BudgetConfiguration> =\n z\n .object({\n budget_configuration_id: z.string().optional(),\n account_id: z.string().optional(),\n create_time: z\n .union([z.number(), z.bigint()])\n .transform(v => BigInt(v))\n .optional(),\n update_time: z\n .union([z.number(), z.bigint()])\n .transform(v => BigInt(v))\n .optional(),\n alert_configurations: z\n .array(z.lazy(() => unmarshalAlertConfigurationSchema))\n .optional(),\n filter: z.lazy(() => unmarshalBudgetConfigurationFilterSchema).optional(),\n display_name: z.string().optional(),\n resource_type: z.string().optional(),\n })\n .transform(d => ({\n budgetConfigurationId: d.budget_configuration_id,\n accountId: d.account_id,\n createTime: d.create_time,\n updateTime: d.update_time,\n alertConfigurations: d.alert_configurations,\n filter: d.filter,\n displayName: d.display_name,\n resourceType: d.resource_type,\n }));\n\nexport const unmarshalBudgetConfigurationFilterSchema: z.ZodType<BudgetConfigurationFilter> =\n z\n .object({\n workspace_id: z\n .lazy(() => unmarshalBudgetConfigurationFilter_WorkspaceIdClauseSchema)\n .optional(),\n tags: z\n .array(z.lazy(() => unmarshalBudgetConfigurationFilter_TagClauseSchema))\n .optional(),\n })\n .transform(d => ({\n workspaceId: d.workspace_id,\n tags: d.tags,\n }));\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.\nexport const unmarshalBudgetConfigurationFilter_ClauseSchema: z.ZodType<BudgetConfigurationFilter_Clause> =\n z\n .object({\n operator: z.string().optional(),\n values: z.array(z.string()).optional(),\n })\n .transform(d => ({\n operator: d.operator,\n values: d.values,\n }));\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.\nexport const unmarshalBudgetConfigurationFilter_TagClauseSchema: z.ZodType<BudgetConfigurationFilter_TagClause> =\n z\n .object({\n key: z.string().optional(),\n value: z\n .lazy(() => unmarshalBudgetConfigurationFilter_ClauseSchema)\n .optional(),\n })\n .transform(d => ({\n key: d.key,\n value: d.value,\n }));\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.\nexport const unmarshalBudgetConfigurationFilter_WorkspaceIdClauseSchema: z.ZodType<BudgetConfigurationFilter_WorkspaceIdClause> =\n z\n .object({\n operator: z.string().optional(),\n values: z\n .array(z.union([z.number(), z.bigint()]).transform(v => BigInt(v)))\n .optional(),\n })\n .transform(d => ({\n operator: d.operator,\n values: d.values,\n }));\n\nexport const unmarshalCreateBudgetConfigurationResponseSchema: z.ZodType<CreateBudgetConfigurationResponse> =\n z\n .object({\n budget: z.lazy(() => unmarshalBudgetConfigurationSchema).optional(),\n })\n .transform(d => ({\n budget: d.budget,\n }));\n\nexport const unmarshalDeleteBudgetConfigurationResponseSchema: z.ZodType<DeleteBudgetConfigurationResponse> =\n z.object({});\n\nexport const unmarshalGetBudgetConfigurationResponseSchema: z.ZodType<GetBudgetConfigurationResponse> =\n z\n .object({\n budget: z.lazy(() => unmarshalBudgetConfigurationSchema).optional(),\n })\n .transform(d => ({\n budget: d.budget,\n }));\n\nexport const unmarshalListBudgetConfigurationsResponseSchema: z.ZodType<ListBudgetConfigurationsResponse> =\n z\n .object({\n budgets: z\n .array(z.lazy(() => unmarshalBudgetConfigurationSchema))\n .optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n budgets: d.budgets,\n nextPageToken: d.next_page_token,\n }));\n\nexport const unmarshalPrincipalOverrideSchema: z.ZodType<PrincipalOverride> = z\n .object({\n principal_id: z\n .union([z.number(), z.bigint()])\n .transform(v => BigInt(v))\n .optional(),\n override_threshold: z.string().optional(),\n })\n .transform(d => ({\n principalId: d.principal_id,\n overrideThreshold: d.override_threshold,\n }));\n\nexport const unmarshalUpdateBudgetConfigurationResponseSchema: z.ZodType<UpdateBudgetConfigurationResponse> =\n z\n .object({\n budget: z.lazy(() => unmarshalBudgetConfigurationSchema).optional(),\n })\n .transform(d => ({\n budget: d.budget,\n }));\n\nexport const marshalActionConfigurationSchema: z.ZodType = z\n .object({\n actionConfigurationId: z.string().optional(),\n actionType: z.string().optional(),\n target: z.string().optional(),\n })\n .transform(d => ({\n action_configuration_id: d.actionConfigurationId,\n action_type: d.actionType,\n target: d.target,\n }));\n\nexport const marshalAlertConfigurationSchema: z.ZodType = z\n .object({\n alertConfigurationId: z.string().optional(),\n timePeriod: z.string().optional(),\n triggerType: z.string().optional(),\n quantityType: z.string().optional(),\n quantityThreshold: z.string().optional(),\n actionConfigurations: z\n .array(z.lazy(() => marshalActionConfigurationSchema))\n .optional(),\n scopeType: z.string().optional(),\n principalOverrides: z\n .array(z.lazy(() => marshalPrincipalOverrideSchema))\n .optional(),\n })\n .transform(d => ({\n alert_configuration_id: d.alertConfigurationId,\n time_period: d.timePeriod,\n trigger_type: d.triggerType,\n quantity_type: d.quantityType,\n quantity_threshold: d.quantityThreshold,\n action_configurations: d.actionConfigurations,\n scope_type: d.scopeType,\n principal_overrides: d.principalOverrides,\n }));\n\nexport const marshalBudgetConfigurationFilterSchema: z.ZodType = z\n .object({\n workspaceId: z\n .lazy(() => marshalBudgetConfigurationFilter_WorkspaceIdClauseSchema)\n .optional(),\n tags: z\n .array(z.lazy(() => marshalBudgetConfigurationFilter_TagClauseSchema))\n .optional(),\n })\n .transform(d => ({\n workspace_id: d.workspaceId,\n tags: d.tags,\n }));\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.\nexport const marshalBudgetConfigurationFilter_ClauseSchema: z.ZodType = z\n .object({\n operator: z.string().optional(),\n values: z.array(z.string()).optional(),\n })\n .transform(d => ({\n operator: d.operator,\n values: d.values,\n }));\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.\nexport const marshalBudgetConfigurationFilter_TagClauseSchema: z.ZodType = z\n .object({\n key: z.string().optional(),\n value: z\n .lazy(() => marshalBudgetConfigurationFilter_ClauseSchema)\n .optional(),\n })\n .transform(d => ({\n key: d.key,\n value: d.value,\n }));\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.\nexport const marshalBudgetConfigurationFilter_WorkspaceIdClauseSchema: z.ZodType =\n z\n .object({\n operator: z.string().optional(),\n values: z.array(z.bigint()).optional(),\n })\n .transform(d => ({\n operator: d.operator,\n values: d.values,\n }));\n\nexport const marshalCreateBudgetConfigurationBudgetSchema: z.ZodType = z\n .object({\n budgetConfigurationId: z.string().optional(),\n accountId: z.string().optional(),\n createTime: z.bigint().optional(),\n updateTime: z.bigint().optional(),\n alertConfigurations: z\n .array(z.lazy(() => marshalAlertConfigurationSchema))\n .optional(),\n filter: z.lazy(() => marshalBudgetConfigurationFilterSchema).optional(),\n displayName: z.string().optional(),\n resourceType: z.string().optional(),\n })\n .transform(d => ({\n budget_configuration_id: d.budgetConfigurationId,\n account_id: d.accountId,\n create_time: d.createTime,\n update_time: d.updateTime,\n alert_configurations: d.alertConfigurations,\n filter: d.filter,\n display_name: d.displayName,\n resource_type: d.resourceType,\n }));\n\nexport const marshalCreateBudgetConfigurationRequestSchema: z.ZodType = z\n .object({\n budget: z\n .lazy(() => marshalCreateBudgetConfigurationBudgetSchema)\n .optional(),\n })\n .transform(d => ({\n budget: d.budget,\n }));\n\nexport const marshalPrincipalOverrideSchema: z.ZodType = z\n .object({\n principalId: z.bigint().optional(),\n overrideThreshold: z.string().optional(),\n })\n .transform(d => ({\n principal_id: d.principalId,\n override_threshold: d.overrideThreshold,\n }));\n\nexport const marshalUpdateBudgetConfigurationBudgetSchema: z.ZodType = z\n .object({\n budgetConfigurationId: z.string().optional(),\n accountId: z.string().optional(),\n createTime: z.bigint().optional(),\n updateTime: z.bigint().optional(),\n alertConfigurations: z\n .array(z.lazy(() => marshalAlertConfigurationSchema))\n .optional(),\n filter: z.lazy(() => marshalBudgetConfigurationFilterSchema).optional(),\n displayName: z.string().optional(),\n resourceType: z.string().optional(),\n })\n .transform(d => ({\n budget_configuration_id: d.budgetConfigurationId,\n account_id: d.accountId,\n create_time: d.createTime,\n update_time: d.updateTime,\n alert_configurations: d.alertConfigurations,\n filter: d.filter,\n display_name: d.displayName,\n resource_type: d.resourceType,\n }));\n\nexport const marshalUpdateBudgetConfigurationRequestSchema: z.ZodType = z\n .object({\n budgetId: z.string().optional(),\n budget: z\n .lazy(() => marshalUpdateBudgetConfigurationBudgetSchema)\n .optional(),\n })\n .transform(d => ({\n budget_id: d.budgetId,\n budget: d.budget,\n }));\n"],"mappings":";;;;AAMA,MAAa,0BAA0B;CACrC,oBAAoB;CAKpB,aAAa;CACd;AAMD,MAAa,iCAAiC,EAC5C,wBAAwB,0BACzB;;AAOD,MAAa,8BAA8B;CAEzC,uCACE;CAEF,yCACE;CACH;AAMD,MAAa,+BAA+B,EAC1C,OAAO,SACR;AAMD,MAAa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gCAAgC,CAAC,CACpD,UAAU;CACb,QAAQ,EAAE,WAAW,uCAAuC,CAAC,UAAU;CACvE,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,cAAc,EAAE,QAAQ,CAAC,UAAU;CACpC,CAAC,CACD,WAAU,OAAM;CACf,yBAAyB,EAAE;CAC3B,YAAY,EAAE;CACd,aAAa,EAAE;CACf,aAAa,EAAE;CACf,sBAAsB,EAAE;CACxB,QAAQ,EAAE;CACV,cAAc,EAAE;CAChB,eAAe,EAAE;CAClB,EAAE;AAEL,MAAa,gDAA2D,EACrE,OAAO;CACN,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,QAAQ,EACL,WAAW,6CAA6C,CACxD,UAAU;CACd,CAAC,CACD,WAAU,OAAM;CACf,WAAW,EAAE;CACb,QAAQ,EAAE;CACX,EAAE"}
@@ -1,23 +1,25 @@
1
- import type { HttpClient } from '@databricks/sdk-core/http';
2
- import type { ClientOptions } from '@databricks/sdk-options/client';
1
+ import { HttpClient } from "@databricks/sdk-core/http";
2
+ import { ClientOptions } from "@databricks/sdk-options/client";
3
+
4
+ //#region src/v1/transport.d.ts
3
5
  /**
4
6
  * The configuration a client needs to issue requests, resolved from
5
7
  * {@link ClientOptions} and a configuration profile.
6
8
  */
7
- export interface ResolvedClientConfig {
8
- /** Host with any trailing slash removed. */
9
- host: string;
10
- /**
11
- * Default account ID for account-level paths that contain an account_id
12
- * segment. A request's own accountId still wins.
13
- */
14
- accountId?: string;
15
- /**
16
- * Workspace ID used to route workspace-level calls on unified hosts (SPOG).
17
- */
18
- workspaceId?: string;
19
- /** HTTP client with authentication, and any configured timeout, applied. */
20
- httpClient: HttpClient;
9
+ interface ResolvedClientConfig {
10
+ /** Host with any trailing slash removed. */
11
+ host: string;
12
+ /**
13
+ * Default account ID for account-level paths that contain an account_id
14
+ * segment. A request's own accountId still wins.
15
+ */
16
+ accountId?: string;
17
+ /**
18
+ * Workspace ID used to route workspace-level calls on unified hosts (SPOG).
19
+ */
20
+ workspaceId?: string;
21
+ /** HTTP client with authentication, and any configured timeout, applied. */
22
+ httpClient: HttpClient;
21
23
  }
22
24
  /**
23
25
  * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
@@ -29,5 +31,7 @@ export interface ResolvedClientConfig {
29
31
  *
30
32
  * @throws if host is neither provided nor present in the resolved profile.
31
33
  */
32
- export declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
34
+ declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
35
+ //#endregion
36
+ export { ResolvedClientConfig, resolveClientConfig };
33
37
  //# sourceMappingURL=transport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAGX,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,4EAA4E;IAC5E,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,oBAAoB,CAAC,CA4B/B"}
1
+ {"version":3,"file":"transport.d.ts","names":[],"sources":["../../src/v1/transport.ts"],"mappings":";;;;;;AAkBA;;UAAiB,oBAAA;EAgBO;EAdtB,IAAA;EAMA;;;;EAAA,SAAA;EAQsB;AAaxB;;EAhBE,WAAA;EAiBS;EAdT,UAAA,EAAY,UAAA;AAAA;;;;;;;;;;;iBAaQ,mBAAA,CACpB,OAAA,EAAS,aAAA,GACR,OAAA,CAAQ,oBAAA"}
@@ -1,74 +1,65 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
- import { defaultCredentials } from '@databricks/sdk-auth/credentials';
3
- import { newFetchHttpClient } from '@databricks/sdk-core/http';
4
- import { resolve } from '@databricks/sdk-core/profiles';
1
+ import { defaultCredentials } from "@databricks/sdk-auth/credentials";
2
+ import { newFetchHttpClient } from "@databricks/sdk-core/http";
3
+ import { resolve } from "@databricks/sdk-core/profiles";
4
+
5
+ //#region src/v1/transport.ts
5
6
  /**
6
- * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
7
- *
8
- * A configuration profile is always resolved from the config file and
9
- * environment variables (per options.profileOptions); it supplies host,
10
- * accountId, workspaceId, and credentials wherever the caller did not set them
11
- * explicitly. Explicit options always take precedence.
12
- *
13
- * @throws if host is neither provided nor present in the resolved profile.
14
- */
15
- export async function resolveClientConfig(options) {
16
- const profile = await resolve(options.profileOptions);
17
- const host = options.host ?? profile.host;
18
- if (host === undefined) {
19
- throw new Error('Host is required.');
20
- }
21
- // The provided httpClient (or the default fetch client) is the base wire;
22
- // authentication and the optional timeout are layered on top of it. The
23
- // default credential chain reuses the profile resolved above so that the
24
- // same profileOptions govern host and authentication alike.
25
- const base = options.httpClient ?? newFetchHttpClient();
26
- const credentials = options.credentials ?? defaultCredentials({ profile });
27
- let httpClient = new AuthHttpClient(base, credentials);
28
- if (options.timeout !== undefined) {
29
- httpClient = new TimeoutHttpClient(httpClient, options.timeout);
30
- }
31
- const accountId = options.accountId ?? profile.accountId;
32
- const workspaceId = options.workspaceId ?? profile.workspaceId;
33
- return {
34
- host: host.replace(/\/$/, ''),
35
- httpClient,
36
- ...(accountId !== undefined && { accountId }),
37
- ...(workspaceId !== undefined && { workspaceId }),
38
- };
7
+ * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
8
+ *
9
+ * A configuration profile is always resolved from the config file and
10
+ * environment variables (per options.profileOptions); it supplies host,
11
+ * accountId, workspaceId, and credentials wherever the caller did not set them
12
+ * explicitly. Explicit options always take precedence.
13
+ *
14
+ * @throws if host is neither provided nor present in the resolved profile.
15
+ */
16
+ async function resolveClientConfig(options) {
17
+ const profile = await resolve(options.profileOptions);
18
+ const host = options.host ?? profile.host;
19
+ if (host === void 0) throw new Error("Host is required.");
20
+ let httpClient = new AuthHttpClient(options.httpClient ?? newFetchHttpClient(), options.credentials ?? defaultCredentials({ profile }));
21
+ if (options.timeout !== void 0) httpClient = new TimeoutHttpClient(httpClient, options.timeout);
22
+ const accountId = options.accountId ?? profile.accountId;
23
+ const workspaceId = options.workspaceId ?? profile.workspaceId;
24
+ return {
25
+ host: host.replace(/\/$/, ""),
26
+ httpClient,
27
+ ...accountId !== void 0 && { accountId },
28
+ ...workspaceId !== void 0 && { workspaceId }
29
+ };
39
30
  }
40
31
  /** Wraps an HttpClient and adds authentication headers to requests. */
41
- class AuthHttpClient {
42
- base;
43
- credentials;
44
- constructor(base, credentials) {
45
- this.base = base;
46
- this.credentials = credentials;
47
- }
48
- async send(request) {
49
- const authHeaders = await this.credentials.authHeaders();
50
- // Do not modify the original request.
51
- const headers = new Headers(request.headers);
52
- for (const h of authHeaders) {
53
- headers.set(h.key, h.value);
54
- }
55
- return this.base.send({ ...request, headers });
56
- }
57
- }
32
+ var AuthHttpClient = class {
33
+ constructor(base, credentials) {
34
+ this.base = base;
35
+ this.credentials = credentials;
36
+ }
37
+ async send(request) {
38
+ const authHeaders = await this.credentials.authHeaders();
39
+ const headers = new Headers(request.headers);
40
+ for (const h of authHeaders) headers.set(h.key, h.value);
41
+ return this.base.send({
42
+ ...request,
43
+ headers
44
+ });
45
+ }
46
+ };
58
47
  /** Wraps an HttpClient and applies a default timeout to requests. */
59
- class TimeoutHttpClient {
60
- base;
61
- timeout;
62
- constructor(base, timeout) {
63
- this.base = base;
64
- this.timeout = timeout;
65
- }
66
- async send(request) {
67
- const timeoutSignal = AbortSignal.timeout(this.timeout);
68
- const signal = request.signal !== undefined
69
- ? AbortSignal.any([request.signal, timeoutSignal])
70
- : timeoutSignal;
71
- return this.base.send({ ...request, signal });
72
- }
73
- }
48
+ var TimeoutHttpClient = class {
49
+ constructor(base, timeout) {
50
+ this.base = base;
51
+ this.timeout = timeout;
52
+ }
53
+ async send(request) {
54
+ const timeoutSignal = AbortSignal.timeout(this.timeout);
55
+ const signal = request.signal !== void 0 ? AbortSignal.any([request.signal, timeoutSignal]) : timeoutSignal;
56
+ return this.base.send({
57
+ ...request,
58
+ signal
59
+ });
60
+ }
61
+ };
62
+
63
+ //#endregion
64
+ export { resolveClientConfig };
74
65
  //# sourceMappingURL=transport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAMpE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAC,OAAO,EAAC,MAAM,+BAA+B,CAAC;AA0BtD;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAsB;IAEtB,MAAM,OAAO,GAAY,MAAM,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAE/D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IAED,0EAA0E;IAC1E,wEAAwE;IACxE,yEAAyE;IACzE,4DAA4D;IAC5D,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,IAAI,kBAAkB,EAAE,CAAC;IACxD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,kBAAkB,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC;IACzE,IAAI,UAAU,GAAe,IAAI,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC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AAI,GAAJ,IAAI,CAAY;QAChB,YAAO,GAAP,OAAO,CAAQ;IAC/B,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxD,MAAM,MAAM,GACV,OAAO,CAAC,MAAM,KAAK,SAAS;YAC1B,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;YAClD,CAAC,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,GAAG,OAAO,EAAE,MAAM,EAAC,CAAC,CAAC;IAC9C,CAAC;CACF"}
1
+ {"version":3,"file":"transport.js","names":[],"sources":["../../src/v1/transport.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {Credentials} from '@databricks/sdk-auth';\nimport {defaultCredentials} from '@databricks/sdk-auth/credentials';\nimport type {\n HttpClient,\n HttpRequest,\n HttpResponse,\n} from '@databricks/sdk-core/http';\nimport {newFetchHttpClient} from '@databricks/sdk-core/http';\nimport type {Profile} from '@databricks/sdk-core/profiles';\nimport {resolve} from '@databricks/sdk-core/profiles';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\n\n/**\n * The configuration a client needs to issue requests, resolved from\n * {@link ClientOptions} and a configuration profile.\n */\nexport interface ResolvedClientConfig {\n /** Host with any trailing slash removed. */\n host: string;\n\n /**\n * Default account ID for account-level paths that contain an account_id\n * segment. A request's own accountId still wins.\n */\n accountId?: string;\n\n /**\n * Workspace ID used to route workspace-level calls on unified hosts (SPOG).\n */\n workspaceId?: string;\n\n /** HTTP client with authentication, and any configured timeout, applied. */\n httpClient: HttpClient;\n}\n\n/**\n * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.\n *\n * A configuration profile is always resolved from the config file and\n * environment variables (per options.profileOptions); it supplies host,\n * accountId, workspaceId, and credentials wherever the caller did not set them\n * explicitly. Explicit options always take precedence.\n *\n * @throws if host is neither provided nor present in the resolved profile.\n */\nexport async function resolveClientConfig(\n options: ClientOptions\n): Promise<ResolvedClientConfig> {\n const profile: Profile = await resolve(options.profileOptions);\n\n const host = options.host ?? profile.host;\n if (host === undefined) {\n throw new Error('Host is required.');\n }\n\n // The provided httpClient (or the default fetch client) is the base wire;\n // authentication and the optional timeout are layered on top of it. The\n // default credential chain reuses the profile resolved above so that the\n // same profileOptions govern host and authentication alike.\n const base = options.httpClient ?? newFetchHttpClient();\n const credentials = options.credentials ?? defaultCredentials({profile});\n let httpClient: HttpClient = new AuthHttpClient(base, credentials);\n if (options.timeout !== undefined) {\n httpClient = new TimeoutHttpClient(httpClient, options.timeout);\n }\n\n const accountId = options.accountId ?? profile.accountId;\n const workspaceId = options.workspaceId ?? profile.workspaceId;\n\n return {\n host: host.replace(/\\/$/, ''),\n httpClient,\n ...(accountId !== undefined && {accountId}),\n ...(workspaceId !== undefined && {workspaceId}),\n };\n}\n\n/** Wraps an HttpClient and adds authentication headers to requests. */\nclass AuthHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly credentials: Credentials\n ) {}\n\n async send(request: HttpRequest): Promise<HttpResponse> {\n const authHeaders = await this.credentials.authHeaders();\n // Do not modify the original request.\n const headers = new Headers(request.headers);\n for (const h of authHeaders) {\n headers.set(h.key, h.value);\n }\n return this.base.send({...request, headers});\n }\n}\n\n/** Wraps an HttpClient and applies a default timeout to requests. */\nclass TimeoutHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly timeout: number\n ) {}\n\n async send(request: HttpRequest): Promise<HttpResponse> {\n const timeoutSignal = AbortSignal.timeout(this.timeout);\n const signal =\n request.signal !== undefined\n ? AbortSignal.any([request.signal, timeoutSignal])\n : timeoutSignal;\n return this.base.send({...request, signal});\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+CA,eAAsB,oBACpB,S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import type { Logger } from '@databricks/sdk-core/logger';
3
- import type { CallOptions } from '@databricks/sdk-options/call';
4
- import type { z } from 'zod';
5
- export interface HttpCallOptions {
6
- readonly request: HttpRequest;
7
- readonly httpClient: HttpClient;
8
- readonly logger: Logger;
1
+ import { Logger } from "@databricks/sdk-core/logger";
2
+ import { HttpClient, HttpRequest } from "@databricks/sdk-core/http";
3
+ import { z } from "zod";
4
+ import { CallOptions } from "@databricks/sdk-options/call";
5
+
6
+ //#region src/v1/utils.d.ts
7
+ interface HttpCallOptions {
8
+ readonly request: HttpRequest;
9
+ readonly httpClient: HttpClient;
10
+ readonly logger: Logger;
9
11
  }
10
12
  /**
11
13
  * Translates public CallOptions to the internal Options shape accepted by
12
14
  * execute(). Even though the shapes match today, this isolates the public
13
15
  * API from the executor's internal type so they can diverge.
14
16
  */
15
- export declare function executeCall(call: (signal?: AbortSignal) => Promise<void>, options?: CallOptions): Promise<void>;
16
- export declare function executeHttpCall(opts: HttpCallOptions): Promise<Uint8Array>;
17
- export declare function buildHttpRequest(method: string, url: string, headers: Headers, signal?: AbortSignal, body?: string | ReadableStream<Uint8Array>): HttpRequest;
18
- export declare function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T;
19
- export declare function marshalRequest(data: unknown, schema: z.ZodType): string;
20
- export declare function flattenQueryParams(prefix: string, value: unknown, params: URLSearchParams): void;
17
+ declare function executeCall(call: (signal?: AbortSignal) => Promise<void>, options?: CallOptions): Promise<void>;
18
+ declare function executeHttpCall(opts: HttpCallOptions): Promise<Uint8Array>;
19
+ declare function buildHttpRequest(method: string, url: string, headers: Headers, signal?: AbortSignal, body?: string | ReadableStream<Uint8Array>): HttpRequest;
20
+ declare function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T;
21
+ declare function marshalRequest(data: unknown, schema: z.ZodType): string;
22
+ declare function flattenQueryParams(prefix: string, value: unknown, params: URLSearchParams): void;
23
+ //#endregion
24
+ export { HttpCallOptions, buildHttpRequest, executeCall, executeHttpCall, flattenQueryParams, marshalRequest, parseResponse };
21
25
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EAEZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAO3B,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,EAC7C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,IAAI,CAAC,CASf;AA2BD,wBAAsB,eAAe,CACnC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,UAAU,CAAC,CA2BrB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,GACzC,WAAW,CASb;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAK1E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAEvE;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,eAAe,GACtB,IAAI,CAuBN"}
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/v1/utils.ts"],"mappings":";;;;;;UAoBiB,eAAA;EAAA,SACN,OAAA,EAAS,WAAA;EAAA,SACT,UAAA,EAAY,UAAA;EAAA,SACZ,MAAA,EAAQ,MAAA;AAAA;;;;;;iBAQG,WAAA,CACpB,IAAA,GAAO,MAAA,GAAS,WAAA,KAAgB,OAAA,QAChC,OAAA,GAAU,WAAA,GACT,OAAA;AAAA,iBAoCmB,eAAA,CACpB,IAAA,EAAM,eAAA,GACL,OAAA,CAAQ,UAAA;AAAA,iBA6BK,gBAAA,CACd,MAAA,UACA,GAAA,UACA,OAAA,EAAS,OAAA,EACT,MAAA,GAAS,WAAA,EACT,IAAA,YAAgB,cAAA,CAAe,UAAA,IAC9B,WAAA;AAAA,iBAWa,aAAA,GAAA,CAAiB,IAAA,EAAM,UAAA,EAAY,MAAA,EAAQ,CAAA,CAAE,OAAA,CAAQ,CAAA,IAAK,CAAA;AAAA,iBAO1D,cAAA,CAAe,IAAA,WAAe,MAAA,EAAQ,CAAA,CAAE,OAAA;AAAA,iBAIxC,kBAAA,CACd,MAAA,UACA,KAAA,WACA,MAAA,EAAQ,eAAA"}
package/dist/v1/utils.js CHANGED
@@ -1,114 +1,87 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
- import { execute } from '@databricks/sdk-core/ops';
3
- import { ApiError } from '@databricks/sdk-core/apierror';
4
- import JSONBig from 'json-bigint';
5
- // JSON codec that preserves int64 precision. On the way in, large integer
6
- // literals come back as bigint instead of being rounded to JS Number. On the
7
- // way out, bigint values are emitted as raw JSON number digits.
1
+ import { execute } from "@databricks/sdk-core/ops";
2
+ import { ApiError } from "@databricks/sdk-core/apierror";
3
+ import JSONBig from "json-bigint";
4
+
5
+ //#region src/v1/utils.ts
8
6
  const jsonBigint = JSONBig({ useNativeBigInt: true });
9
7
  /**
10
- * Translates public CallOptions to the internal Options shape accepted by
11
- * execute(). Even though the shapes match today, this isolates the public
12
- * API from the executor's internal type so they can diverge.
13
- */
14
- export async function executeCall(call, options) {
15
- const opts = {
16
- ...(options?.retrier !== undefined && { retrier: options.retrier }),
17
- ...(options?.rateLimiter !== undefined && {
18
- rateLimiter: options.rateLimiter,
19
- }),
20
- ...(options?.timeout !== undefined && { timeout: options.timeout }),
21
- };
22
- return execute(options?.signal, call, opts);
8
+ * Translates public CallOptions to the internal Options shape accepted by
9
+ * execute(). Even though the shapes match today, this isolates the public
10
+ * API from the executor's internal type so they can diverge.
11
+ */
12
+ async function executeCall(call, options) {
13
+ const opts = {
14
+ ...options?.retrier !== void 0 && { retrier: options.retrier },
15
+ ...options?.rateLimiter !== void 0 && { rateLimiter: options.rateLimiter },
16
+ ...options?.timeout !== void 0 && { timeout: options.timeout }
17
+ };
18
+ return execute(options?.signal, call, opts);
23
19
  }
24
20
  async function readAll(body) {
25
- if (body === null) {
26
- return new Uint8Array(0);
27
- }
28
- const reader = body.getReader();
29
- const chunks = [];
30
- for (;;) {
31
- const { done, value } = await reader.read();
32
- if (done) {
33
- break;
34
- }
35
- chunks.push(value);
36
- }
37
- const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
38
- const result = new Uint8Array(totalLength);
39
- let offset = 0;
40
- for (const chunk of chunks) {
41
- result.set(chunk, offset);
42
- offset += chunk.length;
43
- }
44
- return result;
21
+ if (body === null) return new Uint8Array(0);
22
+ const reader = body.getReader();
23
+ const chunks = [];
24
+ for (;;) {
25
+ const { done, value } = await reader.read();
26
+ if (done) break;
27
+ chunks.push(value);
28
+ }
29
+ const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
30
+ const result = new Uint8Array(totalLength);
31
+ let offset = 0;
32
+ for (const chunk of chunks) {
33
+ result.set(chunk, offset);
34
+ offset += chunk.length;
35
+ }
36
+ return result;
45
37
  }
46
- export async function executeHttpCall(opts) {
47
- opts.logger.debug('HTTP request', {
48
- method: opts.request.method,
49
- url: opts.request.url,
50
- });
51
- let resp;
52
- try {
53
- resp = await opts.httpClient.send(opts.request);
54
- }
55
- catch (e) {
56
- opts.logger.debug('HTTP request failed');
57
- throw e;
58
- }
59
- const body = await readAll(resp.body);
60
- opts.logger.debug('HTTP response', {
61
- statusCode: resp.statusCode,
62
- body: new TextDecoder().decode(body),
63
- });
64
- const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);
65
- if (apiErr !== undefined) {
66
- throw apiErr;
67
- }
68
- return body;
38
+ async function executeHttpCall(opts) {
39
+ opts.logger.debug("HTTP request", {
40
+ method: opts.request.method,
41
+ url: opts.request.url
42
+ });
43
+ let resp;
44
+ try {
45
+ resp = await opts.httpClient.send(opts.request);
46
+ } catch (e) {
47
+ opts.logger.debug("HTTP request failed");
48
+ throw e;
49
+ }
50
+ const body = await readAll(resp.body);
51
+ opts.logger.debug("HTTP response", {
52
+ statusCode: resp.statusCode,
53
+ body: new TextDecoder().decode(body)
54
+ });
55
+ const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);
56
+ if (apiErr !== void 0) throw apiErr;
57
+ return body;
69
58
  }
70
- export function buildHttpRequest(method, url, headers, signal, body) {
71
- const req = { url, method, headers };
72
- if (body !== undefined) {
73
- req.body = body;
74
- }
75
- if (signal !== undefined) {
76
- req.signal = signal;
77
- }
78
- return req;
59
+ function buildHttpRequest(method, url, headers, signal, body) {
60
+ const req = {
61
+ url,
62
+ method,
63
+ headers
64
+ };
65
+ if (body !== void 0) req.body = body;
66
+ if (signal !== void 0) req.signal = signal;
67
+ return req;
79
68
  }
80
- export function parseResponse(body, schema) {
81
- const text = new TextDecoder().decode(body);
82
- // 204 responses return an empty body; treat as `{}`.
83
- const parsed = text === '' ? {} : jsonBigint.parse(text);
84
- return schema.parse(parsed);
69
+ function parseResponse(body, schema) {
70
+ const text = new TextDecoder().decode(body);
71
+ const parsed = text === "" ? {} : jsonBigint.parse(text);
72
+ return schema.parse(parsed);
85
73
  }
86
- export function marshalRequest(data, schema) {
87
- return jsonBigint.stringify(schema.parse(data));
74
+ function marshalRequest(data, schema) {
75
+ return jsonBigint.stringify(schema.parse(data));
88
76
  }
89
- export function flattenQueryParams(prefix, value, params) {
90
- if (value === null || value === undefined) {
91
- return;
92
- }
93
- if (Array.isArray(value)) {
94
- // arrays of objects are not yet supported
95
- for (const item of value) {
96
- params.append(prefix, String(item));
97
- }
98
- }
99
- else if (typeof value === 'object') {
100
- for (const [key, val] of Object.entries(value)) {
101
- flattenQueryParams(`${prefix}.${key}`, val, params);
102
- }
103
- }
104
- else if (typeof value === 'string' ||
105
- typeof value === 'number' ||
106
- typeof value === 'boolean' ||
107
- typeof value === 'bigint') {
108
- params.append(prefix, String(value));
109
- }
110
- else {
111
- throw new Error(`Unsupported query parameter type: ${typeof value}`);
112
- }
77
+ function flattenQueryParams(prefix, value, params) {
78
+ if (value === null || value === void 0) return;
79
+ if (Array.isArray(value)) for (const item of value) params.append(prefix, String(item));
80
+ else if (typeof value === "object") for (const [key, val] of Object.entries(value)) flattenQueryParams(`${prefix}.${key}`, val, params);
81
+ else if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") params.append(prefix, String(value));
82
+ else throw new Error(`Unsupported query parameter type: ${typeof value}`);
113
83
  }
84
+
85
+ //#endregion
86
+ export { buildHttpRequest, executeCall, executeHttpCall, flattenQueryParams, marshalRequest, parseResponse };
114
87
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAQvD,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC,0EAA0E;AAC1E,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;IACH,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrC,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;YAC1E,kBAAkB,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;SAAM,IACL,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,OAAO,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../src/v1/utils.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {Options} from '@databricks/sdk-core/ops';\nimport {execute} from '@databricks/sdk-core/ops';\nimport {ApiError} from '@databricks/sdk-core/apierror';\nimport type {\n HttpClient,\n HttpRequest,\n HttpResponse,\n} from '@databricks/sdk-core/http';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport JSONBig from 'json-bigint';\nimport type {z} from 'zod';\n\n// JSON codec that preserves int64 precision. On the way in, large integer\n// literals come back as bigint instead of being rounded to JS Number. On the\n// way out, bigint values are emitted as raw JSON number digits.\nconst jsonBigint = JSONBig({useNativeBigInt: true});\n\nexport interface HttpCallOptions {\n readonly request: HttpRequest;\n readonly httpClient: HttpClient;\n readonly logger: Logger;\n}\n\n/**\n * Translates public CallOptions to the internal Options shape accepted by\n * execute(). Even though the shapes match today, this isolates the public\n * API from the executor's internal type so they can diverge.\n */\nexport async function executeCall(\n call: (signal?: AbortSignal) => Promise<void>,\n options?: CallOptions\n): Promise<void> {\n const opts: Options = {\n ...(options?.retrier !== undefined && {retrier: options.retrier}),\n ...(options?.rateLimiter !== undefined && {\n rateLimiter: options.rateLimiter,\n }),\n ...(options?.timeout !== undefined && {timeout: options.timeout}),\n };\n return execute(options?.signal, call, opts);\n}\n\nasync function readAll(\n body: ReadableStream<Uint8Array> | null\n): Promise<Uint8Array> {\n if (body === null) {\n return new Uint8Array(0);\n }\n const reader = body.getReader();\n const chunks: Uint8Array[] = [];\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n chunks.push(value);\n }\n const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n}\n\nexport async function executeHttpCall(\n opts: HttpCallOptions\n): Promise<Uint8Array> {\n opts.logger.debug('HTTP request', {\n method: opts.request.method,\n url: opts.request.url,\n });\n\n let resp: HttpResponse;\n try {\n resp = await opts.httpClient.send(opts.request);\n } catch (e: unknown) {\n opts.logger.debug('HTTP request failed');\n throw e;\n }\n\n const body = await readAll(resp.body);\n\n opts.logger.debug('HTTP response', {\n statusCode: resp.statusCode,\n body: new TextDecoder().decode(body),\n });\n\n const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);\n if (apiErr !== undefined) {\n throw apiErr;\n }\n\n return body;\n}\n\nexport function buildHttpRequest(\n method: string,\n url: string,\n headers: Headers,\n signal?: AbortSignal,\n body?: string | ReadableStream<Uint8Array>\n): HttpRequest {\n const req: HttpRequest = {url, method, headers};\n if (body !== undefined) {\n req.body = body;\n }\n if (signal !== undefined) {\n req.signal = signal;\n }\n return req;\n}\n\nexport function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {\n const text = new TextDecoder().decode(body);\n // 204 responses return an empty body; treat as `{}`.\n const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);\n return schema.parse(parsed);\n}\n\nexport function marshalRequest(data: unknown, schema: z.ZodType): string {\n return jsonBigint.stringify(schema.parse(data));\n}\n\nexport function flattenQueryParams(\n prefix: string,\n value: unknown,\n params: URLSearchParams\n): void {\n if (value === null || value === undefined) {\n return;\n }\n if (Array.isArray(value)) {\n // arrays of objects are not yet supported\n for (const item of value) {\n params.append(prefix, String(item));\n }\n } else if (typeof value === 'object') {\n for (const [key, val] of Object.entries(value as Record<string, unknown>)) {\n flattenQueryParams(`${prefix}.${key}`, val, params);\n }\n } else if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'bigint'\n ) {\n params.append(prefix, String(value));\n } else {\n throw new Error(`Unsupported query parameter type: ${typeof value}`);\n }\n}\n"],"mappings":";;;;;AAkBA,MAAM,aAAa,QAAQ,EAAC,iBAAiB,MAAK,CAAC;;;;;;AAanD,eAAsB,YACpB,MACA,SACe;CACf,MAAM,OAAgB;EACpB,GAAI,SAAS,YAAY,UAAa,EAAC,SAAS,QAAQ,SAAQ;EAChE,GAAI,SAAS,gBAAgB,UAAa,EACxC,aAAa,QAAQ,aACtB;EACD,GAAI,SAAS,YAAY,UAAa,EAAC,SAAS,QAAQ,SAAQ;EACjE;AACD,QAAO,QAAQ,SAAS,QAAQ,MAAM,KAAK;;AAG7C,eAAe,QACb,MACqB;AACrB,KAAI,SAAS,KACX,QAAO,IAAI,WAAW,EAAE;CAE1B,MAAM,SAAS,KAAK,WAAW;CAC/B,MAAM,SAAuB,EAAE;AAC/B,UAAS;EACP,MAAM,EAAC,MAAM,UAAS,MAAM,OAAO,MAAM;AACzC,MAAI,KACF;AAEF,SAAO,KAAK,MAAM;;CAEpB,MAAM,cAAc,OAAO,QAAQ,KAAK,UAAU,MAAM,MAAM,QAAQ,EAAE;CACxE,MAAM,SAAS,IAAI,WAAW,YAAY;CAC1C,IAAI,SAAS;AACb,MAAK,MAA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