@databricks/sdk-uc-secrets 0.27.0 → 0.35.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":"client.js","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAIvD,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,OAAO,MAAM,oBAAoB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAU7D,OAAO,EACL,mBAAmB,EACnB,kCAAkC,EAClC,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAEjB,gFAAgF;AAChF,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;IAC1D,KAAK,EAAE,OAAO,CAAC,OAAO;CACvB,CAAC;AAEF,MAAM,OAAO,aAAa;IACP,OAAO,CAAgB;IACvB,MAAM,CAAS;IAChC,8DAA8D;IAC9D,qEAAqE;IACrE,qBAAqB;IACJ,SAAS,CAAS;IACnC,6EAA6E;IAC7E,yEAAyE;IACzE,yDAAyD;IACjD,MAAM,CAA4C;IAE1D,YAAY,OAAsB;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,aAAa,EAAE;aACzB,IAAI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uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
1
+ {"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n CreateSecretRequest,\n DeleteSecretRequest,\n GetSecretRequest,\n ListSecretsRequest,\n ListSecretsResponse,\n Secret,\n UpdateSecretRequest,\n} from './model';\nimport {\n marshalSecretSchema,\n unmarshalListSecretsResponseSchema,\n unmarshalSecretSchema,\n} from './model';\n\n// Package identity segment for this client to be used in the User-Agent header.\nconst PACKAGE_SEGMENT = {\n key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\\/sdk-/, ''),\n value: pkgJson.version,\n};\n\nexport class SecretsClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent header value. Composed once at construction from\n // createDefault() merged with this package's identity and the active\n // credential's name.\n private readonly userAgent: string;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n const info = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION})\n .with({key: 'auth', value: options.credentials?.name() ?? 'default'});\n this.userAgent = info.toString();\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options);\n return this.config;\n }\n\n /**\n * Creates a new secret in Unity Catalog.\n *\n * You must be the owner of the parent schema or have the **CREATE_SECRET** and **USE SCHEMA**\n * privileges on the parent schema and **USE CATALOG** on the parent catalog.\n *\n * The secret is stored in the specified catalog and schema, and the **value** field\n * contains the sensitive data to be securely stored.\n */\n async createSecret(\n req: CreateSecretRequest,\n options?: CallOptions\n ): Promise<Secret> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/secrets`;\n const body = marshalRequest(req.secret, marshalSecretSchema);\n let resp: Secret | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalSecretSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Deletes a secret by its three-level (fully qualified) name.\n *\n * You must be the owner of the secret or a metastore admin.\n */\n async deleteSecret(\n req: DeleteSecretRequest,\n options?: CallOptions\n ): Promise<void> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/secrets/${req.fullName ?? ''}`;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);\n await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n };\n await executeCall(call, options);\n }\n\n /**\n * Gets a secret by its three-level (fully qualified) name.\n *\n * You must be a metastore admin, the owner of the secret, or have the **MANAGE**\n * privilege on the secret.\n *\n * The secret value isn't returned by default. To retrieve it, you must also have the\n * **READ_SECRET** privilege and set **include_value** to true in the request.\n */\n async getSecret(\n req: GetSecretRequest,\n options?: CallOptions\n ): Promise<Secret> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/secrets/${req.fullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.includeValue !== undefined) {\n params.append('include_value', String(req.includeValue));\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: Secret | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalSecretSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Lists secrets in Unity Catalog.\n *\n * You must be a metastore admin, the owner of the secret, or have the\n * **MANAGE** privilege on the secret.\n *\n * Both **catalog_name** and **schema_name** must be specified together to filter secrets within\n * a specific schema. Results are paginated; use the **page_token** field from the response\n * to retrieve subsequent pages.\n */\n async listSecrets(\n req: ListSecretsRequest,\n options?: CallOptions\n ): Promise<ListSecretsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/secrets`;\n const params = new URLSearchParams();\n if (req.catalogName !== undefined) {\n params.append('catalog_name', req.catalogName);\n }\n if (req.schemaName !== undefined) {\n params.append('schema_name', req.schemaName);\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n if (req.pageSize !== undefined) {\n params.append('page_size', String(req.pageSize));\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListSecretsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalListSecretsResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listSecretsIter(\n req: ListSecretsRequest,\n options?: CallOptions\n ): AsyncGenerator<Secret> {\n const pageReq: ListSecretsRequest = {...req};\n for (;;) {\n const resp = await this.listSecrets(pageReq, options);\n for (const item of resp.secrets ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /**\n * Updates an existing secret in Unity Catalog.\n *\n * You must be the owner of the secret or a metastore admin. If you are a metastore\n * admin, only the **owner** field can be changed.\n *\n * Use the **update_mask** field to specify which fields to update. Supported updatable fields\n * include **value**, **comment**, **owner**, and **expire_time**.\n */\n async updateSecret(\n req: UpdateSecretRequest,\n options?: CallOptions\n ): Promise<Secret> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/secrets/${req.fullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.updateMask !== undefined) {\n params.append('update_mask', req.updateMask.toString());\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n const body = marshalRequest(req.secret, marshalSecretSchema);\n let resp: Secret | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest(\n 'PATCH',\n fullUrl,\n headers,\n callSignal,\n body\n );\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalSecretSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n}\n"],"mappings":";;;;;;;;;AAkCA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,gBAAb,MAA2B;CACzB,AAAiB;CACjB,AAAiB;CAIjB,AAAiB;CAIjB,AAAQ;CAER,YAAY,SAAwB;AAClC,OAAK,UAAU;AACf,OAAK,SAAS,QAAQ,UAAU,IAAI,YAAY;AAKhD,OAAK,YAJQ,eAAe,CACzB,KAAK,gBAAgB,CACrB,KAAK;GAAC,KAAK;GAAe,OAAOC;GAAa,CAAC,CAC/C,KAAK;GAAC,KAAK;GAAQ,OAAO,QAAQ,aAAa,MAAM,IAAI;GAAU,CAAC,CACjD,UAAU;;CAGlC,AAAQ,gBAA+C;AACrD,OAAK,WAAW,oBAAoB,KAAK,QAAQ;AACjD,SAAO,KAAK;;;;;;;;;;;CAYd,MAAM,aACJ,KACA,SACiB;EACjB,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK;EACpB,MAAM,OAAO,eAAe,IAAI,QAAQ,oBAAoB;EAC5D,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,QAAQ,EAAC,gBAAgB,oBAAmB,CAAC;AACjE,OAAI,gBAAgB,OAClB,SAAQ,IAAI,6BAA6B,YAAY;AAEvD,WAAQ,IAAI,cAAc,KAAK,UAAU;AAOzC,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAA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AAa,KAAK,kBAAkB,GAC7D;AAEF,WAAQ,YAAY,KAAK;;;;;;;;;;;;CAa7B,MAAM,aACJ,KACA,SACiB;EACjB,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK,iCAAiC,IAAI,YAAY;EACrE,MAAM,SAAS,IAAI,iBAAiB;AACpC,MAAI,IAAI,eAAe,OACrB,QAAO,OAAO,eAAe,IAAI,WAAW,UAAU,CAAC;EAEzD,MAAM,QAAQ,OAAO,UAAU;EAC/B,MAAM,UAAU,UAAU,KAAK,GAAG,IAAI,GAAG,UAAU;EACnD,MAAM,OAAO,eAAe,IAAI,QAAQ,oBAAoB;EAC5D,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,QAAQ,EAAC,gBAAgB,oBAAmB,CAAC;AACjE,OAAI,gBAAgB,OAClB,SAAQ,IAAI,6BAA6B,YAAY;AAEvD,WAAQ,IAAI,cAAc,KAAK,UAAU;AAazC,UAAO,cALU,MAAM,gBAAgB;IACrC,SARc,iBACd,SACA,SACA,SACA,YACA,KACD;IAGC;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,sBAAsB;;AAEvD,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
@@ -1,7 +1,3 @@
1
- /**
2
- * @module v1
3
- */
4
- export { SecretsClient } from './client';
5
- export type { CreateSecretRequest, DeleteSecretRequest, GetSecretRequest, ListSecretsRequest, ListSecretsResponse, Secret, UpdateSecretRequest, } from './model';
6
- export { secretFieldMask } from './model';
7
- //# sourceMappingURL=index.d.ts.map
1
+ import { CreateSecretRequest, DeleteSecretRequest, GetSecretRequest, ListSecretsRequest, ListSecretsResponse, Secret, UpdateSecretRequest, secretFieldMask } from "./model.js";
2
+ import { SecretsClient } from "./client.js";
3
+ export { type CreateSecretRequest, type DeleteSecretRequest, type GetSecretRequest, type ListSecretsRequest, type ListSecretsResponse, type Secret, SecretsClient, type UpdateSecretRequest, secretFieldMask };
package/dist/v1/index.js CHANGED
@@ -1,7 +1,4 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
- /**
3
- * @module v1
4
- */
5
- export { SecretsClient } from './client';
6
- export { secretFieldMask } from './model';
7
- //# sourceMappingURL=index.js.map
1
+ import { secretFieldMask } from "./model.js";
2
+ import { SecretsClient } from "./client.js";
3
+
4
+ export { SecretsClient, secretFieldMask };
@@ -1,146 +1,155 @@
1
- import { Temporal } from '@js-temporal/polyfill';
2
- import { FieldMask } from '@databricks/sdk-core/wkt';
3
- import { z } from 'zod';
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { FieldMask } from "@databricks/sdk-core/wkt";
3
+ import { z } from "zod";
4
+
5
+ //#region src/v1/model.d.ts
4
6
  /** Request message for CreateSecret. */
5
- export interface CreateSecretRequest {
6
- /**
7
- * The secret object to create. The **name**, **catalog_name**, **schema_name**, and **value**
8
- * fields are required.
9
- */
10
- secret?: Secret | undefined;
7
+ interface CreateSecretRequest {
8
+ /**
9
+ * The secret object to create. The **name**, **catalog_name**, **schema_name**, and **value**
10
+ * fields are required.
11
+ */
12
+ secret?: Secret | undefined;
11
13
  }
12
14
  /** Request message for DeleteSecret. */
13
- export interface DeleteSecretRequest {
14
- /**
15
- * The three-level (fully qualified) name of the secret
16
- * (for example, **catalog_name.schema_name.secret_name**).
17
- */
18
- fullName?: string | undefined;
15
+ interface DeleteSecretRequest {
16
+ /**
17
+ * The three-level (fully qualified) name of the secret
18
+ * (for example, **catalog_name.schema_name.secret_name**).
19
+ */
20
+ fullName?: string | undefined;
19
21
  }
20
22
  /** Request message for GetSecret. */
21
- export interface GetSecretRequest {
22
- /**
23
- * The three-level (fully qualified) name of the secret
24
- * (for example, **catalog_name.schema_name.secret_name**).
25
- */
26
- fullName?: string | undefined;
23
+ interface GetSecretRequest {
24
+ /**
25
+ * The three-level (fully qualified) name of the secret
26
+ * (for example, **catalog_name.schema_name.secret_name**).
27
+ */
28
+ fullName?: string | undefined;
29
+ /**
30
+ * Whether to include the secret value in the response. Defaults to false. Requires the
31
+ * **READ_SECRET** privilege.
32
+ */
33
+ includeValue?: boolean | undefined;
27
34
  }
28
35
  /** Request message for ListSecrets. */
29
- export interface ListSecretsRequest {
30
- /**
31
- * The name of the catalog under which to list secrets. Both **catalog_name** and
32
- * **schema_name** must be specified together.
33
- */
34
- catalogName?: string | undefined;
35
- /**
36
- * The name of the schema under which to list secrets. Both **catalog_name** and
37
- * **schema_name** must be specified together.
38
- */
39
- schemaName?: string | undefined;
40
- /**
41
- * Opaque pagination token to go to the next page based on previous query. The maximum page length
42
- * is determined by a server configured value.
43
- */
44
- pageToken?: string | undefined;
45
- /**
46
- * Maximum number of secrets to return.
47
- *
48
- * - If not specified, at most 1000 secrets are returned.
49
- * - If set to a value greater than 0, the page length is the minimum of this value and 1000.
50
- * - If set to 0, the page length is set to 1000.
51
- * - If set to a value less than 0, an invalid parameter error is returned.
52
- */
53
- pageSize?: number | undefined;
36
+ interface ListSecretsRequest {
37
+ /**
38
+ * The name of the catalog under which to list secrets. Both **catalog_name** and
39
+ * **schema_name** must be specified together.
40
+ */
41
+ catalogName?: string | undefined;
42
+ /**
43
+ * The name of the schema under which to list secrets. Both **catalog_name** and
44
+ * **schema_name** must be specified together.
45
+ */
46
+ schemaName?: string | undefined;
47
+ /**
48
+ * Opaque pagination token to go to the next page based on previous query. The maximum page length
49
+ * is determined by a server configured value.
50
+ */
51
+ pageToken?: string | undefined;
52
+ /**
53
+ * Maximum number of secrets to return.
54
+ *
55
+ * - If not specified, at most 1000 secrets are returned.
56
+ * - If set to a value greater than 0, the page length is the minimum of this value and 1000.
57
+ * - If set to 0, the page length is set to 1000.
58
+ * - If set to a value less than 0, an invalid parameter error is returned.
59
+ */
60
+ pageSize?: number | undefined;
54
61
  }
55
62
  /** Response message for ListSecrets. */
56
- export interface ListSecretsResponse {
57
- /** An array of secret objects. */
58
- secrets?: Secret[] | undefined;
59
- /**
60
- * Opaque token to retrieve the next page of results. Absent if there are no more pages.
61
- * **page_token** should be set to this value for the next request.
62
- */
63
- nextPageToken?: string | undefined;
63
+ interface ListSecretsResponse {
64
+ /** An array of secret objects. */
65
+ secrets?: Secret[] | undefined;
66
+ /**
67
+ * Opaque token to retrieve the next page of results. Absent if there are no more pages.
68
+ * **page_token** should be set to this value for the next request.
69
+ */
70
+ nextPageToken?: string | undefined;
64
71
  }
65
72
  /**
66
73
  * A secret stored in Unity Catalog. Secrets are three-level namespace objects
67
74
  * (catalog.schema.secret) that securely store sensitive credential data such as
68
75
  * passwords, tokens, and keys.
69
76
  */
70
- export interface Secret {
71
- /** The name of the secret, relative to its parent schema. */
72
- name?: string | undefined;
73
- /**
74
- * The owner of the secret. Defaults to the creating principal on creation. Can be updated to
75
- * transfer ownership of the secret to another principal.
76
- */
77
- owner?: string | undefined;
78
- /**
79
- * The effective owner of the secret, which may differ from the directly-set **owner** due to
80
- * inheritance.
81
- */
82
- effectiveOwner?: string | undefined;
83
- /** Unique identifier of the metastore hosting the secret. */
84
- metastoreId?: string | undefined;
85
- /** The time at which this secret was created. */
86
- createTime?: Temporal.Instant | undefined;
87
- /** The principal that created the secret. */
88
- createdBy?: string | undefined;
89
- /** The time at which this secret was last updated. */
90
- updateTime?: Temporal.Instant | undefined;
91
- /** The principal that last updated the secret. */
92
- updatedBy?: string | undefined;
93
- /** User-provided free-form text description of the secret. */
94
- comment?: string | undefined;
95
- /** The three-level (fully qualified) name of the secret, in the form of **catalog_name.schema_name.secret_name**. */
96
- fullName?: string | undefined;
97
- /** The name of the catalog where the schema and the secret reside. */
98
- catalogName?: string | undefined;
99
- /** The name of the schema where the secret resides. */
100
- schemaName?: string | undefined;
101
- /**
102
- * The secret value to store. This field is input-only and is not returned in responses — use
103
- * the **effective_value** field (via GetSecret with **include_value** set to true) to read the
104
- * secret value. The maximum size is 60 KiB (pre-encryption). Accepted content includes
105
- * passwords, tokens, keys, and other sensitive credential data.
106
- */
107
- value?: string | undefined;
108
- /**
109
- * The secret value. Only populated in responses when you have the **READ_SECRET**
110
- * privilege and **include_value** is set to true in the request. The maximum size is 60 KiB.
111
- */
112
- effectiveValue?: string | undefined;
113
- /**
114
- * User-provided expiration time of the secret. This field indicates when the secret should no
115
- * longer be used and may be displayed as a warning in the UI. It is purely informational and
116
- * does not trigger any automatic actions or affect the secret's lifecycle.
117
- */
118
- expireTime?: Temporal.Instant | undefined;
77
+ interface Secret {
78
+ /** The name of the secret, relative to its parent schema. */
79
+ name?: string | undefined;
80
+ /**
81
+ * The owner of the secret. Defaults to the creating principal on creation. Can be updated to
82
+ * transfer ownership of the secret to another principal.
83
+ */
84
+ owner?: string | undefined;
85
+ /**
86
+ * The effective owner of the secret, which may differ from the directly-set **owner** due to
87
+ * inheritance.
88
+ */
89
+ effectiveOwner?: string | undefined;
90
+ /** Unique identifier of the metastore hosting the secret. */
91
+ metastoreId?: string | undefined;
92
+ /** The time at which this secret was created. */
93
+ createTime?: Temporal.Instant | undefined;
94
+ /** The principal that created the secret. */
95
+ createdBy?: string | undefined;
96
+ /** The time at which this secret was last updated. */
97
+ updateTime?: Temporal.Instant | undefined;
98
+ /** The principal that last updated the secret. */
99
+ updatedBy?: string | undefined;
100
+ /** User-provided free-form text description of the secret. */
101
+ comment?: string | undefined;
102
+ /** The three-level (fully qualified) name of the secret, in the form of **catalog_name.schema_name.secret_name**. */
103
+ fullName?: string | undefined;
104
+ /** The name of the catalog where the schema and the secret reside. */
105
+ catalogName?: string | undefined;
106
+ /** The name of the schema where the secret resides. */
107
+ schemaName?: string | undefined;
108
+ /**
109
+ * The secret value to store. This field is input-only and is not returned in responses — use
110
+ * the **effective_value** field (via GetSecret with **include_value** set to true) to read the
111
+ * secret value. The maximum size is 60 KiB (pre-encryption). Accepted content includes
112
+ * passwords, tokens, keys, and other sensitive credential data.
113
+ */
114
+ value?: string | undefined;
115
+ /**
116
+ * The secret value. Only populated in responses when you have the **READ_SECRET**
117
+ * privilege and **include_value** is set to true in the request. The maximum size is 60 KiB.
118
+ */
119
+ effectiveValue?: string | undefined;
120
+ /**
121
+ * User-provided expiration time of the secret. This field indicates when the secret should no
122
+ * longer be used and may be displayed as a warning in the UI. It is purely informational and
123
+ * does not trigger any automatic actions or affect the secret's lifecycle.
124
+ */
125
+ expireTime?: Temporal.Instant | undefined;
119
126
  }
120
127
  /** Request message for UpdateSecret. */
121
- export interface UpdateSecretRequest {
122
- /**
123
- * The three-level (fully qualified) name of the secret
124
- * (for example, **catalog_name.schema_name.secret_name**).
125
- */
126
- fullName?: string | undefined;
127
- /**
128
- * The secret object containing the fields to update. Only fields specified in **update_mask**
129
- * will be updated.
130
- */
131
- secret?: Secret | undefined;
132
- /**
133
- * The field mask specifying which fields of the secret to update.
134
- * - If **update_mask** is **"*"**, all fields specified in **secret** are updated.
135
- * - If **update_mask** specifies one or more fields, only those fields are updated.
136
- * Each specified field must be set in **secret**.
137
- * Supported fields: **value**, **comment**, **owner**, **expire_time**. To change the secret
138
- * name, delete and recreate the secret.
139
- */
140
- updateMask?: FieldMask<Secret> | undefined;
128
+ interface UpdateSecretRequest {
129
+ /**
130
+ * The three-level (fully qualified) name of the secret
131
+ * (for example, **catalog_name.schema_name.secret_name**).
132
+ */
133
+ fullName?: string | undefined;
134
+ /**
135
+ * The secret object containing the fields to update. Only fields specified in **update_mask**
136
+ * will be updated.
137
+ */
138
+ secret?: Secret | undefined;
139
+ /**
140
+ * The field mask specifying which fields of the secret to update.
141
+ * - If **update_mask** is **"*"**, all fields specified in **secret** are updated.
142
+ * - If **update_mask** specifies one or more fields, only those fields are updated.
143
+ * Each specified field must be set in **secret**.
144
+ * Supported fields: **value**, **comment**, **owner**, **expire_time**. To change the secret
145
+ * name, delete and recreate the secret.
146
+ */
147
+ updateMask?: FieldMask<Secret> | undefined;
141
148
  }
142
- export declare const unmarshalListSecretsResponseSchema: z.ZodType<ListSecretsResponse>;
143
- export declare const unmarshalSecretSchema: z.ZodType<Secret>;
144
- export declare const marshalSecretSchema: z.ZodType;
145
- export declare function secretFieldMask(...paths: string[]): FieldMask<Secret>;
149
+ declare const unmarshalListSecretsResponseSchema: z.ZodType<ListSecretsResponse>;
150
+ declare const unmarshalSecretSchema: z.ZodType<Secret>;
151
+ declare const marshalSecretSchema: z.ZodType;
152
+ declare function secretFieldMask(...paths: string[]): FieldMask<Secret>;
153
+ //#endregion
154
+ export { CreateSecretRequest, DeleteSecretRequest, GetSecretRequest, ListSecretsRequest, ListSecretsResponse, Secret, UpdateSecretRequest, marshalSecretSchema, secretFieldMask, unmarshalListSecretsResponseSchema, unmarshalSecretSchema };
146
155
  //# sourceMappingURL=model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC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jD,SAAA;EAwD4E;EAtD5E,UAAA,GAAa,QAAA,CAAS,OAAA;EAiEX;EA/DX,SAAA;;EAEA,OAAA;EA6DkC;EA3DlC,QAAA;EA2D4C;EAzD5C,WAAA;EAyDkD;EAvDlD,UAAA;EA+IG;;;;AAoBL;;EA5JE,KAAA;EA4J4D;;;;EAvJ5D,cAAA;EAuJmE;;;;;EAjJnE,UAAA,GAAa,QAAA,CAAS,OAAA;AAAA;;UAIP,mBAAA;;;;;EAKf,QAAA;;;;;EAKA,MAAA,GAAS,MAAA;;;;;;;;;EAST,UAAA,GAAa,SAAA,CAAU,MAAA;AAAA;AAAA,cAGZ,kCAAA,EAAoC,CAAA,CAAE,OAAA,CAAQ,mBAAA;AAAA,cAW9C,qBAAA,EAAuB,CAAA,CAAE,OAAA,CAAQ,MAAA;AAAA,cA6CjC,mBAAA,EAAqB,CAAA,CAAE,OAAA;AAAA,iBA+DpB,eAAA,CAAA,GAAmB,KAAA,aAAkB,SAAA,CAAU,MAAA"}
package/dist/v1/model.js CHANGED
@@ -1,122 +1,102 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
- import { Temporal } from '@js-temporal/polyfill';
3
- import { FieldMask } from '@databricks/sdk-core/wkt';
4
- import { z } from 'zod';
5
- export const unmarshalListSecretsResponseSchema = z
6
- .object({
7
- secrets: z.array(z.lazy(() => unmarshalSecretSchema)).optional(),
8
- next_page_token: z.string().optional(),
9
- })
10
- .transform(d => ({
11
- secrets: d.secrets,
12
- nextPageToken: d.next_page_token,
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { FieldMask } from "@databricks/sdk-core/wkt";
3
+ import { z } from "zod";
4
+
5
+ //#region src/v1/model.ts
6
+ const unmarshalListSecretsResponseSchema = z.object({
7
+ secrets: z.array(z.lazy(() => unmarshalSecretSchema)).optional(),
8
+ next_page_token: z.string().optional()
9
+ }).transform((d) => ({
10
+ secrets: d.secrets,
11
+ nextPageToken: d.next_page_token
13
12
  }));
14
- export const unmarshalSecretSchema = z
15
- .object({
16
- name: z.string().optional(),
17
- owner: z.string().optional(),
18
- effective_owner: z.string().optional(),
19
- metastore_id: z.string().optional(),
20
- create_time: z
21
- .string()
22
- .transform(s => Temporal.Instant.from(s))
23
- .optional(),
24
- created_by: z.string().optional(),
25
- update_time: z
26
- .string()
27
- .transform(s => Temporal.Instant.from(s))
28
- .optional(),
29
- updated_by: z.string().optional(),
30
- comment: z.string().optional(),
31
- full_name: z.string().optional(),
32
- catalog_name: z.string().optional(),
33
- schema_name: z.string().optional(),
34
- value: z.string().optional(),
35
- effective_value: z.string().optional(),
36
- expire_time: z
37
- .string()
38
- .transform(s => Temporal.Instant.from(s))
39
- .optional(),
40
- })
41
- .transform(d => ({
42
- name: d.name,
43
- owner: d.owner,
44
- effectiveOwner: d.effective_owner,
45
- metastoreId: d.metastore_id,
46
- createTime: d.create_time,
47
- createdBy: d.created_by,
48
- updateTime: d.update_time,
49
- updatedBy: d.updated_by,
50
- comment: d.comment,
51
- fullName: d.full_name,
52
- catalogName: d.catalog_name,
53
- schemaName: d.schema_name,
54
- value: d.value,
55
- effectiveValue: d.effective_value,
56
- expireTime: d.expire_time,
13
+ const unmarshalSecretSchema = z.object({
14
+ name: z.string().optional(),
15
+ owner: z.string().optional(),
16
+ effective_owner: z.string().optional(),
17
+ metastore_id: z.string().optional(),
18
+ create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
19
+ created_by: z.string().optional(),
20
+ update_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
21
+ updated_by: z.string().optional(),
22
+ comment: z.string().optional(),
23
+ full_name: z.string().optional(),
24
+ catalog_name: z.string().optional(),
25
+ schema_name: z.string().optional(),
26
+ value: z.string().optional(),
27
+ effective_value: z.string().optional(),
28
+ expire_time: z.string().transform((s) => Temporal.Instant.from(s)).optional()
29
+ }).transform((d) => ({
30
+ name: d.name,
31
+ owner: d.owner,
32
+ effectiveOwner: d.effective_owner,
33
+ metastoreId: d.metastore_id,
34
+ createTime: d.create_time,
35
+ createdBy: d.created_by,
36
+ updateTime: d.update_time,
37
+ updatedBy: d.updated_by,
38
+ comment: d.comment,
39
+ fullName: d.full_name,
40
+ catalogName: d.catalog_name,
41
+ schemaName: d.schema_name,
42
+ value: d.value,
43
+ effectiveValue: d.effective_value,
44
+ expireTime: d.expire_time
57
45
  }));
58
- export const marshalSecretSchema = z
59
- .object({
60
- name: z.string().optional(),
61
- owner: z.string().optional(),
62
- effectiveOwner: z.string().optional(),
63
- metastoreId: z.string().optional(),
64
- createTime: z
65
- .any()
66
- .transform((d) => d.toString())
67
- .optional(),
68
- createdBy: z.string().optional(),
69
- updateTime: z
70
- .any()
71
- .transform((d) => d.toString())
72
- .optional(),
73
- updatedBy: z.string().optional(),
74
- comment: z.string().optional(),
75
- fullName: z.string().optional(),
76
- catalogName: z.string().optional(),
77
- schemaName: z.string().optional(),
78
- value: z.string().optional(),
79
- effectiveValue: z.string().optional(),
80
- expireTime: z
81
- .any()
82
- .transform((d) => d.toString())
83
- .optional(),
84
- })
85
- .transform(d => ({
86
- name: d.name,
87
- owner: d.owner,
88
- effective_owner: d.effectiveOwner,
89
- metastore_id: d.metastoreId,
90
- create_time: d.createTime,
91
- created_by: d.createdBy,
92
- update_time: d.updateTime,
93
- updated_by: d.updatedBy,
94
- comment: d.comment,
95
- full_name: d.fullName,
96
- catalog_name: d.catalogName,
97
- schema_name: d.schemaName,
98
- value: d.value,
99
- effective_value: d.effectiveValue,
100
- expire_time: d.expireTime,
46
+ const marshalSecretSchema = z.object({
47
+ name: z.string().optional(),
48
+ owner: z.string().optional(),
49
+ effectiveOwner: z.string().optional(),
50
+ metastoreId: z.string().optional(),
51
+ createTime: z.any().transform((d) => d.toString()).optional(),
52
+ createdBy: z.string().optional(),
53
+ updateTime: z.any().transform((d) => d.toString()).optional(),
54
+ updatedBy: z.string().optional(),
55
+ comment: z.string().optional(),
56
+ fullName: z.string().optional(),
57
+ catalogName: z.string().optional(),
58
+ schemaName: z.string().optional(),
59
+ value: z.string().optional(),
60
+ effectiveValue: z.string().optional(),
61
+ expireTime: z.any().transform((d) => d.toString()).optional()
62
+ }).transform((d) => ({
63
+ name: d.name,
64
+ owner: d.owner,
65
+ effective_owner: d.effectiveOwner,
66
+ metastore_id: d.metastoreId,
67
+ create_time: d.createTime,
68
+ created_by: d.createdBy,
69
+ update_time: d.updateTime,
70
+ updated_by: d.updatedBy,
71
+ comment: d.comment,
72
+ full_name: d.fullName,
73
+ catalog_name: d.catalogName,
74
+ schema_name: d.schemaName,
75
+ value: d.value,
76
+ effective_value: d.effectiveValue,
77
+ expire_time: d.expireTime
101
78
  }));
102
79
  const secretFieldMaskSchema = {
103
- catalogName: { wire: 'catalog_name' },
104
- comment: { wire: 'comment' },
105
- createTime: { wire: 'create_time' },
106
- createdBy: { wire: 'created_by' },
107
- effectiveOwner: { wire: 'effective_owner' },
108
- effectiveValue: { wire: 'effective_value' },
109
- expireTime: { wire: 'expire_time' },
110
- fullName: { wire: 'full_name' },
111
- metastoreId: { wire: 'metastore_id' },
112
- name: { wire: 'name' },
113
- owner: { wire: 'owner' },
114
- schemaName: { wire: 'schema_name' },
115
- updateTime: { wire: 'update_time' },
116
- updatedBy: { wire: 'updated_by' },
117
- value: { wire: 'value' },
80
+ catalogName: { wire: "catalog_name" },
81
+ comment: { wire: "comment" },
82
+ createTime: { wire: "create_time" },
83
+ createdBy: { wire: "created_by" },
84
+ effectiveOwner: { wire: "effective_owner" },
85
+ effectiveValue: { wire: "effective_value" },
86
+ expireTime: { wire: "expire_time" },
87
+ fullName: { wire: "full_name" },
88
+ metastoreId: { wire: "metastore_id" },
89
+ name: { wire: "name" },
90
+ owner: { wire: "owner" },
91
+ schemaName: { wire: "schema_name" },
92
+ updateTime: { wire: "update_time" },
93
+ updatedBy: { wire: "updated_by" },
94
+ value: { wire: "value" }
118
95
  };
119
- export function secretFieldMask(...paths) {
120
- return FieldMask.build(paths, secretFieldMaskSchema);
96
+ function secretFieldMask(...paths) {
97
+ return FieldMask.build(paths, secretFieldMaskSchema);
121
98
  }
99
+
100
+ //#endregion
101
+ export { marshalSecretSchema, secretFieldMask, unmarshalListSecretsResponseSchema, unmarshalSecretSchema };
122
102
  //# sourceMappingURL=model.js.map