@databricks/sdk-tokens 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.
@@ -0,0 +1,7 @@
1
+ //#region package.json
2
+ var name = "@databricks/sdk-tokens";
3
+ var version = "0.36.0";
4
+
5
+ //#endregion
6
+ export { name, version };
7
+ //# sourceMappingURL=package.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
@@ -1,32 +1,36 @@
1
- import type { CallOptions } from '@databricks/sdk-options/call';
2
- import type { ClientOptions } from '@databricks/sdk-options/client';
3
- import type { CreateTokenRequest, CreateTokenResponse, ListTokensRequest, ListTokensResponse, RevokeTokenRequest, RevokeTokenResponse, UpdateTokenRequest, UpdateTokenResponse } from './model';
4
- export declare class TokensClient {
5
- private readonly options;
6
- private readonly logger;
7
- private readonly userAgent;
8
- private config;
9
- constructor(options: ClientOptions);
10
- private resolveConfig;
11
- /**
12
- * Creates and returns a token for a user. If this call is made through token authentication, it creates
13
- * a token with the same client ID as the authenticated token. If the user's token quota is exceeded, this call
14
- * returns an error **QUOTA_EXCEEDED**.
15
- */
16
- createToken(req: CreateTokenRequest, options?: CallOptions): Promise<CreateTokenResponse>;
17
- /** Lists all the valid tokens for a user-workspace pair. */
18
- listTokens(_req: ListTokensRequest, options?: CallOptions): Promise<ListTokensResponse>;
19
- /**
20
- * Revokes an access token.
21
- *
22
- * If a token with the specified ID is not valid, this call returns an error **RESOURCE_DOES_NOT_EXIST**.
23
- */
24
- revokeToken(req: RevokeTokenRequest, options?: CallOptions): Promise<RevokeTokenResponse>;
25
- /**
26
- * Updates the comment or scopes of a token.
27
- *
28
- * If a token with the specified ID is not valid, this call returns an error **NOT_FOUND**.
29
- */
30
- updateToken(req: UpdateTokenRequest, options?: CallOptions): Promise<UpdateTokenResponse>;
1
+ import { CreateTokenRequest, CreateTokenResponse, ListTokensRequest, ListTokensResponse, RevokeTokenRequest, RevokeTokenResponse, UpdateTokenRequest, UpdateTokenResponse } from "./model.js";
2
+ import { CallOptions } from "@databricks/sdk-options/call";
3
+ import { ClientOptions } from "@databricks/sdk-options/client";
4
+
5
+ //#region src/v1/client.d.ts
6
+ declare class TokensClient {
7
+ private readonly options;
8
+ private readonly logger;
9
+ private readonly userAgent;
10
+ private config;
11
+ constructor(options: ClientOptions);
12
+ private resolveConfig;
13
+ /**
14
+ * Creates and returns a token for a user. If this call is made through token authentication, it creates
15
+ * a token with the same client ID as the authenticated token. If the user's token quota is exceeded, this call
16
+ * returns an error **QUOTA_EXCEEDED**.
17
+ */
18
+ createToken(req: CreateTokenRequest, options?: CallOptions): Promise<CreateTokenResponse>;
19
+ /** Lists all the valid tokens for a user-workspace pair. */
20
+ listTokens(_req: ListTokensRequest, options?: CallOptions): Promise<ListTokensResponse>;
21
+ /**
22
+ * Revokes an access token.
23
+ *
24
+ * If a token with the specified ID is not valid, this call returns an error **RESOURCE_DOES_NOT_EXIST**.
25
+ */
26
+ revokeToken(req: RevokeTokenRequest, options?: CallOptions): Promise<RevokeTokenResponse>;
27
+ /**
28
+ * Updates the comment or scopes of a token.
29
+ *
30
+ * If a token with the specified ID is not valid, this call returns an error **NOT_FOUND**.
31
+ */
32
+ updateToken(req: UpdateTokenRequest, options?: CallOptions): Promise<UpdateTokenResponse>;
31
33
  }
34
+ //#endregion
35
+ export { TokensClient };
32
36
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAWlE,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EA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kCR;;;;;EAHG,WAAA,CACJ,GAAA,EAAK,kBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,mBAAA;AAAA"}
package/dist/v1/client.js CHANGED
@@ -1,154 +1,129 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
- import { VERSION as AUTH_VERSION } from '@databricks/sdk-auth';
3
- import { createDefault } from '@databricks/sdk-core/clientinfo';
4
- import { NoOpLogger } from '@databricks/sdk-core/logger';
5
- import { resolveClientConfig } from './transport';
6
- import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
7
- import pkgJson from '../../package.json' with { type: 'json' };
8
- import { marshalCreateTokenRequestSchema, marshalRevokeTokenRequestSchema, marshalUpdateTokenRequestSchema, unmarshalCreateTokenResponseSchema, unmarshalListTokensResponseSchema, unmarshalRevokeTokenResponseSchema, unmarshalUpdateTokenResponseSchema, } from './model';
9
- // Package identity segment for this client to be used in the User-Agent header.
1
+ import { resolveClientConfig } from "./transport.js";
2
+ import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse } from "./utils.js";
3
+ import { name, version } from "../package.js";
4
+ import { marshalCreateTokenRequestSchema, marshalRevokeTokenRequestSchema, marshalUpdateTokenRequestSchema, unmarshalCreateTokenResponseSchema, unmarshalListTokensResponseSchema, unmarshalRevokeTokenResponseSchema, unmarshalUpdateTokenResponseSchema } from "./model.js";
5
+ import { VERSION } from "@databricks/sdk-auth";
6
+ import { createDefault } from "@databricks/sdk-core/clientinfo";
7
+ import { NoOpLogger } from "@databricks/sdk-core/logger";
8
+
9
+ //#region src/v1/client.ts
10
10
  const PACKAGE_SEGMENT = {
11
- key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
12
- value: pkgJson.version,
11
+ key: "sdk-js-" + name.replace(/^@[^/]+\/sdk-/, ""),
12
+ value: version
13
13
  };
14
- export class TokensClient {
15
- options;
16
- logger;
17
- // User-Agent header value. Composed once at construction from
18
- // createDefault() merged with this package's identity and the active
19
- // credential's name.
20
- userAgent;
21
- // Memoized configuration. The profile is resolved once, lazily, on the first
22
- // request, then reused; host, workspaceId/accountId, and credentials are
23
- // filled from it when not set explicitly on the options.
24
- config;
25
- constructor(options) {
26
- this.options = options;
27
- this.logger = options.logger ?? new NoOpLogger();
28
- const info = createDefault()
29
- .with(PACKAGE_SEGMENT)
30
- .with({ key: 'sdk-js-auth', value: AUTH_VERSION })
31
- .with({ key: 'auth', value: options.credentials?.name() ?? 'default' });
32
- this.userAgent = info.toString();
33
- }
34
- resolveConfig() {
35
- this.config ??= resolveClientConfig(this.options);
36
- return this.config;
37
- }
38
- /**
39
- * Creates and returns a token for a user. If this call is made through token authentication, it creates
40
- * a token with the same client ID as the authenticated token. If the user's token quota is exceeded, this call
41
- * returns an error **QUOTA_EXCEEDED**.
42
- */
43
- async createToken(req, options) {
44
- const { host, workspaceId, httpClient } = await this.resolveConfig();
45
- const url = `${host}/api/2.0/token/create`;
46
- const body = marshalRequest(req, marshalCreateTokenRequestSchema);
47
- let resp;
48
- const call = async (callSignal) => {
49
- const headers = new Headers({ 'Content-Type': 'application/json' });
50
- if (workspaceId !== undefined) {
51
- headers.set('X-Databricks-Workspace-Id', workspaceId);
52
- }
53
- headers.set('User-Agent', this.userAgent);
54
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
55
- const respBody = await executeHttpCall({
56
- request: httpReq,
57
- httpClient,
58
- logger: this.logger,
59
- });
60
- resp = parseResponse(respBody, unmarshalCreateTokenResponseSchema);
61
- };
62
- await executeCall(call, options);
63
- if (resp === undefined) {
64
- throw new Error('operation completed without a result.');
65
- }
66
- return resp;
67
- }
68
- /** Lists all the valid tokens for a user-workspace pair. */
69
- async listTokens(_req, options) {
70
- const { host, workspaceId, httpClient } = await this.resolveConfig();
71
- const url = `${host}/api/2.0/token/list`;
72
- let resp;
73
- const call = async (callSignal) => {
74
- const headers = new Headers();
75
- if (workspaceId !== undefined) {
76
- headers.set('X-Databricks-Workspace-Id', workspaceId);
77
- }
78
- headers.set('User-Agent', this.userAgent);
79
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
80
- const respBody = await executeHttpCall({
81
- request: httpReq,
82
- httpClient,
83
- logger: this.logger,
84
- });
85
- resp = parseResponse(respBody, unmarshalListTokensResponseSchema);
86
- };
87
- await executeCall(call, options);
88
- if (resp === undefined) {
89
- throw new Error('operation completed without a result.');
90
- }
91
- return resp;
92
- }
93
- /**
94
- * Revokes an access token.
95
- *
96
- * If a token with the specified ID is not valid, this call returns an error **RESOURCE_DOES_NOT_EXIST**.
97
- */
98
- async revokeToken(req, options) {
99
- const { host, workspaceId, httpClient } = await this.resolveConfig();
100
- const url = `${host}/api/2.0/token/delete`;
101
- const body = marshalRequest(req, marshalRevokeTokenRequestSchema);
102
- let resp;
103
- const call = async (callSignal) => {
104
- const headers = new Headers({ 'Content-Type': 'application/json' });
105
- if (workspaceId !== undefined) {
106
- headers.set('X-Databricks-Workspace-Id', workspaceId);
107
- }
108
- headers.set('User-Agent', this.userAgent);
109
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
110
- const respBody = await executeHttpCall({
111
- request: httpReq,
112
- httpClient,
113
- logger: this.logger,
114
- });
115
- resp = parseResponse(respBody, unmarshalRevokeTokenResponseSchema);
116
- };
117
- await executeCall(call, options);
118
- if (resp === undefined) {
119
- throw new Error('operation completed without a result.');
120
- }
121
- return resp;
122
- }
123
- /**
124
- * Updates the comment or scopes of a token.
125
- *
126
- * If a token with the specified ID is not valid, this call returns an error **NOT_FOUND**.
127
- */
128
- async updateToken(req, options) {
129
- const { host, workspaceId, httpClient } = await this.resolveConfig();
130
- const url = `${host}/api/2.0/token/${req.tokenId ?? ''}`;
131
- const body = marshalRequest(req, marshalUpdateTokenRequestSchema);
132
- let resp;
133
- const call = async (callSignal) => {
134
- const headers = new Headers({ 'Content-Type': 'application/json' });
135
- if (workspaceId !== undefined) {
136
- headers.set('X-Databricks-Workspace-Id', workspaceId);
137
- }
138
- headers.set('User-Agent', this.userAgent);
139
- const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
140
- const respBody = await executeHttpCall({
141
- request: httpReq,
142
- httpClient,
143
- logger: this.logger,
144
- });
145
- resp = parseResponse(respBody, unmarshalUpdateTokenResponseSchema);
146
- };
147
- await executeCall(call, options);
148
- if (resp === undefined) {
149
- throw new Error('operation completed without a result.');
150
- }
151
- return resp;
152
- }
153
- }
14
+ var TokensClient = class {
15
+ options;
16
+ logger;
17
+ userAgent;
18
+ config;
19
+ constructor(options) {
20
+ this.options = options;
21
+ this.logger = options.logger ?? new NoOpLogger();
22
+ this.userAgent = createDefault().with(PACKAGE_SEGMENT).with({
23
+ key: "sdk-js-auth",
24
+ value: VERSION
25
+ }).with({
26
+ key: "auth",
27
+ value: options.credentials?.name() ?? "default"
28
+ }).toString();
29
+ }
30
+ resolveConfig() {
31
+ this.config ??= resolveClientConfig(this.options);
32
+ return this.config;
33
+ }
34
+ /**
35
+ * Creates and returns a token for a user. If this call is made through token authentication, it creates
36
+ * a token with the same client ID as the authenticated token. If the user's token quota is exceeded, this call
37
+ * returns an error **QUOTA_EXCEEDED**.
38
+ */
39
+ async createToken(req, options) {
40
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
41
+ const url = `${host}/api/2.0/token/create`;
42
+ const body = marshalRequest(req, marshalCreateTokenRequestSchema);
43
+ let resp;
44
+ const call = async (callSignal) => {
45
+ const headers = new Headers({ "Content-Type": "application/json" });
46
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
47
+ headers.set("User-Agent", this.userAgent);
48
+ resp = parseResponse(await executeHttpCall({
49
+ request: buildHttpRequest("POST", url, headers, callSignal, body),
50
+ httpClient,
51
+ logger: this.logger
52
+ }), unmarshalCreateTokenResponseSchema);
53
+ };
54
+ await executeCall(call, options);
55
+ if (resp === void 0) throw new Error("operation completed without a result.");
56
+ return resp;
57
+ }
58
+ /** Lists all the valid tokens for a user-workspace pair. */
59
+ async listTokens(_req, options) {
60
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
61
+ const url = `${host}/api/2.0/token/list`;
62
+ let resp;
63
+ const call = async (callSignal) => {
64
+ const headers = new Headers();
65
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
66
+ headers.set("User-Agent", this.userAgent);
67
+ resp = parseResponse(await executeHttpCall({
68
+ request: buildHttpRequest("GET", url, headers, callSignal),
69
+ httpClient,
70
+ logger: this.logger
71
+ }), unmarshalListTokensResponseSchema);
72
+ };
73
+ await executeCall(call, options);
74
+ if (resp === void 0) throw new Error("operation completed without a result.");
75
+ return resp;
76
+ }
77
+ /**
78
+ * Revokes an access token.
79
+ *
80
+ * If a token with the specified ID is not valid, this call returns an error **RESOURCE_DOES_NOT_EXIST**.
81
+ */
82
+ async revokeToken(req, options) {
83
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
84
+ const url = `${host}/api/2.0/token/delete`;
85
+ const body = marshalRequest(req, marshalRevokeTokenRequestSchema);
86
+ let resp;
87
+ const call = async (callSignal) => {
88
+ const headers = new Headers({ "Content-Type": "application/json" });
89
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
90
+ headers.set("User-Agent", this.userAgent);
91
+ resp = parseResponse(await executeHttpCall({
92
+ request: buildHttpRequest("POST", url, headers, callSignal, body),
93
+ httpClient,
94
+ logger: this.logger
95
+ }), unmarshalRevokeTokenResponseSchema);
96
+ };
97
+ await executeCall(call, options);
98
+ if (resp === void 0) throw new Error("operation completed without a result.");
99
+ return resp;
100
+ }
101
+ /**
102
+ * Updates the comment or scopes of a token.
103
+ *
104
+ * If a token with the specified ID is not valid, this call returns an error **NOT_FOUND**.
105
+ */
106
+ async updateToken(req, options) {
107
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
108
+ const url = `${host}/api/2.0/token/${req.tokenId ?? ""}`;
109
+ const body = marshalRequest(req, marshalUpdateTokenRequestSchema);
110
+ let resp;
111
+ const call = async (callSignal) => {
112
+ const headers = new Headers({ "Content-Type": "application/json" });
113
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
114
+ headers.set("User-Agent", this.userAgent);
115
+ resp = parseResponse(await executeHttpCall({
116
+ request: buildHttpRequest("PATCH", url, headers, callSignal, body),
117
+ httpClient,
118
+ logger: this.logger
119
+ }), unmarshalUpdateTokenResponseSchema);
120
+ };
121
+ await executeCall(call, options);
122
+ if (resp === void 0) throw new Error("operation completed without a result.");
123
+ return resp;
124
+ }
125
+ };
126
+
127
+ //#endregion
128
+ export { TokensClient };
154
129
  //# sourceMappingURL=client.js.map
@@ -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;AAW7D,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAC/B,+BAA+B,EAC/B,kCAAkC,EAClC,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,GACnC,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,YAAY;IACN,OAAO,C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M,eAAe,CAAC;gBACrC,OAAO,EAAE,OAAO;gBAChB,UAAU;gBACV,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,IAAI,GAAG,aAAa,CAAC,QAAQ,EAAE,kCAAkC,CAAC,CAAC;QACrE,CAAC,CAAC;QACF,MAAM,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,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 CreateTokenRequest,\n CreateTokenResponse,\n ListTokensRequest,\n ListTokensResponse,\n RevokeTokenRequest,\n RevokeTokenResponse,\n UpdateTokenRequest,\n UpdateTokenResponse,\n} from './model';\nimport {\n marshalCreateTokenRequestSchema,\n marshalRevokeTokenRequestSchema,\n marshalUpdateTokenRequestSchema,\n unmarshalCreateTokenResponseSchema,\n unmarshalListTokensResponseSchema,\n unmarshalRevokeTokenResponseSchema,\n unmarshalUpdateTokenResponseSchema,\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 TokensClient {\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 and returns a token for a user. If this call is made through token authentication, it creates\n * a token with the same client ID as the authenticated token. If the user's token quota is exceeded, this call\n * returns an error **QUOTA_EXCEEDED**.\n */\n async createToken(\n req: CreateTokenRequest,\n options?: CallOptions\n ): Promise<CreateTokenResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/token/create`;\n const body = marshalRequest(req, marshalCreateTokenRequestSchema);\n let resp: CreateTokenResponse | 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, unmarshalCreateTokenResponseSchema);\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 /** Lists all the valid tokens for a user-workspace pair. */\n async listTokens(\n _req: ListTokensRequest,\n options?: CallOptions\n ): Promise<ListTokensResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/token/list`;\n let resp: ListTokensResponse | 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', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalListTokensResponseSchema);\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 * Revokes an access token.\n *\n * If a token with the specified ID is not valid, this call returns an error **RESOURCE_DOES_NOT_EXIST**.\n */\n async revokeToken(\n req: RevokeTokenRequest,\n options?: CallOptions\n ): Promise<RevokeTokenResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/token/delete`;\n const body = marshalRequest(req, marshalRevokeTokenRequestSchema);\n let resp: RevokeTokenResponse | 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, unmarshalRevokeTokenResponseSchema);\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 * Updates the comment or scopes of a token.\n *\n * If a token with the specified ID is not valid, this call returns an error **NOT_FOUND**.\n */\n async updateToken(\n req: UpdateTokenRequest,\n options?: CallOptions\n ): Promise<UpdateTokenResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/token/${req.tokenId ?? ''}`;\n const body = marshalRequest(req, marshalUpdateTokenRequestSchema);\n let resp: UpdateTokenResponse | 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('PATCH', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalUpdateTokenResponseSchema);\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":";;;;;;;;;AAuCA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,eAAb,MAA0B;CACxB,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;;;;;;;CAQd,MAAM,YACJ,KACA,SAC8B;EAC9B,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK;EACpB,MAAM,OAAO,eAAe,KAAK,gCAAgC;EACjE,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,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AAU;AAOzC,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,QAAQ,KAAK,SAAS,YAAY,KAAK;IAGtE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,mCAAmC;;AAEpE,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;;;;;;CAQT,MAAM,YACJ,KACA,SAC8B;EAC9B,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK,iBAAiB,IAAI,WAAW;EACpD,MAAM,OAAO,eAAe,KAAK,gCAAgC;EACjE,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,iBAAiB,SAAS,KAAK,SAAS,YAAY,KAAK;IAGvE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,mCAAmC;;AAEpE,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
@@ -1,8 +1,3 @@
1
- /**
2
- * @module v1
3
- */
4
- export { TokensClient } from './client';
5
- export { AutoscopeState } from './model';
6
- export type { CreateTokenRequest, CreateTokenResponse, ListTokensRequest, ListTokensResponse, PublicTokenInfo, RevokeTokenRequest, RevokeTokenResponse, UpdateTokenRequest, UpdateTokenResponse, } from './model';
7
- export { publicTokenInfoFieldMask } from './model';
8
- //# sourceMappingURL=index.d.ts.map
1
+ import { AutoscopeState, CreateTokenRequest, CreateTokenResponse, ListTokensRequest, ListTokensResponse, PublicTokenInfo, RevokeTokenRequest, RevokeTokenResponse, UpdateTokenRequest, UpdateTokenResponse, publicTokenInfoFieldMask } from "./model.js";
2
+ import { TokensClient } from "./client.js";
3
+ export { AutoscopeState, type CreateTokenRequest, type CreateTokenResponse, type ListTokensRequest, type ListTokensResponse, type PublicTokenInfo, type RevokeTokenRequest, type RevokeTokenResponse, TokensClient, type UpdateTokenRequest, type UpdateTokenResponse, publicTokenInfoFieldMask };
package/dist/v1/index.js CHANGED
@@ -1,8 +1,4 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
- /**
3
- * @module v1
4
- */
5
- export { TokensClient } from './client';
6
- export { AutoscopeState } from './model';
7
- export { publicTokenInfoFieldMask } from './model';
8
- //# sourceMappingURL=index.js.map
1
+ import { AutoscopeState, publicTokenInfoFieldMask } from "./model.js";
2
+ import { TokensClient } from "./client.js";
3
+
4
+ export { AutoscopeState, TokensClient, publicTokenInfoFieldMask };
@@ -1,95 +1,96 @@
1
- import { FieldMask } from '@databricks/sdk-core/wkt';
2
- import { z } from 'zod';
1
+ import { FieldMask } from "@databricks/sdk-core/wkt";
2
+ import { z } from "zod";
3
+
4
+ //#region src/v1/model.d.ts
3
5
  /**
4
6
  * State of inferred scope collection (autoscope) for an external PAT.
5
7
  * Mirrored in databricks.identity.AutoscopeState in common/principal-context/api/proto/tokendetails.proto.
6
8
  * Token store and token management proto can depend on this.
7
9
  * Principal context proto should NOT depend on this proto definitions because too many services depend on the principal context proto.
8
10
  */
9
- export declare const AutoscopeState: {
10
- readonly AUTOSCOPE_STATE_UNSPECIFIED: "AUTOSCOPE_STATE_UNSPECIFIED";
11
- readonly AUTOSCOPE_STATE_DISABLED: "AUTOSCOPE_STATE_DISABLED";
12
- readonly AUTOSCOPE_STATE_RUNNING: "AUTOSCOPE_STATE_RUNNING";
13
- readonly AUTOSCOPE_STATE_COMPLETED: "AUTOSCOPE_STATE_COMPLETED";
14
- readonly AUTOSCOPE_STATE_BACKFILLED: "AUTOSCOPE_STATE_BACKFILLED";
15
- readonly AUTOSCOPE_STATE_USER_SELECTED: "AUTOSCOPE_STATE_USER_SELECTED";
16
- readonly AUTOSCOPE_STATE_API_NOT_COVERED: "AUTOSCOPE_STATE_API_NOT_COVERED";
11
+ declare const AutoscopeState: {
12
+ readonly AUTOSCOPE_STATE_UNSPECIFIED: "AUTOSCOPE_STATE_UNSPECIFIED";
13
+ readonly AUTOSCOPE_STATE_DISABLED: "AUTOSCOPE_STATE_DISABLED";
14
+ readonly AUTOSCOPE_STATE_RUNNING: "AUTOSCOPE_STATE_RUNNING";
15
+ readonly AUTOSCOPE_STATE_COMPLETED: "AUTOSCOPE_STATE_COMPLETED";
16
+ readonly AUTOSCOPE_STATE_BACKFILLED: "AUTOSCOPE_STATE_BACKFILLED";
17
+ readonly AUTOSCOPE_STATE_USER_SELECTED: "AUTOSCOPE_STATE_USER_SELECTED";
18
+ readonly AUTOSCOPE_STATE_API_NOT_COVERED: "AUTOSCOPE_STATE_API_NOT_COVERED";
17
19
  };
18
- export type AutoscopeState = (typeof AutoscopeState)[keyof typeof AutoscopeState] | (string & {});
19
- export interface CreateTokenRequest {
20
- /**
21
- * The lifetime of the token, in seconds.
22
- *
23
- * If the lifetime is not specified, this token remains valid for 2 years.
24
- */
25
- lifetimeSeconds?: bigint | undefined;
26
- /** Optional description to attach to the token. */
27
- comment?: string | undefined;
28
- /** Optional scopes of the token. */
29
- scopes?: string[] | undefined;
30
- /**
31
- * Whether to enable autoscoping for this token. When true, the token will
32
- * automatically collect inferred API path scopes as it is used.
33
- */
34
- autoscopeEnabled?: boolean | undefined;
20
+ type AutoscopeState = (typeof AutoscopeState)[keyof typeof AutoscopeState] | (string & {});
21
+ interface CreateTokenRequest {
22
+ /**
23
+ * The lifetime of the token, in seconds.
24
+ *
25
+ * If the lifetime is not specified, this token remains valid for 2 years.
26
+ */
27
+ lifetimeSeconds?: bigint | undefined;
28
+ /** Optional description to attach to the token. */
29
+ comment?: string | undefined;
30
+ /** Optional scopes of the token. */
31
+ scopes?: string[] | undefined;
32
+ /**
33
+ * Whether to enable autoscoping for this token. When true, the token will
34
+ * automatically collect inferred API path scopes as it is used.
35
+ */
36
+ autoscopeEnabled?: boolean | undefined;
35
37
  }
36
- export interface CreateTokenResponse {
37
- /** The value of the new token. */
38
- tokenValue?: string | undefined;
39
- /** The information for the new token. */
40
- tokenInfo?: PublicTokenInfo | undefined;
38
+ interface CreateTokenResponse {
39
+ /** The value of the new token. */
40
+ tokenValue?: string | undefined;
41
+ /** The information for the new token. */
42
+ tokenInfo?: PublicTokenInfo | undefined;
41
43
  }
42
- export interface ListTokensRequest {
44
+ interface ListTokensRequest {}
45
+ interface ListTokensResponse {
46
+ /** The information for each token. */
47
+ tokenInfos?: PublicTokenInfo[] | undefined;
43
48
  }
44
- export interface ListTokensResponse {
45
- /** The information for each token. */
46
- tokenInfos?: PublicTokenInfo[] | undefined;
49
+ interface PublicTokenInfo {
50
+ /** The ID of this token. */
51
+ tokenId?: string | undefined;
52
+ /** Server time (in epoch milliseconds) when the token was created. */
53
+ creationTime?: bigint | undefined;
54
+ /** Server time (in epoch milliseconds) when the token will expire, or -1 if not applicable. */
55
+ expiryTime?: bigint | undefined;
56
+ /** Comment the token was created with, if applicable. */
57
+ comment?: string | undefined;
58
+ /** Scope of the token was created with, if applicable. */
59
+ scopes?: string[] | undefined;
60
+ /** Output only. The autoscope state of this token. */
61
+ autoscopeState?: AutoscopeState | undefined;
62
+ /** Output only. Inferred API path scopes collected for this token when autoscope is enabled. */
63
+ inferredScopes?: string[] | undefined;
64
+ /** Output only. Scopes inferred from offline backfill processing. */
65
+ backfillScopes?: string[] | undefined;
47
66
  }
48
- export interface PublicTokenInfo {
49
- /** The ID of this token. */
50
- tokenId?: string | undefined;
51
- /** Server time (in epoch milliseconds) when the token was created. */
52
- creationTime?: bigint | undefined;
53
- /** Server time (in epoch milliseconds) when the token will expire, or -1 if not applicable. */
54
- expiryTime?: bigint | undefined;
55
- /** Comment the token was created with, if applicable. */
56
- comment?: string | undefined;
57
- /** Scope of the token was created with, if applicable. */
58
- scopes?: string[] | undefined;
59
- /** Output only. The autoscope state of this token. */
60
- autoscopeState?: AutoscopeState | undefined;
61
- /** Output only. Inferred API path scopes collected for this token when autoscope is enabled. */
62
- inferredScopes?: string[] | undefined;
63
- /** Output only. Scopes inferred from offline backfill processing. */
64
- backfillScopes?: string[] | undefined;
65
- }
66
- export interface RevokeTokenRequest {
67
- /** The ID of the token to be revoked. */
68
- tokenId?: string | undefined;
69
- }
70
- export interface RevokeTokenResponse {
67
+ interface RevokeTokenRequest {
68
+ /** The ID of the token to be revoked. */
69
+ tokenId?: string | undefined;
71
70
  }
71
+ interface RevokeTokenResponse {}
72
72
  /**
73
73
  * For the list of supported token scopes, see
74
74
  * https://docs.databricks.com/api/workspace/api/scopes.
75
75
  */
76
- export interface UpdateTokenRequest {
77
- /** The SHA-256 hash of the token to be updated. */
78
- tokenId?: string | undefined;
79
- token?: PublicTokenInfo | undefined;
80
- /** A list of field name under token, For example, {"update_mask": "comment,scopes"} */
81
- updateMask?: FieldMask<PublicTokenInfo> | undefined;
82
- }
83
- export interface UpdateTokenResponse {
76
+ interface UpdateTokenRequest {
77
+ /** The SHA-256 hash of the token to be updated. */
78
+ tokenId?: string | undefined;
79
+ token?: PublicTokenInfo | undefined;
80
+ /** A list of field name under token, For example, {"update_mask": "comment,scopes"} */
81
+ updateMask?: FieldMask<PublicTokenInfo> | undefined;
84
82
  }
85
- export declare const unmarshalCreateTokenResponseSchema: z.ZodType<CreateTokenResponse>;
86
- export declare const unmarshalListTokensResponseSchema: z.ZodType<ListTokensResponse>;
87
- export declare const unmarshalPublicTokenInfoSchema: z.ZodType<PublicTokenInfo>;
88
- export declare const unmarshalRevokeTokenResponseSchema: z.ZodType<RevokeTokenResponse>;
89
- export declare const unmarshalUpdateTokenResponseSchema: z.ZodType<UpdateTokenResponse>;
90
- export declare const marshalCreateTokenRequestSchema: z.ZodType;
91
- export declare const marshalPublicTokenInfoSchema: z.ZodType;
92
- export declare const marshalRevokeTokenRequestSchema: z.ZodType;
93
- export declare const marshalUpdateTokenRequestSchema: z.ZodType;
94
- export declare function publicTokenInfoFieldMask(...paths: string[]): FieldMask<PublicTokenInfo>;
83
+ interface UpdateTokenResponse {}
84
+ declare const unmarshalCreateTokenResponseSchema: z.ZodType<CreateTokenResponse>;
85
+ declare const unmarshalListTokensResponseSchema: z.ZodType<ListTokensResponse>;
86
+ declare const unmarshalPublicTokenInfoSchema: z.ZodType<PublicTokenInfo>;
87
+ declare const unmarshalRevokeTokenResponseSchema: z.ZodType<RevokeTokenResponse>;
88
+ declare const unmarshalUpdateTokenResponseSchema: z.ZodType<UpdateTokenResponse>;
89
+ declare const marshalCreateTokenRequestSchema: z.ZodType;
90
+ declare const marshalPublicTokenInfoSchema: z.ZodType;
91
+ declare const marshalRevokeTokenRequestSchema: z.ZodType;
92
+ declare const marshalUpdateTokenRequestSchema: z.ZodType;
93
+ declare function publicTokenInfoFieldMask(...paths: string[]): FieldMask<PublicTokenInfo>;
94
+ //#endregion
95
+ export { AutoscopeState, CreateTokenRequest, CreateTokenResponse, ListTokensRequest, ListTokensResponse, PublicTokenInfo, RevokeTokenRequest, RevokeTokenResponse, UpdateTokenRequest, UpdateTokenResponse, marshalCreateTokenRequestSchema, marshalPublicTokenInfoSchema, marshalRevokeTokenRequestSchema, marshalUpdateTokenRequestSchema, publicTokenInfoFieldMask, unmarshalCreateTokenResponseSchema, unmarshalListTokensResponseSchema, unmarshalPublicTokenInfoSchema, unmarshalRevokeTokenResponseSchema, unmarshalUpdateTokenResponseSchema };
95
96
  //# sourceMappingURL=model.d.ts.map