@distilled.cloud/starburst-galaxy 0.0.0-stage → 1.0.0-rc.21
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.
- package/LICENSE +201 -0
- package/README.md +114 -2
- package/lib/.lazy.json +1 -0
- package/lib/_bundle/lazy.js +4 -0
- package/lib/_bundle/sdk.js +2 -0
- package/lib/_bundle/sdk.js.map +1 -0
- package/lib/credentials.d.ts +84 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +1 -0
- package/lib/errors.d.ts +83 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +1 -0
- package/lib/index.d.ts +42 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/pagination.d.ts +10 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +1 -0
- package/lib/protocol.d.ts +29 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +1 -0
- package/lib/retry.d.ts +32 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +1 -0
- package/lib/services/catalog.d.ts +2791 -0
- package/lib/services/catalog.d.ts.map +1 -0
- package/lib/services/catalog.js +101 -0
- package/lib/services/catalog.js.map +1 -0
- package/lib/services/cluster.d.ts +248 -0
- package/lib/services/cluster.d.ts.map +1 -0
- package/lib/services/cluster.js +2 -0
- package/lib/services/cluster.js.map +1 -0
- package/lib/services/column_mask.d.ts +162 -0
- package/lib/services/column_mask.d.ts.map +1 -0
- package/lib/services/column_mask.js +2 -0
- package/lib/services/column_mask.js.map +1 -0
- package/lib/services/cross_account_iam_role.d.ts +133 -0
- package/lib/services/cross_account_iam_role.d.ts.map +1 -0
- package/lib/services/cross_account_iam_role.js +2 -0
- package/lib/services/cross_account_iam_role.js.map +1 -0
- package/lib/services/data_domain.d.ts +223 -0
- package/lib/services/data_domain.d.ts.map +1 -0
- package/lib/services/data_domain.js +2 -0
- package/lib/services/data_domain.js.map +1 -0
- package/lib/services/data_product.d.ts +290 -0
- package/lib/services/data_product.d.ts.map +1 -0
- package/lib/services/data_product.js +2 -0
- package/lib/services/data_product.js.map +1 -0
- package/lib/services/data_product_usage_example.d.ts +158 -0
- package/lib/services/data_product_usage_example.d.ts.map +1 -0
- package/lib/services/data_product_usage_example.js +2 -0
- package/lib/services/data_product_usage_example.js.map +1 -0
- package/lib/services/data_quality.d.ts +344 -0
- package/lib/services/data_quality.d.ts.map +1 -0
- package/lib/services/data_quality.js +2 -0
- package/lib/services/data_quality.js.map +1 -0
- package/lib/services/data_quality_metrics.d.ts +282 -0
- package/lib/services/data_quality_metrics.d.ts.map +1 -0
- package/lib/services/data_quality_metrics.js +2 -0
- package/lib/services/data_quality_metrics.js.map +1 -0
- package/lib/services/data_quality_schedule.d.ts +220 -0
- package/lib/services/data_quality_schedule.d.ts.map +1 -0
- package/lib/services/data_quality_schedule.js +2 -0
- package/lib/services/data_quality_schedule.js.map +1 -0
- package/lib/services/discovery.d.ts +439 -0
- package/lib/services/discovery.d.ts.map +1 -0
- package/lib/services/discovery.js +36 -0
- package/lib/services/discovery.js.map +1 -0
- package/lib/services/file_ingest_source.d.ts +205 -0
- package/lib/services/file_ingest_source.d.ts.map +1 -0
- package/lib/services/file_ingest_source.js +2 -0
- package/lib/services/file_ingest_source.js.map +1 -0
- package/lib/services/group.d.ts +140 -0
- package/lib/services/group.d.ts.map +1 -0
- package/lib/services/group.js +2 -0
- package/lib/services/group.js.map +1 -0
- package/lib/services/index.d.ts +26 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +25 -0
- package/lib/services/kafka_ingest_source.d.ts +236 -0
- package/lib/services/kafka_ingest_source.d.ts.map +1 -0
- package/lib/services/kafka_ingest_source.js +2 -0
- package/lib/services/kafka_ingest_source.js.map +1 -0
- package/lib/services/live_table.d.ts +851 -0
- package/lib/services/live_table.d.ts.map +1 -0
- package/lib/services/live_table.js +20 -0
- package/lib/services/live_table.js.map +1 -0
- package/lib/services/policy.d.ts +213 -0
- package/lib/services/policy.d.ts.map +1 -0
- package/lib/services/policy.js +2 -0
- package/lib/services/policy.js.map +1 -0
- package/lib/services/privatelink.d.ts +95 -0
- package/lib/services/privatelink.d.ts.map +1 -0
- package/lib/services/privatelink.js +2 -0
- package/lib/services/privatelink.js.map +1 -0
- package/lib/services/privilege.d.ts +167 -0
- package/lib/services/privilege.d.ts.map +1 -0
- package/lib/services/privilege.js +2 -0
- package/lib/services/privilege.js.map +1 -0
- package/lib/services/role.d.ts +222 -0
- package/lib/services/role.d.ts.map +1 -0
- package/lib/services/role.js +2 -0
- package/lib/services/role.js.map +1 -0
- package/lib/services/row_filter.d.ts +155 -0
- package/lib/services/row_filter.d.ts.map +1 -0
- package/lib/services/row_filter.js +2 -0
- package/lib/services/row_filter.js.map +1 -0
- package/lib/services/schema_discovery.d.ts +236 -0
- package/lib/services/schema_discovery.d.ts.map +1 -0
- package/lib/services/schema_discovery.js +2 -0
- package/lib/services/schema_discovery.js.map +1 -0
- package/lib/services/service_account.d.ts +206 -0
- package/lib/services/service_account.d.ts.map +1 -0
- package/lib/services/service_account.js +2 -0
- package/lib/services/service_account.js.map +1 -0
- package/lib/services/sql_jobs.d.ts +264 -0
- package/lib/services/sql_jobs.d.ts.map +1 -0
- package/lib/services/sql_jobs.js +2 -0
- package/lib/services/sql_jobs.js.map +1 -0
- package/lib/services/tag.d.ts +287 -0
- package/lib/services/tag.d.ts.map +1 -0
- package/lib/services/tag.js +2 -0
- package/lib/services/tag.js.map +1 -0
- package/lib/services/user.d.ts +175 -0
- package/lib/services/user.d.ts.map +1 -0
- package/lib/services/user.js +2 -0
- package/lib/services/user.js.map +1 -0
- package/lib/services.lazy/catalog.js +4 -0
- package/lib/services.lazy/cluster.js +1 -0
- package/lib/services.lazy/column_mask.js +1 -0
- package/lib/services.lazy/cross_account_iam_role.js +1 -0
- package/lib/services.lazy/data_domain.js +1 -0
- package/lib/services.lazy/data_product.js +1 -0
- package/lib/services.lazy/data_product_usage_example.js +1 -0
- package/lib/services.lazy/data_quality.js +1 -0
- package/lib/services.lazy/data_quality_metrics.js +1 -0
- package/lib/services.lazy/data_quality_schedule.js +1 -0
- package/lib/services.lazy/discovery.js +4 -0
- package/lib/services.lazy/file_ingest_source.js +1 -0
- package/lib/services.lazy/group.js +1 -0
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/kafka_ingest_source.js +1 -0
- package/lib/services.lazy/live_table.js +4 -0
- package/lib/services.lazy/policy.js +1 -0
- package/lib/services.lazy/privatelink.js +1 -0
- package/lib/services.lazy/privilege.js +1 -0
- package/lib/services.lazy/role.js +1 -0
- package/lib/services.lazy/row_filter.js +1 -0
- package/lib/services.lazy/schema_discovery.js +1 -0
- package/lib/services.lazy/service_account.js +1 -0
- package/lib/services.lazy/sql_jobs.js +1 -0
- package/lib/services.lazy/tag.js +1 -0
- package/lib/services.lazy/user.js +1 -0
- package/lib/traits.d.ts +11 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +1 -0
- package/package.json +87 -3
- package/src/credentials.ts +205 -0
- package/src/errors.ts +102 -0
- package/src/index.ts +45 -0
- package/src/pagination.ts +9 -0
- package/src/protocol.ts +94 -0
- package/src/retry.ts +50 -0
- package/src/services/catalog.ts +6636 -0
- package/src/services/cluster.ts +492 -0
- package/src/services/column_mask.ts +388 -0
- package/src/services/cross_account_iam_role.ts +328 -0
- package/src/services/data_domain.ts +509 -0
- package/src/services/data_product.ts +641 -0
- package/src/services/data_product_usage_example.ts +380 -0
- package/src/services/data_quality.ts +771 -0
- package/src/services/data_quality_metrics.ts +580 -0
- package/src/services/data_quality_schedule.ts +454 -0
- package/src/services/discovery.ts +1257 -0
- package/src/services/file_ingest_source.ts +480 -0
- package/src/services/group.ts +282 -0
- package/src/services/index.ts +26 -0
- package/src/services/kafka_ingest_source.ts +545 -0
- package/src/services/live_table.ts +1537 -0
- package/src/services/policy.ts +526 -0
- package/src/services/privatelink.ts +209 -0
- package/src/services/privilege.ts +423 -0
- package/src/services/role.ts +501 -0
- package/src/services/row_filter.ts +365 -0
- package/src/services/schema_discovery.ts +516 -0
- package/src/services/service_account.ts +525 -0
- package/src/services/sql_jobs.ts +621 -0
- package/src/services/tag.ts +785 -0
- package/src/services/user.ts +375 -0
- package/src/traits.ts +44 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema-lite";
|
|
3
|
+
import { type StarburstGalaxyOpError, type StarburstGalaxyOpContext } from "../protocol.ts";
|
|
4
|
+
export type { StarburstGalaxyOpError, StarburstGalaxyOpContext };
|
|
5
|
+
declare const BadRequest_base: S.TaggedErrorClass<"BadRequest", {
|
|
6
|
+
readonly message: any;
|
|
7
|
+
readonly body: any;
|
|
8
|
+
readonly headers: any;
|
|
9
|
+
}> & (new (...args: any[]) => {
|
|
10
|
+
"@distilled.cloud/error/categories": {
|
|
11
|
+
BadRequestError: true;
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
export declare class BadRequest extends /*@__PURE__*/ BadRequest_base {
|
|
15
|
+
}
|
|
16
|
+
declare const Conflict_base: S.TaggedErrorClass<"Conflict", {
|
|
17
|
+
readonly message: any;
|
|
18
|
+
readonly body: any;
|
|
19
|
+
readonly headers: any;
|
|
20
|
+
}> & (new (...args: any[]) => {
|
|
21
|
+
"@distilled.cloud/error/categories": {
|
|
22
|
+
ConflictError: true;
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
export declare class Conflict extends /*@__PURE__*/ Conflict_base {
|
|
26
|
+
}
|
|
27
|
+
declare const Forbidden_base: S.TaggedErrorClass<"Forbidden", {
|
|
28
|
+
readonly message: any;
|
|
29
|
+
readonly body: any;
|
|
30
|
+
readonly headers: any;
|
|
31
|
+
}> & (new (...args: any[]) => {
|
|
32
|
+
"@distilled.cloud/error/categories": {
|
|
33
|
+
AuthError: true;
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
export declare class Forbidden extends /*@__PURE__*/ Forbidden_base {
|
|
37
|
+
}
|
|
38
|
+
declare const NotFound_base: S.TaggedErrorClass<"NotFound", {
|
|
39
|
+
readonly message: any;
|
|
40
|
+
readonly body: any;
|
|
41
|
+
readonly headers: any;
|
|
42
|
+
}> & (new (...args: any[]) => {
|
|
43
|
+
"@distilled.cloud/error/categories": {
|
|
44
|
+
BadRequestError: true;
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
export declare class NotFound extends /*@__PURE__*/ NotFound_base {
|
|
48
|
+
}
|
|
49
|
+
/** Role IDs (read only) */
|
|
50
|
+
export type CreateUserRequestRoleIdsList = Array<string>;
|
|
51
|
+
export interface CreateUserRequest {
|
|
52
|
+
/** Email (read only) */
|
|
53
|
+
email: string;
|
|
54
|
+
/** Role IDs (read only) */
|
|
55
|
+
roleIds: CreateUserRequestRoleIdsList;
|
|
56
|
+
/** Default role (read only) */
|
|
57
|
+
roleId: string;
|
|
58
|
+
}
|
|
59
|
+
export type PrincipalType = "User" | "Role" | "Group";
|
|
60
|
+
/** Principal (read only) */
|
|
61
|
+
export interface Principal {
|
|
62
|
+
/** Principal ID */
|
|
63
|
+
id: string;
|
|
64
|
+
/** Principal type */
|
|
65
|
+
type: PrincipalType;
|
|
66
|
+
}
|
|
67
|
+
/** Directly granted roles (read only) */
|
|
68
|
+
export interface Rolegrant {
|
|
69
|
+
/** Role name */
|
|
70
|
+
roleName: string;
|
|
71
|
+
/** Role ID */
|
|
72
|
+
roleId: string;
|
|
73
|
+
principal: Principal;
|
|
74
|
+
/** Admin option */
|
|
75
|
+
adminOption: boolean;
|
|
76
|
+
}
|
|
77
|
+
/** Directly granted roles (read only) */
|
|
78
|
+
export type UserDirectlyGrantedRolesList = Array<Rolegrant>;
|
|
79
|
+
/** All directly granted, inherited and group roles (read only) */
|
|
80
|
+
export type UserAllRolesList = Array<Rolegrant>;
|
|
81
|
+
/** A user */
|
|
82
|
+
export interface User {
|
|
83
|
+
/** Used to ensure consistency for resource updates. A syncToken that is returned from the server is valid until the resource is updated when a new syncToken will be generated. Only the latest version of the object is maintained. (read only) */
|
|
84
|
+
syncToken: string;
|
|
85
|
+
/** User ID (read only) */
|
|
86
|
+
userId: string;
|
|
87
|
+
/** User email (read only) */
|
|
88
|
+
email: string;
|
|
89
|
+
/** Default role id (read only) */
|
|
90
|
+
defaultRoleId?: string | undefined;
|
|
91
|
+
/** Creation date (read only) */
|
|
92
|
+
createdOn: string;
|
|
93
|
+
/** SCIM managed (read only) */
|
|
94
|
+
scimManaged: boolean;
|
|
95
|
+
/** Directly granted roles (read only) */
|
|
96
|
+
directlyGrantedRoles: UserDirectlyGrantedRolesList;
|
|
97
|
+
/** All directly granted, inherited and group roles (read only) */
|
|
98
|
+
allRoles: UserAllRolesList;
|
|
99
|
+
}
|
|
100
|
+
export interface GetUserRequest {
|
|
101
|
+
/** - A user - This parameter can be looked up using `email` instead of its Id. Use `email=value` instead of an Id to lookup/search using the `value`. `value` must be encoded ([see RFC](https://www.rfc-editor.org/rfc/rfc3986#section-2.2) including `=`) */
|
|
102
|
+
userId: string;
|
|
103
|
+
}
|
|
104
|
+
export interface ListUsersRequest {
|
|
105
|
+
/** Pagination token */
|
|
106
|
+
pageToken?: string | undefined;
|
|
107
|
+
/** Page size or 0 for default (current maximum is 100) */
|
|
108
|
+
pageSize?: number | undefined;
|
|
109
|
+
}
|
|
110
|
+
/** A page of results. */
|
|
111
|
+
export type PaginatedUserResultList = Array<User>;
|
|
112
|
+
export interface PaginatedUser {
|
|
113
|
+
/** The next page token to use or "" if there are no more pages. */
|
|
114
|
+
nextPageToken?: string | undefined;
|
|
115
|
+
/** A page of results. */
|
|
116
|
+
result: PaginatedUserResultList;
|
|
117
|
+
}
|
|
118
|
+
/** Directly granted roles */
|
|
119
|
+
export interface UpdateRoleGrantPatch {
|
|
120
|
+
/** Role name */
|
|
121
|
+
roleName?: string | undefined;
|
|
122
|
+
/** Role ID */
|
|
123
|
+
roleId?: string | undefined;
|
|
124
|
+
/** Admin option */
|
|
125
|
+
adminOption?: boolean | undefined;
|
|
126
|
+
}
|
|
127
|
+
/** Directly granted roles */
|
|
128
|
+
export type UpdateUserRequestDirectlyGrantedRolesList = Array<UpdateRoleGrantPatch>;
|
|
129
|
+
export interface UpdateUserRequest {
|
|
130
|
+
/** - A user - This parameter can be looked up using `email` instead of its Id. Use `email=value` instead of an Id to lookup/search using the `value`. `value` must be encoded ([see RFC](https://www.rfc-editor.org/rfc/rfc3986#section-2.2) including `=`) */
|
|
131
|
+
userId: string;
|
|
132
|
+
/** Default role id */
|
|
133
|
+
roleId?: string | undefined;
|
|
134
|
+
/** Directly granted roles */
|
|
135
|
+
directlyGrantedRoles?: UpdateUserRequestDirectlyGrantedRolesList | undefined;
|
|
136
|
+
}
|
|
137
|
+
/** Any fields/values that are invalid or incorrect */
|
|
138
|
+
export type BadRequestFieldsList = Array<string>;
|
|
139
|
+
/** Invalid request */
|
|
140
|
+
export interface BadRequest2 {
|
|
141
|
+
/** Description of the error */
|
|
142
|
+
message?: string | undefined;
|
|
143
|
+
/** Any fields/values that are invalid or incorrect */
|
|
144
|
+
fields?: BadRequestFieldsList | undefined;
|
|
145
|
+
}
|
|
146
|
+
/** Already exists */
|
|
147
|
+
export interface Exists {
|
|
148
|
+
message?: string | undefined;
|
|
149
|
+
}
|
|
150
|
+
/** Authorization failed */
|
|
151
|
+
export type Forbidden2 = Exists;
|
|
152
|
+
/** Any fields/values that weren't found */
|
|
153
|
+
export type NotFoundFieldsList = Array<string>;
|
|
154
|
+
/** A resource or required component was not found */
|
|
155
|
+
export interface NotFound2 {
|
|
156
|
+
/** Name of the resource */
|
|
157
|
+
message: string;
|
|
158
|
+
/** Violation description */
|
|
159
|
+
description?: string | undefined;
|
|
160
|
+
/** Any fields/values that weren't found */
|
|
161
|
+
fields?: NotFoundFieldsList | undefined;
|
|
162
|
+
}
|
|
163
|
+
export type CreateUserError = BadRequest | Forbidden | Conflict | StarburstGalaxyOpError;
|
|
164
|
+
/** Create a user */
|
|
165
|
+
export declare const createUser: API.OperationMethod<CreateUserRequest, User, CreateUserError, StarburstGalaxyOpContext>;
|
|
166
|
+
export type GetUserError = BadRequest | Forbidden | NotFound | StarburstGalaxyOpError;
|
|
167
|
+
/** Get a user */
|
|
168
|
+
export declare const getUser: API.OperationMethod<GetUserRequest, User, GetUserError, StarburstGalaxyOpContext>;
|
|
169
|
+
export type ListUsersError = BadRequest | Forbidden | NotFound | StarburstGalaxyOpError;
|
|
170
|
+
/** Return a list of users */
|
|
171
|
+
export declare const listUsers: API.PaginatedOperationMethod<ListUsersRequest, PaginatedUser, ListUsersError, StarburstGalaxyOpContext, User>;
|
|
172
|
+
export type UpdateUserError = BadRequest | Forbidden | NotFound | Conflict | StarburstGalaxyOpError;
|
|
173
|
+
/** Update user role grants and default role Only include fields you wish to update. Missing or unrecognized fields are ignored. */
|
|
174
|
+
export declare const updateUser: API.OperationMethod<UpdateUserRequest, User, UpdateUserError, StarburstGalaxyOpContext>;
|
|
175
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sources":["../../src/services/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAGjD,OAAO,KAAK,CAAC,MAAM,mCAAmC,CAAC;AAIvD,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC9B,MAAM,gBAAgB,CAAC;AAMxB,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,CAAC;;;;;;;;;;AAejE,qBAAa,UACX,SAAQ,aAAa,CAAC,eAOrB;CAAG;;;;;;;;;;AAEN,qBAAa,QACX,SAAQ,aAAa,CAAC,aAOrB;CAAG;;;;;;;;;;AAEN,qBAAa,SACX,SAAQ,aAAa,CAAC,cAOrB;CAAG;;;;;;;;;;AAEN,qBAAa,QACX,SAAQ,aAAa,CAAC,aAOrB;CAAG;AAEN,2BAA2B;AAC3B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iBAAiB,EACjB,IAAI,EACJ,eAAe,EACf,wBAAwB,CAUvB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Ad as e,Bd as t,Ca as n,a as r,ad as i,b as a,bd as o,errors$StarburstGalaxyServiceErrors as s,f as c,kd as l,l as u,ld as d,m as f,n as p,nd as m,o as h,od as g,pagination$paginateToken as _,protocol$StarburstGalaxyProtocol as v,qd as y,retry$Retry as b,td as x,traits$Http as S,traits$Label as C,traits$Query as w,traits$applyErrorMatchers as T,vd as E,ya as D,za as O}from"../_bundle/sdk.js";const k={system:`starburst-galaxy-api`,responseHeaders:[{header:`x-request-id`,name:`http.response.header.x-request-id`,transform:`list`},{header:`request-id`,name:`http.response.header.request-id`,transform:`list`}],prefix:`StarburstGalaxy`,service:`UserService`,labels:`starburst_galaxy`,propagate:`w3c`};const A=/*@__PURE__*/ c(function BadRequest(t){return f(t,new.target,[`$7($6()("BadRequest",{message:$2,body:$3,headers:$5($4($2,$2))}).pipe($1),[{status:400}])`,[E,O,m,x,d,e,y,T]])});const j=/*@__PURE__*/ c(function Conflict(t){return f(t,new.target,[`$7($6()("Conflict",{message:$2,body:$3,headers:$5($4($2,$2))}).pipe($1),[{status:409}])`,[E,n,m,x,d,e,y,T]])});const M=/*@__PURE__*/ c(function Forbidden(t){return f(t,new.target,[`$7($6()("Forbidden",{message:$2,body:$3,headers:$5($4($2,$2))}).pipe($1),[{status:403}])`,[E,D,m,x,d,e,y,T]])});const N=/*@__PURE__*/ c(function NotFound(t){return f(t,new.target,[`$7($6()("NotFound",{message:$2,body:$3,headers:$5($4($2,$2))}).pipe($1),[{status:404}])`,[E,O,m,x,d,e,y,T]])});const P=/*@__PURE__*/ p(e=>e===r?u(`CreateUser`,`{input:#2,output:#6:3,errors:[$7,$8,$9],serviceErrors:$10,protocol:$11,retry:$12,telemetry:$13,span:"%"};$2($1);$5(>3)@"%Request";$4({email:$1,roleIds:#1,roleId:$1}).pipe($3({method:"POST",uri:"/public/api/v1/user",code:200}))`,[E,m,i,S,g,t,__d0,A,M,j,s,v,b,k]):a(P,e));const F=/*@__PURE__*/ p(e=>e===r?u(`GetUser`,`{input:#1,output:#6:3,errors:[$7,$8,$9],serviceErrors:$10,protocol:$11,retry:$12,telemetry:$13,span:"%"};$5(>2)@"%Request";$4({userId:$3.pipe($2())}).pipe($1({method:"GET",uri:"/public/api/v1/user/{userId}",code:200}))`,[E,S,C,m,g,t,__d0,A,M,N,s,v,b,k]):a(F,e));const I=/*@__PURE__*/ h(n=>n===r?u(`ListUsers`,`{input:#1,output:#3,errors:[$10,$11,$12],serviceErrors:$13,protocol:$14,retry:$15,telemetry:$16,span:"%",pagination:{mode:"token",inputToken:"pageToken",outputToken:"nextPageToken",items:"result",pageSize:"pageSize"},strategy:$17};$7(>4)@"%Request";$9(#8:3);$7(>5)@"PaginatedUser";$6({pageToken:$4($3.pipe($2())),pageSize:$4($5.pipe($2()))}).pipe($1({method:"GET",uri:"/public/api/v1/user",code:200}));$6({nextPageToken:$4($3),result:#2})`,[E,S,w,m,e,l,g,t,__d0,i,A,M,N,s,v,b,k,_]):a(I,n));const L=/*@__PURE__*/ p(n=>n===r?u(`UpdateUser`,`{input:#3,output:#9:3,errors:[$10,$11,$12,$13],serviceErrors:$14,protocol:$15,retry:$16,telemetry:$17,span:"%"};$5(>4)@"UpdateRoleGrantPatch";$6(#1);$5(>5)@"%Request";$4({roleName:$2($1),roleId:$2($1),adminOption:$2($3)});$4({userId:$1.pipe($8()),roleId:$2($1),directlyGrantedRoles:$2(#2)}).pipe($7({method:"PATCH",uri:"/public/api/v1/user/{userId}",code:200}))`,[E,m,e,o,g,t,i,S,C,__d0,A,M,N,j,s,v,b,k]):a(L,n));function __d0(){return[`$3(>4)@"Principal";$3(>5)@"Rolegrant";$5(#1);$3(>6)@"User";$2({id:$1,type:$1});$2({roleName:$1,roleId:$1,principal:#0,adminOption:$4});$2({syncToken:$1,userId:$1,email:$1,defaultRoleId:$6($1),createdOn:$1,scimManaged:$4,directlyGrantedRoles:#2,allRoles:#2})`,[E,m,g,t,o,i,e]]}export{A as BadRequest,j as Conflict,M as Forbidden,N as NotFound,P as createUser,F as getUser,I as listUsers,L as updateUser};
|
|
2
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","names":["API.newError","__L.at","C.withBadRequestError","S.String","S.Unknown","S.Record","S.optional","S.TaggedError","T.applyErrorMatchers","C.withConflictError","C.withAuthError","API.D","API.named","S.Array","T.Http","S.Struct","S.suspend","Retry.Retry","API.call","T.Label","T.Query","S.Number","S.Boolean","optional","suspend","withConflictError","D","Array","call","Boolean","StarburstGalaxyServiceErrors","error","Number","named","Record","newError","op","String","opPaginated","Struct","paginateToken","StarburstGalaxyProtocol","TaggedError","Retry","Unknown","Http","Label","Query","applyErrorMatchers","at","withAuthError","withBadRequestError","TELEMETRY","BadRequest","i","Conflict","Forbidden","NotFound","createUser","getUser","listUsers","updateUser"],"sources":["../../src/services/user.ts"],"mappings":"kZAkBA,MAAMoD,EAAY,CAChB,OAAQ,uBACR,gBAAiB,CACf,CAAE,OAAQ,eAAgB,KAAM,oCAAqC,UAAW,MAAO,EACvF,CAAE,OAAQ,aAAc,KAAM,kCAAmC,UAAW,MAAO,CACrF,EACA,OAAQ,kBACR,QAAS,cACT,OAAQ,mBACR,UAAW,KACb,EAEA,MAAaC,EAAgC,gBAAU,SAAS,WAAW,EAAa,CACtF,OAAOrD,EAAasD,EAAG,WAAY,CAAC,4FAA6F,CAACrD,EAAQC,EAAuBC,EAAUC,EAAWC,EAAUC,EAAYC,EAAeC,CAAoB,CAAC,CAAC,CACnP,CAAC,EAED,MAAa+C,EAA8B,gBAAU,SAAS,SAAS,EAAa,CAClF,OAAOvD,EAAasD,EAAG,WAAY,CAAC,0FAA2F,CAACrD,EAAQQ,EAAqBN,EAAUC,EAAWC,EAAUC,EAAYC,EAAeC,CAAoB,CAAC,CAAC,CAC/O,CAAC,EAED,MAA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AAUF,EAAUzB,EAA8BW,EAAyBxB,EAAamC,CAAS,CAAC,EAAIlC,EAAS2C,EAAYP,CAAC,CAAC,EAMhrB,SAAS,MAAY,CACnB,MAAO,CAAC,oQAAqQ,CAACrD,EAAQE,EAAUY,EAAUC,EAAWM,EAAWT,EAASP,CAAU,CAAC,CACtV"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{$L}from"../_bundle/lazy.js";
|
|
2
|
+
const{o:$o,e:$e,E:$E}=/*@__PURE__*/$L("../services/catalog.js","oooooooooooooooooooooooooooooooooppppppppppppoooooooooooooooooooooo",50678,7347);
|
|
3
|
+
export const{BadRequest,Conflict,Forbidden,NotFound}=$E;
|
|
4
|
+
export const createBigQueryCatalog=$o(),createCassandraCatalog=$o(),createGcsCatalog=$o(),createMongoDBCatalog=$o(),createMySQLCatalog=$o(),createOpenSearchCatalog=$o(),createPostgresqlCatalog=$o(),createRedshiftCatalog=$o(),createS3Catalog=$o(),createSnowflakeCatalog=$o(),createSqlServerCatalog=$o(),deleteBigQueryCatalog=$o(),deleteCassandraCatalog=$o(),deleteGcsCatalog=$o(),deleteMongoDBCatalog=$o(),deleteMySQLCatalog=$o(),deleteOpenSearchCatalog=$o(),deletePostgresqlCatalog=$o(),deleteRedshiftCatalog=$o(),deleteS3Catalog=$o(),deleteSnowflakeCatalog=$o(),deleteSqlServerCatalog=$o(),getBigQueryCatalog=$o(),getCassandraCatalog=$o(),getGcsCatalog=$o(),getMongoDBCatalog=$o(),getMySQLCatalog=$o(),getOpenSearchCatalog=$o(),getPostgresqlCatalog=$o(),getRedshiftCatalog=$o(),getS3Catalog=$o(),getSnowflakeCatalog=$o(),getSqlServerCatalog=$o(),listBigQueryCatalogs=$o(),listCassandraCatalogs=$o(),listCatalogs=$o(),listGcsCatalogs=$o(),listMongoDBCatalogs=$o(),listMySQLCatalogs=$o(),listOpenSearchCatalogs=$o(),listPostgresqlCatalogs=$o(),listRedshiftCatalogs=$o(),listS3Catalogs=$o(),listSnowflakeCatalogs=$o(),listSqlServerCatalogs=$o(),updateBigQueryCatalog=$o(),updateCassandraCatalog=$o(),updateGcsCatalog=$o(),updateMongoDBCatalog=$o(),updateMySQLCatalog=$o(),updateOpenSearchCatalog=$o(),updatePostgresqlCatalog=$o(),updateRedshiftCatalog=$o(),updateS3Catalog=$o(),updateSnowflakeCatalog=$o(),updateSqlServerCatalog=$o(),validateBigQueryCatalog=$o(),validateCassandraCatalog=$o(),validateGcsCatalog=$o(),validateMongoDBCatalog=$o(),validateMySQLCatalog=$o(),validateOpenSearchCatalog=$o(),validatePostgresqlCatalog=$o(),validateRedshiftCatalog=$o(),validateS3Catalog=$o(),validateSnowflakeCatalog=$o(),validateSqlServerCatalog=$o();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/cluster.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/column_mask.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/cross_account_iam_role.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/data_domain.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/data_product.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/data_product_usage_example.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/data_quality.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/data_quality_metrics.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/data_quality_schedule.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{$L}from"../_bundle/lazy.js";
|
|
2
|
+
const{o:$o,e:$e,E:$E}=/*@__PURE__*/$L("../services/discovery.js","oooooooopppooooo",10526,2304);
|
|
3
|
+
export const{BadRequest,Conflict,Forbidden,NotFound}=$E;
|
|
4
|
+
export const deleteCatalogMetadata=$o(),deleteCatalogSchema=$o(),deleteCatalogSchemaTable=$o(),deleteCatalogSchemaTableColumn=$o(),getCatalogMetadata=$o(),getCatalogSchema=$o(),getCatalogSchemaTable=$o(),getCatalogSchemaTableColumn=$o(),listCatalogSchemas=$o(),listCatalogSchemaTableColumns=$o(),listCatalogSchemaTables=$o(),updateCatalogMetadata=$o(),updateCatalogSchema=$o(),updateCatalogSchemaTable=$o(),updateCatalogSchemaTableColumn=$o(),updateCatalogSchemaTableColumns=$o();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/file_ingest_source.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/group.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{api$lazyNamespace as $N}from"@distilled.cloud/core/_bundle/base";
|
|
2
|
+
const $u=import.meta.url,catalog=$N($u,"./catalog.js"),cluster=$N($u,"./cluster.js"),columnMask=$N($u,"./column_mask.js"),crossAccountIamRole=$N($u,"./cross_account_iam_role.js"),dataDomain=$N($u,"./data_domain.js"),dataProductUsageExample=$N($u,"./data_product_usage_example.js"),dataProduct=$N($u,"./data_product.js"),dataQualityMetrics=$N($u,"./data_quality_metrics.js"),dataQualitySchedule=$N($u,"./data_quality_schedule.js"),dataQuality=$N($u,"./data_quality.js"),discovery=$N($u,"./discovery.js"),fileIngestSource=$N($u,"./file_ingest_source.js"),group=$N($u,"./group.js"),kafkaIngestSource=$N($u,"./kafka_ingest_source.js"),liveTable=$N($u,"./live_table.js"),policy=$N($u,"./policy.js"),privatelink=$N($u,"./privatelink.js"),privilege=$N($u,"./privilege.js"),role=$N($u,"./role.js"),rowFilter=$N($u,"./row_filter.js"),schemaDiscovery=$N($u,"./schema_discovery.js"),serviceAccount=$N($u,"./service_account.js"),sqlJobs=$N($u,"./sql_jobs.js"),tag=$N($u,"./tag.js"),user=$N($u,"./user.js");
|
|
3
|
+
export{catalog,cluster,columnMask,crossAccountIamRole,dataDomain,dataProductUsageExample,dataProduct,dataQualityMetrics,dataQualitySchedule,dataQuality,discovery,fileIngestSource,group,kafkaIngestSource,liveTable,policy,privatelink,privilege,role,rowFilter,schemaDiscovery,serviceAccount,sqlJobs,tag,user};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/kafka_ingest_source.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{$L}from"../_bundle/lazy.js";
|
|
2
|
+
const{o:$o,e:$e,E:$E}=/*@__PURE__*/$L("../services/live_table.js","oooppo",8601,1151);
|
|
3
|
+
export const{BadRequest,Conflict,Forbidden,NotFound}=$E;
|
|
4
|
+
export const createLiveTable=$o(),deleteLiveTable=$o(),getLiveTable=$o(),listBriefLiveTables=$o(),listLiveTables=$o(),updateLiveTableSchema=$o();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/policy.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/privatelink.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/privilege.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/role.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/row_filter.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/schema_discovery.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/service_account.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/sql_jobs.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/tag.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"../services/user.js";
|
package/lib/traits.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Starburst Galaxy SDK trait surface -- hand-written.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the generic protocol traits from core (so generated operations
|
|
5
|
+
* import everything from one place). Galaxy has no envelope of its own; the
|
|
6
|
+
* REST-protocol traits (SensitiveValue / RawResponse) come from
|
|
7
|
+
* `core/protocol-rest`.
|
|
8
|
+
*/
|
|
9
|
+
export { Body, Header, Query, Label, Http, ResponseCode, HttpBody, FormDataFile, KeyDictionary, UnionCases, applyErrorMatchers, getErrorMatchers, type HttpTrait, type ErrorMatcher, bodySymbol, headerSymbol, querySymbol, labelSymbol, httpSymbol, responseCodeSymbol, httpBodySymbol, formDataFileSymbol, keyDictionarySymbol, unionCasesSymbol, errorMatchersSymbol, } from "@distilled.cloud/core/trait";
|
|
10
|
+
export { SensitiveValue, RawResponse, RawResponseRoot, sensitiveValueSymbol, rawResponseSymbol, rawResponseRootSymbol, } from "@distilled.cloud/core/protocol-rest";
|
|
11
|
+
//# sourceMappingURL=traits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traits.d.ts","sources":["../src/traits.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,cAAc,EACd,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,qCAAqC,CAAC"}
|
package/lib/traits.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { traits$Body as Body, traits$FormDataFile as FormDataFile, traits$Header as Header, traits$Http as Http, traits$HttpBody as HttpBody, traits$KeyDictionary as KeyDictionary, traits$Label as Label, traits$Query as Query, traits$RawResponse as RawResponse, traits$RawResponseRoot as RawResponseRoot, traits$ResponseCode as ResponseCode, traits$SensitiveValue as SensitiveValue, traits$UnionCases as UnionCases, traits$applyErrorMatchers as applyErrorMatchers, traits$bodySymbol as bodySymbol, traits$errorMatchersSymbol as errorMatchersSymbol, traits$formDataFileSymbol as formDataFileSymbol, traits$getErrorMatchers as getErrorMatchers, traits$headerSymbol as headerSymbol, traits$httpBodySymbol as httpBodySymbol, traits$httpSymbol as httpSymbol, traits$keyDictionarySymbol as keyDictionarySymbol, traits$labelSymbol as labelSymbol, traits$querySymbol as querySymbol, traits$rawResponseRootSymbol as rawResponseRootSymbol, traits$rawResponseSymbol as rawResponseSymbol, traits$responseCodeSymbol as responseCodeSymbol, traits$sensitiveValueSymbol as sensitiveValueSymbol, traits$unionCasesSymbol as unionCasesSymbol } from "./_bundle/sdk.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,90 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distilled.cloud/starburst-galaxy",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0-rc.21",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/alchemy-run/distilled",
|
|
8
|
+
"directory": "packages/starburst-galaxy"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"lib",
|
|
12
|
+
"src"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"module": "src/index.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./lib/index.d.ts",
|
|
20
|
+
"bun": "./src/index.ts",
|
|
21
|
+
"worker": "./src/index.ts",
|
|
22
|
+
"default": "./lib/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./Credentials": {
|
|
25
|
+
"types": "./lib/credentials.d.ts",
|
|
26
|
+
"bun": "./src/credentials.ts",
|
|
27
|
+
"worker": "./src/credentials.ts",
|
|
28
|
+
"default": "./lib/credentials.js"
|
|
29
|
+
},
|
|
30
|
+
"./Errors": {
|
|
31
|
+
"types": "./lib/errors.d.ts",
|
|
32
|
+
"bun": "./src/errors.ts",
|
|
33
|
+
"worker": "./src/errors.ts",
|
|
34
|
+
"default": "./lib/errors.js"
|
|
35
|
+
},
|
|
36
|
+
"./Pagination": {
|
|
37
|
+
"types": "./lib/pagination.d.ts",
|
|
38
|
+
"bun": "./src/pagination.ts",
|
|
39
|
+
"worker": "./src/pagination.ts",
|
|
40
|
+
"default": "./lib/pagination.js"
|
|
41
|
+
},
|
|
42
|
+
"./Protocol": {
|
|
43
|
+
"types": "./lib/protocol.d.ts",
|
|
44
|
+
"bun": "./src/protocol.ts",
|
|
45
|
+
"worker": "./src/protocol.ts",
|
|
46
|
+
"default": "./lib/protocol.js"
|
|
47
|
+
},
|
|
48
|
+
"./Retry": {
|
|
49
|
+
"types": "./lib/retry.d.ts",
|
|
50
|
+
"bun": "./src/retry.ts",
|
|
51
|
+
"worker": "./src/retry.ts",
|
|
52
|
+
"default": "./lib/retry.js"
|
|
53
|
+
},
|
|
54
|
+
"./Traits": {
|
|
55
|
+
"types": "./lib/traits.d.ts",
|
|
56
|
+
"bun": "./src/traits.ts",
|
|
57
|
+
"worker": "./src/traits.ts",
|
|
58
|
+
"default": "./lib/traits.js"
|
|
59
|
+
},
|
|
60
|
+
"./*": {
|
|
61
|
+
"types": "./lib/services/*.d.ts",
|
|
62
|
+
"bun": "./src/services/*.ts",
|
|
63
|
+
"worker": "./src/services/*.ts",
|
|
64
|
+
"distilled-lazy": "./lib/services.lazy/*.js",
|
|
65
|
+
"default": "./lib/services/*.js"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@distilled.cloud/core": "1.0.0-rc.21"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@distilled.cloud/dev": "0.0.0",
|
|
73
|
+
"@types/node": "26.6.5"
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"effect": "~4.1.7"
|
|
77
|
+
},
|
|
78
|
+
"distilled": {
|
|
79
|
+
"generatedAt": "2026-11-27",
|
|
80
|
+
"specUpdatedAt": "2026-11-25"
|
|
81
|
+
},
|
|
82
|
+
"scripts": {
|
|
83
|
+
"build": "tsrs -b",
|
|
84
|
+
"convert": "node --conditions=bun scripts/convert.ts",
|
|
85
|
+
"generate": "node --conditions=bun scripts/generate.ts",
|
|
86
|
+
"typecheck": "tsrs -p tsconfig.json",
|
|
87
|
+
"specs:fetch": "git submodule update --force --init --depth=1 specs/spec-mirror-starburst-galaxy",
|
|
88
|
+
"specs:update": "git submodule update --remote --force --depth=1 specs/spec-mirror-starburst-galaxy"
|
|
89
|
+
}
|
|
6
90
|
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import * as EffectConfig from "@distilled.cloud/core/config";
|
|
2
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
3
|
+
import { originFromConfig } from "@distilled.cloud/core/protocol-http";
|
|
4
|
+
import { refreshing } from "@distilled.cloud/core/token-cache";
|
|
5
|
+
/**
|
|
6
|
+
* Starburst Galaxy credentials -- hand-written.
|
|
7
|
+
*
|
|
8
|
+
* Galaxy's public API is served from each account's own host
|
|
9
|
+
* (`https://<account>.galaxy.starburst.io`) and authenticates with OAuth 2.0
|
|
10
|
+
* client credentials: a service account's client ID and secret are
|
|
11
|
+
* exchanged at `POST https://<account-domain>/oauth/v2/token` (HTTP Basic
|
|
12
|
+
* auth, `grant_type=client_credentials`) for an access token sent as
|
|
13
|
+
* `Authorization: Bearer <token>`. Access tokens last 10 minutes
|
|
14
|
+
* (https://docs.starburst.io/starburst-galaxy/developer-tools/api/api-auth-token.html).
|
|
15
|
+
*
|
|
16
|
+
* The `Credentials` service holds an *effect* that resolves the current
|
|
17
|
+
* credentials; the protocol resolves it per request on the calling
|
|
18
|
+
* fiber. The client-credentials layers exchange through the provided
|
|
19
|
+
* `HttpClient` on first use, reuse the token, and exchange again shortly
|
|
20
|
+
* before it expires, so long-running programs keep working past the token
|
|
21
|
+
* lifetime. Each layer owns its cache, and concurrent resolutions of a cold
|
|
22
|
+
* or stale cache share one exchange.
|
|
23
|
+
*
|
|
24
|
+
* A layer here reads and checks its configuration when it is built: a
|
|
25
|
+
* missing variable or a domain that is not an HTTPS host is a `ConfigError`
|
|
26
|
+
* at setup, and no call fails for it. The service's effect can still fail
|
|
27
|
+
* with {@link TokenRequestFailed} when the token request it makes at run
|
|
28
|
+
* time fails.
|
|
29
|
+
*/
|
|
30
|
+
import * as Context from "effect/Context";
|
|
31
|
+
import * as Effect from "effect/Effect";
|
|
32
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
33
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest";
|
|
34
|
+
import * as HttpClientResponse from "effect/http/HttpClientResponse";
|
|
35
|
+
import * as Layer from "effect/Layer";
|
|
36
|
+
import type * as Redacted from "effect/Redacted";
|
|
37
|
+
import * as Schema from "effect/Schema";
|
|
38
|
+
import { TokenRequestFailed } from "./errors.ts";
|
|
39
|
+
|
|
40
|
+
/** The token endpoint, relative to the account's origin. */
|
|
41
|
+
const TOKEN_PATH = "/oauth/v2/token";
|
|
42
|
+
|
|
43
|
+
/** Reuse a token until this long before its reported expiry. */
|
|
44
|
+
const TOKEN_REFRESH_WINDOW_MS = 60_000;
|
|
45
|
+
|
|
46
|
+
/** What every request is built from. */
|
|
47
|
+
export interface Config {
|
|
48
|
+
readonly accessToken: Redacted.Redacted<string>;
|
|
49
|
+
/** `https://<account-domain>`, no trailing slash. */
|
|
50
|
+
readonly apiBaseUrl: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class Credentials
|
|
54
|
+
extends /*@__PURE__*/ Context.Service<Credentials, Effect.Effect<Config, TokenRequestFailed>>()(
|
|
55
|
+
"StarburstGalaxyCredentials",
|
|
56
|
+
) {}
|
|
57
|
+
|
|
58
|
+
/** A Galaxy service account's OAuth client credentials. */
|
|
59
|
+
export interface ClientCredentials {
|
|
60
|
+
/** The account domain (`yourco.galaxy.starburst.io`) or its `https://` origin. */
|
|
61
|
+
readonly domain: string;
|
|
62
|
+
readonly clientId: string;
|
|
63
|
+
readonly clientSecret: Redacted.Redacted<string>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const LOOPBACK = new Set(["127.0.0.1", "localhost", "[::1]"]);
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* `yourco.galaxy.starburst.io` or `https://yourco.galaxy.starburst.io/` ->
|
|
70
|
+
* `https://yourco.galaxy.starburst.io`. The client secret and every token
|
|
71
|
+
* travel to this origin, so it must be HTTPS with no path, query or user
|
|
72
|
+
* info; plain HTTP is accepted on the loopback interface only, for local
|
|
73
|
+
* test servers.
|
|
74
|
+
*/
|
|
75
|
+
const apiBaseUrlFor = (domain: string): Effect.Effect<string, ConfigError> => {
|
|
76
|
+
const origin = originFromConfig("Starburst Galaxy domain", domain);
|
|
77
|
+
if (typeof origin !== "string") return Effect.fail(origin);
|
|
78
|
+
const url = new URL(origin);
|
|
79
|
+
if (url.protocol !== "https:" && !(url.protocol === "http:" && LOOPBACK.has(url.hostname))) {
|
|
80
|
+
return Effect.fail(new ConfigError({ message: "Starburst Galaxy domain must use HTTPS" }));
|
|
81
|
+
}
|
|
82
|
+
return Effect.succeed(origin);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** A successful token response; `access_token` is redacted as it is decoded. */
|
|
86
|
+
const TokenResponse = Schema.Struct({
|
|
87
|
+
access_token: Schema.Redacted(Schema.String),
|
|
88
|
+
expires_in: Schema.Number,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* How long a token is reused: until 60 seconds before `expires_in`, but at
|
|
93
|
+
* least half its lifetime, so a short-lived token is not exchanged on every
|
|
94
|
+
* call.
|
|
95
|
+
*/
|
|
96
|
+
const reuseFor = (expiresInSeconds: number): number => {
|
|
97
|
+
const lifetimeMs = expiresInSeconds * 1000;
|
|
98
|
+
return Math.max(lifetimeMs - TOKEN_REFRESH_WINDOW_MS, lifetimeMs / 2);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Builds the OAuth client-credentials token cache. The returned effect posts
|
|
103
|
+
* the exchange through the captured `HttpClient` and reuses the token for
|
|
104
|
+
* {@link reuseFor} its `expires_in`. Concurrent resolutions of a cold or
|
|
105
|
+
* stale cache share one exchange (core `refreshing`); a failed exchange is
|
|
106
|
+
* not cached. The domain is checked here, once, before any exchange: a
|
|
107
|
+
* malformed one fails this effect and no request is made.
|
|
108
|
+
* Exchange errors carry the status, never the secret or a token.
|
|
109
|
+
*/
|
|
110
|
+
export const makeClientCredentials = (
|
|
111
|
+
config: ClientCredentials,
|
|
112
|
+
): Effect.Effect<Effect.Effect<Config, TokenRequestFailed>, ConfigError, HttpClient.HttpClient> =>
|
|
113
|
+
Effect.gen(function* () {
|
|
114
|
+
const client = yield* HttpClient.HttpClient;
|
|
115
|
+
const apiBaseUrl = yield* apiBaseUrlFor(config.domain);
|
|
116
|
+
const url = `${apiBaseUrl}${TOKEN_PATH}`;
|
|
117
|
+
const requestFailed = (reason: string, status: number | undefined) =>
|
|
118
|
+
new TokenRequestFailed({
|
|
119
|
+
message: `Starburst Galaxy token request to ${url} failed: ${reason}`,
|
|
120
|
+
status,
|
|
121
|
+
});
|
|
122
|
+
const exchange = Effect.gen(function* () {
|
|
123
|
+
const token = yield* client
|
|
124
|
+
.execute(
|
|
125
|
+
HttpClientRequest.post(url).pipe(
|
|
126
|
+
HttpClientRequest.acceptJson,
|
|
127
|
+
HttpClientRequest.basicAuth(config.clientId, config.clientSecret),
|
|
128
|
+
HttpClientRequest.bodyUrlParams({ grant_type: "client_credentials" }),
|
|
129
|
+
),
|
|
130
|
+
)
|
|
131
|
+
.pipe(
|
|
132
|
+
Effect.flatMap(HttpClientResponse.filterStatusOk),
|
|
133
|
+
Effect.mapError((cause) => requestFailed(cause.message, cause.response?.status)),
|
|
134
|
+
Effect.flatMap((response) =>
|
|
135
|
+
HttpClientResponse.schemaBodyJson(TokenResponse)(response).pipe(
|
|
136
|
+
Effect.mapError((cause) => requestFailed(cause.message, response.status)),
|
|
137
|
+
),
|
|
138
|
+
),
|
|
139
|
+
);
|
|
140
|
+
return {
|
|
141
|
+
config: { accessToken: token.access_token, apiBaseUrl },
|
|
142
|
+
refreshAt: Date.now() + reuseFor(token.expires_in),
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
return refreshing(exchange, (token) => token.refreshAt, {
|
|
146
|
+
onTimeout: (timeoutMs) =>
|
|
147
|
+
new TokenRequestFailed({
|
|
148
|
+
message: `Starburst Galaxy token exchange timed out after ${timeoutMs / 1000} s`,
|
|
149
|
+
}),
|
|
150
|
+
}).pipe(Effect.map((token) => token.config));
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Layer from a service account's client credentials. The domain is checked
|
|
155
|
+
* when the layer is built. The access token is requested through the
|
|
156
|
+
* provided `HttpClient` on first use and refreshed shortly before it
|
|
157
|
+
* expires.
|
|
158
|
+
*/
|
|
159
|
+
export const fromClientCredentials = (
|
|
160
|
+
config: ClientCredentials,
|
|
161
|
+
): Layer.Layer<Credentials, ConfigError, HttpClient.HttpClient> =>
|
|
162
|
+
Layer.effect(Credentials, makeClientCredentials(config));
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Layer from an access token already held (no refresh). The domain is
|
|
166
|
+
* checked when the layer is built.
|
|
167
|
+
*/
|
|
168
|
+
export const fromAccessToken = (config: {
|
|
169
|
+
readonly domain: string;
|
|
170
|
+
readonly accessToken: Redacted.Redacted<string>;
|
|
171
|
+
}): Layer.Layer<Credentials, ConfigError> =>
|
|
172
|
+
Layer.effect(
|
|
173
|
+
Credentials,
|
|
174
|
+
Effect.map(apiBaseUrlFor(config.domain), (apiBaseUrl) =>
|
|
175
|
+
Effect.succeed({ accessToken: config.accessToken, apiBaseUrl }),
|
|
176
|
+
),
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
const envConfig = /*@__PURE__*/ EffectConfig.all({
|
|
180
|
+
domain: /*@__PURE__*/ EffectConfig.String("STARBURST_GALAXY_DOMAIN"),
|
|
181
|
+
clientId: /*@__PURE__*/ EffectConfig.String("STARBURST_GALAXY_CLIENT_ID"),
|
|
182
|
+
clientSecret: /*@__PURE__*/ EffectConfig.Redacted("STARBURST_GALAXY_CLIENT_SECRET"),
|
|
183
|
+
}).pipe(
|
|
184
|
+
/*@__PURE__*/ Effect.mapError(
|
|
185
|
+
() =>
|
|
186
|
+
new ConfigError({
|
|
187
|
+
message:
|
|
188
|
+
"STARBURST_GALAXY_DOMAIN, STARBURST_GALAXY_CLIENT_ID and STARBURST_GALAXY_CLIENT_SECRET environment variables are required",
|
|
189
|
+
}),
|
|
190
|
+
),
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Reads STARBURST_GALAXY_DOMAIN, STARBURST_GALAXY_CLIENT_ID and
|
|
195
|
+
* STARBURST_GALAXY_CLIENT_SECRET through `@distilled.cloud/core/config`, so
|
|
196
|
+
* a provided `ConfigProvider` supplies them, and exchanges them for a cached
|
|
197
|
+
* access token on first use. The variables are read, and the domain
|
|
198
|
+
* checked, once: when the layer is built. The token cache belongs to the
|
|
199
|
+
* built layer.
|
|
200
|
+
*/
|
|
201
|
+
export const CredentialsFromEnv: Layer.Layer<Credentials, ConfigError, HttpClient.HttpClient> =
|
|
202
|
+
/*@__PURE__*/ Layer.effect(
|
|
203
|
+
Credentials,
|
|
204
|
+
/*@__PURE__*/ Effect.flatMap(envConfig, makeClientCredentials),
|
|
205
|
+
);
|