@keboola/api-client 52.0.0 → 54.0.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.
Files changed (164) hide show
  1. package/AGENTS.md +33 -6
  2. package/API-SURFACE.md +5 -1
  3. package/CHANGELOG.md +39 -0
  4. package/README.md +1 -1
  5. package/dist/{admin-Di-MmGFP.cjs → admin-BZ7knTd0.cjs} +18 -2
  6. package/dist/admin-BZ7knTd0.cjs.map +1 -0
  7. package/dist/{admin-CbMOsfgs.js → admin-xFfHSZHQ.js} +13 -3
  8. package/dist/admin-xFfHSZHQ.js.map +1 -0
  9. package/dist/{componentId-DZP1rBix.js → componentId-Cps6WBy1.js} +1 -2
  10. package/dist/{componentId-DZP1rBix.js.map → componentId-Cps6WBy1.js.map} +1 -1
  11. package/dist/{componentId-olp0tltf.cjs → componentId-_tRhEv6W.cjs} +1 -2
  12. package/dist/{componentId-olp0tltf.cjs.map → componentId-_tRhEv6W.cjs.map} +1 -1
  13. package/dist/{configurations-WI8H4zLk.cjs → configurations-BM63ep1s.cjs} +2 -2
  14. package/dist/{configurations-WI8H4zLk.cjs.map → configurations-BM63ep1s.cjs.map} +1 -1
  15. package/dist/{configurations-Cd6Nsox-.js → configurations-BqvtIQm4.js} +2 -2
  16. package/dist/{configurations-Cd6Nsox-.js.map → configurations-BqvtIQm4.js.map} +1 -1
  17. package/dist/constants/index.cjs +4 -3
  18. package/dist/constants/index.d.cts +1 -1
  19. package/dist/constants/index.d.ts +1 -1
  20. package/dist/constants/index.js +3 -2
  21. package/dist/{constants-Dqi0ewGv.js → constants-DLPkpnGv.js} +4 -32
  22. package/dist/{constants-Dqi0ewGv.js.map → constants-DLPkpnGv.js.map} +1 -1
  23. package/dist/{constants-d0Do9NSN.cjs → constants-Day8CU5i.cjs} +3 -37
  24. package/dist/{constants-d0Do9NSN.cjs.map → constants-Day8CU5i.cjs.map} +1 -1
  25. package/dist/domain/permissions/index.cjs +4 -3
  26. package/dist/domain/permissions/index.d.cts +9 -1
  27. package/dist/domain/permissions/index.d.ts +9 -1
  28. package/dist/domain/permissions/index.js +4 -4
  29. package/dist/encryption/index.d.cts +1 -1
  30. package/dist/encryption/index.d.ts +1 -1
  31. package/dist/encryption/types.d.cts +1 -1
  32. package/dist/encryption/types.d.ts +1 -1
  33. package/dist/{index-Df8lZNSH.d.cts → index-B04rWq_0.d.cts} +2 -2
  34. package/dist/{index-B7el5pJU.d.cts → index-BtvWJBYh.d.cts} +20 -7
  35. package/dist/{index-B5rELADq.d.cts → index-Cd0naVic.d.cts} +2 -2
  36. package/dist/{index-CveF5RFQ.d.ts → index-DCfumWzq.d.ts} +2 -2
  37. package/dist/{index-81wn1jc3.d.cts → index-DX7qciZA.d.cts} +36 -2
  38. package/dist/{index-Dhyrg5zd.d.ts → index-DbStyQKc.d.ts} +2 -2
  39. package/dist/{index-C7JcNvbd.d.ts → index-Df30jjpZ.d.ts} +20 -7
  40. package/dist/{index-JoKfPQND.d.ts → index-DzqHh0lE.d.ts} +36 -2
  41. package/dist/index.cjs +9 -9
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +2 -2
  44. package/dist/index.d.ts +2 -2
  45. package/dist/index.js +7 -7
  46. package/dist/management/index.cjs +1 -1
  47. package/dist/management/index.d.cts +1 -1
  48. package/dist/management/index.d.ts +1 -1
  49. package/dist/management/index.js +1 -1
  50. package/dist/management/types.d.cts +2 -2
  51. package/dist/management/types.d.ts +2 -2
  52. package/dist/{management-Cz5ut18k.js → management-BAfg8BmK.js} +45 -4
  53. package/dist/management-BAfg8BmK.js.map +1 -0
  54. package/dist/{management-CUXgB2rb.cjs → management-BuNIc7Mr.cjs} +45 -4
  55. package/dist/management-BuNIc7Mr.cjs.map +1 -0
  56. package/dist/metaObject-CSGF3d-o.js +53 -0
  57. package/dist/metaObject-CSGF3d-o.js.map +1 -0
  58. package/dist/metaObject-Ciyow2gr.cjs +64 -0
  59. package/dist/metaObject-Ciyow2gr.cjs.map +1 -0
  60. package/dist/metaObject-ClvW342q.d.ts +35 -0
  61. package/dist/metaObject-D7oudegV.d.cts +35 -0
  62. package/dist/oauth/index.cjs +2 -1
  63. package/dist/oauth/index.d.cts +34 -2
  64. package/dist/oauth/index.d.ts +34 -2
  65. package/dist/oauth/index.js +1 -1
  66. package/dist/oauth/types.d.cts +2 -2
  67. package/dist/oauth/types.d.ts +2 -2
  68. package/dist/{oauth-CSBChWuf.cjs → oauth-CXcrilOp.cjs} +47 -1
  69. package/dist/oauth-CXcrilOp.cjs.map +1 -0
  70. package/dist/{oauth-DOveZKUv.js → oauth-Ci0qeaS2.js} +43 -3
  71. package/dist/oauth-Ci0qeaS2.js.map +1 -0
  72. package/dist/{project-Onf-IcPW.cjs → project-BQ2oD6IW.cjs} +2 -2
  73. package/dist/{project-Onf-IcPW.cjs.map → project-BQ2oD6IW.cjs.map} +1 -1
  74. package/dist/{project-DmuC0bMK.js → project-aAVAOcmx.js} +2 -2
  75. package/dist/{project-DmuC0bMK.js.map → project-aAVAOcmx.js.map} +1 -1
  76. package/dist/queryService/index.d.cts +1 -1
  77. package/dist/queryService/index.d.ts +1 -1
  78. package/dist/queryService/types.d.cts +1 -1
  79. package/dist/queryService/types.d.ts +1 -1
  80. package/dist/queryService-B4h1Ez44.cjs +117 -0
  81. package/dist/queryService-B4h1Ez44.cjs.map +1 -0
  82. package/dist/queryService-DE_yE_S4.js +106 -0
  83. package/dist/queryService-DE_yE_S4.js.map +1 -0
  84. package/dist/queue/index.d.cts +1 -1
  85. package/dist/queue/index.d.ts +1 -1
  86. package/dist/readJwtClaims-CMZ3cNC_.js +28 -0
  87. package/dist/readJwtClaims-CMZ3cNC_.js.map +1 -0
  88. package/dist/readJwtClaims-SVJgo04x.cjs +33 -0
  89. package/dist/readJwtClaims-SVJgo04x.cjs.map +1 -0
  90. package/dist/sdk/configurations/index.cjs +2 -2
  91. package/dist/sdk/configurations/index.d.cts +2 -2
  92. package/dist/sdk/configurations/index.d.ts +2 -2
  93. package/dist/sdk/configurations/index.js +2 -2
  94. package/dist/sdk/dataAppServer/index.cjs +230 -0
  95. package/dist/sdk/dataAppServer/index.cjs.map +1 -0
  96. package/dist/sdk/dataAppServer/index.d.cts +55 -0
  97. package/dist/sdk/dataAppServer/index.d.ts +55 -0
  98. package/dist/sdk/dataAppServer/index.js +228 -0
  99. package/dist/sdk/dataAppServer/index.js.map +1 -0
  100. package/dist/sdk/developerPortal/index.cjs +3 -15
  101. package/dist/sdk/developerPortal/index.cjs.map +1 -1
  102. package/dist/sdk/developerPortal/index.js +3 -15
  103. package/dist/sdk/developerPortal/index.js.map +1 -1
  104. package/dist/sdk/queryService/index.cjs +3 -70
  105. package/dist/sdk/queryService/index.d.cts +2 -2
  106. package/dist/sdk/queryService/index.d.ts +2 -2
  107. package/dist/sdk/queryService/index.js +1 -70
  108. package/dist/sdk/securityPolicy/index.cjs +355 -0
  109. package/dist/sdk/securityPolicy/index.cjs.map +1 -0
  110. package/dist/sdk/securityPolicy/index.d.cts +100 -0
  111. package/dist/sdk/securityPolicy/index.d.ts +100 -0
  112. package/dist/sdk/securityPolicy/index.js +342 -0
  113. package/dist/sdk/securityPolicy/index.js.map +1 -0
  114. package/dist/sdk/securityPolicy/types.cjs +0 -0
  115. package/dist/sdk/securityPolicy/types.d.cts +2 -0
  116. package/dist/sdk/securityPolicy/types.d.ts +2 -0
  117. package/dist/sdk/securityPolicy/types.js +1 -0
  118. package/dist/sdk/semanticLayer/index.cjs +3 -2
  119. package/dist/sdk/semanticLayer/index.d.cts +8 -3
  120. package/dist/sdk/semanticLayer/index.d.ts +8 -3
  121. package/dist/sdk/semanticLayer/index.js +3 -1
  122. package/dist/sdk/semanticLayer/types.d.cts +1 -1
  123. package/dist/sdk/semanticLayer/types.d.ts +1 -1
  124. package/dist/sdk/vault/index.d.cts +1 -1
  125. package/dist/sdk/vault/index.d.ts +1 -1
  126. package/dist/{semanticLayer-djom-J78.cjs → semanticLayer-BVpdWKJn.cjs} +19 -52
  127. package/dist/semanticLayer-BVpdWKJn.cjs.map +1 -0
  128. package/dist/{semanticLayer-BdPW_wLo.js → semanticLayer-Btj1Qy9O.js} +20 -47
  129. package/dist/semanticLayer-Btj1Qy9O.js.map +1 -0
  130. package/dist/serviceIds-Bg1pWiPE.cjs +37 -0
  131. package/dist/serviceIds-Bg1pWiPE.cjs.map +1 -0
  132. package/dist/serviceIds-RAVtP4nK.js +32 -0
  133. package/dist/serviceIds-RAVtP4nK.js.map +1 -0
  134. package/dist/storage/index.d.cts +2 -2
  135. package/dist/storage/index.d.ts +2 -2
  136. package/dist/storage/types.d.cts +2 -2
  137. package/dist/storage/types.d.ts +2 -2
  138. package/dist/syncActions/index.cjs +1 -1
  139. package/dist/syncActions/index.js +1 -1
  140. package/dist/{syncActions-DToUhyP3.cjs → syncActions-CR7xvuIv.cjs} +2 -2
  141. package/dist/{syncActions-DToUhyP3.cjs.map → syncActions-CR7xvuIv.cjs.map} +1 -1
  142. package/dist/{syncActions-DV_aObTQ.js → syncActions-CU4cIGRf.js} +2 -2
  143. package/dist/{syncActions-DV_aObTQ.js.map → syncActions-CU4cIGRf.js.map} +1 -1
  144. package/dist/{types-CLtYOszN.d.cts → types-B7FKoyfy.d.cts} +442 -2
  145. package/dist/{types-iU1Sc1IM.d.ts → types-BDgOF2WN.d.ts} +6 -29
  146. package/dist/types-BXKL0wTI.d.cts +85 -0
  147. package/dist/{types-Ey59ZILC.d.ts → types-COb2O9c1.d.ts} +442 -2
  148. package/dist/{types-DjWubjvP.d.cts → types-CaBcgsT2.d.cts} +121 -53
  149. package/dist/{types-BljDxuWG.d.cts → types-DCARsJWs.d.cts} +6 -29
  150. package/dist/{types-CsVRsObb.d.ts → types-DFcj9YyQ.d.ts} +121 -53
  151. package/dist/types-DK1bSUNr.d.ts +85 -0
  152. package/package.json +40 -1
  153. package/surface/management.md +5 -0
  154. package/surface/sdk.md +2 -0
  155. package/dist/admin-CbMOsfgs.js.map +0 -1
  156. package/dist/admin-Di-MmGFP.cjs.map +0 -1
  157. package/dist/management-CUXgB2rb.cjs.map +0 -1
  158. package/dist/management-Cz5ut18k.js.map +0 -1
  159. package/dist/oauth-CSBChWuf.cjs.map +0 -1
  160. package/dist/oauth-DOveZKUv.js.map +0 -1
  161. package/dist/sdk/queryService/index.cjs.map +0 -1
  162. package/dist/sdk/queryService/index.js.map +0 -1
  163. package/dist/semanticLayer-BdPW_wLo.js.map +0 -1
  164. package/dist/semanticLayer-djom-J78.cjs.map +0 -1
@@ -0,0 +1,355 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_createFetchClient = require("../../createFetchClient-CDKSkd7i.cjs");
3
+ const require_ValidationError = require("../../ValidationError-BXcFX4nD.cjs");
4
+ const require_metaObject = require("../../metaObject-Ciyow2gr.cjs");
5
+ let zod = require("zod");
6
+ // src/sdks/securityPolicy/vocabulary.ts
7
+ /**
8
+ * The metastore's row- and column-level security vocabulary, schema version 1.2.0.
9
+ *
10
+ * - Each list is the one place a value is added; the types in `./types` derive from it.
11
+ */
12
+ const SECURITY_POLICY_TYPES = ["rls-policy", "cls-policy"];
13
+ const POLICY_SQL_DIALECTS = ["snowflake", "bigquery"];
14
+ const RLS_COMPARISON_OPS = [
15
+ "eq",
16
+ "ne",
17
+ "gt",
18
+ "gte",
19
+ "lt",
20
+ "lte"
21
+ ];
22
+ const RLS_LIST_OPS = ["in", "not_in"];
23
+ const RLS_NULL_OPS = ["is_null", "is_not_null"];
24
+ // src/sdks/securityPolicy/schemas.ts
25
+ /** A `<bucket>.<table>` key; also the policy's metastore name. */
26
+ const POLICY_TABLE_PATTERN = /^[A-Za-z0-9_.-]+\.[A-Za-z0-9_-]+$/;
27
+ /** Columns are SQL identifiers that cannot be parameterised, so this pattern is the boundary. */
28
+ const POLICY_COLUMN_PATTERN = /^[A-Za-z0-9_]+$/;
29
+ /** A reader selector `<idp>|<sub>`: the identity provider's issuer, a `|`, the user's `sub`. */
30
+ const POLICY_SUBJECT_PATTERN = /^[^|\s]+\|\S.*$/;
31
+ /**
32
+ * Write validators for untrusted policy input, mirroring metastore schema 1.2.0.
33
+ *
34
+ * - Strict: an unknown key fails, as `additionalProperties: false` does in the metastore.
35
+ * - The identifier patterns are the boundary: `table` and `column` reach SQL unparameterised.
36
+ * - Stricter than the metastore on purpose: a `value` is a string, number, boolean or null, and
37
+ * `values` holds the same; the metastore also lets an arbitrary JSON value through.
38
+ * - The metastore stays the authority; this reports the first problem in words the model can act on.
39
+ */
40
+ const column = zod.z.string().regex(POLICY_COLUMN_PATTERN, "column must match [A-Za-z0-9_]+");
41
+ const literal = zod.z.union([
42
+ zod.z.string(),
43
+ zod.z.number(),
44
+ zod.z.boolean(),
45
+ zod.z.null()
46
+ ]);
47
+ const identityEmail = zod.z.strictObject({ $identity: zod.z.literal("email") });
48
+ const identityGroups = zod.z.strictObject({ $identity: zod.z.literal("groups") });
49
+ const rlsCondition = zod.z.lazy(() => zod.z.union([
50
+ zod.z.strictObject({ true: zod.z.literal(true) }),
51
+ zod.z.strictObject({ false: zod.z.literal(true) }),
52
+ zod.z.strictObject({ and: zod.z.array(rlsCondition).min(2) }),
53
+ zod.z.strictObject({ or: zod.z.array(rlsCondition).min(2) }),
54
+ zod.z.strictObject({
55
+ column,
56
+ op: zod.z.enum(RLS_COMPARISON_OPS),
57
+ value: zod.z.union([literal, identityEmail])
58
+ }),
59
+ zod.z.strictObject({
60
+ column,
61
+ op: zod.z.enum(RLS_LIST_OPS),
62
+ values: zod.z.union([zod.z.array(literal).min(1), identityGroups])
63
+ }),
64
+ zod.z.strictObject({
65
+ column,
66
+ op: zod.z.enum(RLS_NULL_OPS)
67
+ })
68
+ ]));
69
+ /** `["*"]` is everyone and must be the only entry. */
70
+ const selectorList = (item) => zod.z.array(item).min(1).refine((list) => !list.includes("*") || list.length === 1, { message: "\"*\" must be the only entry" });
71
+ const subjects = selectorList(zod.z.union([zod.z.literal("*"), zod.z.string().max(1024).regex(POLICY_SUBJECT_PATTERN, "a subject is \"<idp>|<sub>\", never an email")]));
72
+ const groups = selectorList(zod.z.string().min(1));
73
+ /** A rule selects readers by exactly one of `subjects` or `groups`, then carries `shape`. */
74
+ const rule = (shape) => zod.z.union([zod.z.strictObject({
75
+ subjects,
76
+ ...shape
77
+ }), zod.z.strictObject({
78
+ groups,
79
+ ...shape
80
+ })]);
81
+ const table = zod.z.string().regex(POLICY_TABLE_PATTERN, "table must be \"<bucket>.<table>\"");
82
+ const dialect = zod.z.enum(POLICY_SQL_DIALECTS).optional();
83
+ const rlsPolicySchema = zod.z.strictObject({
84
+ table,
85
+ dialect,
86
+ rules: zod.z.array(rule({ condition: rlsCondition })).min(1),
87
+ default: rlsCondition.optional()
88
+ });
89
+ const clsPolicySchema = zod.z.strictObject({
90
+ table,
91
+ dialect,
92
+ rules: zod.z.array(rule({ visible_columns: zod.z.array(column).min(1) })).min(1)
93
+ });
94
+ // src/sdks/securityPolicy/readSchemas.ts
95
+ /**
96
+ * What a read of the metastore may hand back for a policy.
97
+ *
98
+ * - `looseObject`: fields the metastore adds still reach callers.
99
+ * - An unknown `dialect` reads as absent; a missing `table` or `rules` drops the object.
100
+ * - The envelope is the metastore's own, shared with every object family.
101
+ */
102
+ const policyReadDataSchema = zod.z.looseObject({
103
+ table: zod.z.string(),
104
+ dialect: zod.z.enum(POLICY_SQL_DIALECTS).optional().catch(void 0),
105
+ rules: zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown())),
106
+ default: zod.z.unknown().optional()
107
+ });
108
+ const securityPolicyReadSchema = require_metaObject.metastoreObjectReadSchema(policyReadDataSchema);
109
+ // src/sdks/securityPolicy/securityPolicySdk.ts
110
+ const DEFAULT_BRANCH = "main";
111
+ /** The rule schema Kai writes; a policy created under another version keeps its own. */
112
+ const CURRENT_SCHEMA_VERSION = "1.2.0";
113
+ /** The project owns more than one policy for the table, so which to replace is not for the SDK to guess. */
114
+ var SecurityPolicyAmbiguousError = class extends Error {
115
+ policyType;
116
+ table;
117
+ uuids;
118
+ constructor({ policyType, table, uuids }) {
119
+ super(`The project has ${uuids.length} ${policyType} policies for table '${table}' (${uuids.join(", ")}); pass the uuid of the one to replace.`);
120
+ this.name = "SecurityPolicyAmbiguousError";
121
+ this.policyType = policyType;
122
+ this.table = table;
123
+ this.uuids = uuids;
124
+ }
125
+ };
126
+ /**
127
+ * Thrown by `deletePolicy` on a `409`: other objects still reference the policy, nothing was deleted.
128
+ *
129
+ * - The metastore does not name the referencing objects, so none is reported here.
130
+ */
131
+ var SecurityPolicyInUseError = class extends Error {
132
+ policyType;
133
+ uuid;
134
+ constructor({ policyType, uuid, reason }) {
135
+ super(reason ?? `The ${policyType} policy '${uuid}' is still bound and was not deleted.`);
136
+ this.name = "SecurityPolicyInUseError";
137
+ this.policyType = policyType;
138
+ this.uuid = uuid;
139
+ }
140
+ };
141
+ /**
142
+ * Thrown by `upsertPolicy` when some policy of the type could not be read.
143
+ *
144
+ * - Whether that policy governs the table is unknown, and a second policy on it would AND with it.
145
+ */
146
+ var SecurityPolicyUnreadableError = class extends Error {
147
+ policyType;
148
+ count;
149
+ constructor({ policyType, count }) {
150
+ super(`${count} ${policyType} polic${count === 1 ? "y" : "ies"} of the project could not be read, so it is unknown whether the table already has one; nothing was written.`);
151
+ this.name = "SecurityPolicyUnreadableError";
152
+ this.policyType = policyType;
153
+ this.count = count;
154
+ }
155
+ };
156
+ /** The caller named a policy by `uuid` that the project does not own for the table. */
157
+ var SecurityPolicyNotFoundError = class extends Error {
158
+ policyType;
159
+ table;
160
+ uuid;
161
+ constructor({ policyType, table, uuid }) {
162
+ super(`The project owns no ${policyType} '${uuid}' for table '${table}'.`);
163
+ this.name = "SecurityPolicyNotFoundError";
164
+ this.policyType = policyType;
165
+ this.table = table;
166
+ this.uuid = uuid;
167
+ }
168
+ };
169
+ /**
170
+ * Thrown by `upsertPolicy` when the policy to replace was written under an older schema.
171
+ *
172
+ * - The metastore validates a write against the schema version the object already has, so 1.2.0
173
+ * `subjects` on a 1.0.0 or 1.1.0 policy (`principal`, `principals`) fail with a 422.
174
+ * - Nothing was written. Delete the policy and create it again; a policy an app binds cannot be deleted.
175
+ */
176
+ var SecurityPolicyLegacyError = class extends Error {
177
+ policyType;
178
+ uuid;
179
+ schemaVersion;
180
+ constructor({ policyType, uuid, schemaVersion }) {
181
+ super(`The ${policyType} '${uuid}' is on schema ${schemaVersion}, not ${CURRENT_SCHEMA_VERSION}, and the metastore keeps a policy on the schema it was created with; nothing was written.`);
182
+ this.name = "SecurityPolicyLegacyError";
183
+ this.policyType = policyType;
184
+ this.uuid = uuid;
185
+ this.schemaVersion = schemaVersion;
186
+ }
187
+ };
188
+ /**
189
+ * The policies in a metastore collection response.
190
+ *
191
+ * - A malformed element is dropped, logged without its payload and counted in `unreadable`.
192
+ * - A response that is not a collection throws.
193
+ */
194
+ const parsePolicies = (policyType, data) => {
195
+ const items = require_ValidationError.parseOrThrow(zod.z.array(zod.z.unknown()), data);
196
+ const policies = [];
197
+ let unreadable = 0;
198
+ for (const item of items) {
199
+ const result = securityPolicyReadSchema.safeParse(item);
200
+ if (result.success) {
201
+ policies.push(result.data);
202
+ continue;
203
+ }
204
+ unreadable += 1;
205
+ console.warn(`securityPolicySdk: dropped a ${policyType} from the metastore response, it does not match its declared shape`, require_ValidationError.formatValidationIssues(result.error.issues));
206
+ }
207
+ return {
208
+ policies,
209
+ unreadable
210
+ };
211
+ };
212
+ const createSecurityPolicySdk = ({ metastoreClient, projectId }) => {
213
+ const isOwn = (policy) => policy.meta.projectId === projectId;
214
+ const onDefaultBranch = (policy) => policy.meta.branch === void 0 || policy.meta.branch === DEFAULT_BRANCH;
215
+ /**
216
+ * Every policy of one type the caller can read.
217
+ *
218
+ * - A project admin reads only the policies the project owns. An organization admin also reads
219
+ * organization-scope policies and ones shared into the project; `meta.projectId` tells them apart.
220
+ * - A malformed element is dropped and logged; `listPoliciesWithUnreadable` also counts them.
221
+ * - A response that is not a collection throws.
222
+ */
223
+ const listPoliciesWithUnreadable = async (policyType, signal) => {
224
+ const response = await metastoreClient.repository.getMetaObjects({ objectType: policyType }, signal);
225
+ return parsePolicies(policyType, response.data);
226
+ };
227
+ const listPolicies = async (policyType, signal) => (await listPoliciesWithUnreadable(policyType, signal)).policies;
228
+ /**
229
+ * One policy by UUID, from any project or scope the caller can read.
230
+ *
231
+ * - A policy that does not parse throws a `ValidationError` rather than reading as missing.
232
+ * - `404`: no such policy, or the caller cannot see it.
233
+ */
234
+ const getPolicy = async (policyType, policyUUID, signal) => {
235
+ const response = await metastoreClient.repository.getMetaObject({
236
+ objectType: policyType,
237
+ UUID: policyUUID
238
+ }, signal);
239
+ return require_ValidationError.parseOrThrow(securityPolicyReadSchema, response.data);
240
+ };
241
+ /**
242
+ * Every revision of one policy, newest first.
243
+ *
244
+ * - The metastore lists revisions per object type only, so this reads them all and keeps the policy's.
245
+ * - A revision that does not parse is dropped and logged, as in `listPolicies`.
246
+ */
247
+ const listRevisions = async (policyType, policyUUID, signal) => {
248
+ const response = await metastoreClient.repository.getMetaObjectRevisions({ objectType: policyType }, signal);
249
+ return parsePolicies(policyType, response.data).policies.filter((revision) => revision.uuid === policyUUID).sort((a, b) => (b.meta.revision ?? 0) - (a.meta.revision ?? 0));
250
+ };
251
+ /**
252
+ * Creates the policy for its table, or replaces the one the project owns for it (a PUT).
253
+ *
254
+ * - Found by table on `main`; several owned ones throw `SecurityPolicyAmbiguousError`, `uuid` picks one.
255
+ * - Others' policies are never replaced and come back in `otherPolicyUuids`; no scope is sent.
256
+ * - Refused, nothing written: an unreadable policy of the type, or a legacy-schema one to replace.
257
+ * - `existing`: a batch shares one listing, checks `unreadable` itself and must not repeat a table.
258
+ */
259
+ const upsertPolicy = async (policyType, data, options = {}) => {
260
+ const { table } = data;
261
+ let known = options.existing;
262
+ if (known === void 0) {
263
+ const listed = await listPoliciesWithUnreadable(policyType);
264
+ if (listed.unreadable > 0) throw new SecurityPolicyUnreadableError({
265
+ policyType,
266
+ count: listed.unreadable
267
+ });
268
+ known = listed.policies;
269
+ }
270
+ const onTable = known.filter((policy) => policy.data.table === table && onDefaultBranch(policy));
271
+ const owned = onTable.filter(isOwn);
272
+ const otherPolicyUuids = onTable.filter((policy) => !isOwn(policy)).map((policy) => policy.uuid);
273
+ const current = options.uuid === void 0 ? owned[0] : owned.find((policy) => policy.uuid === options.uuid);
274
+ if (options.uuid !== void 0 && current === void 0) throw new SecurityPolicyNotFoundError({
275
+ policyType,
276
+ table,
277
+ uuid: options.uuid
278
+ });
279
+ if (options.uuid === void 0 && owned.length > 1) throw new SecurityPolicyAmbiguousError({
280
+ policyType,
281
+ table,
282
+ uuids: owned.map((policy) => policy.uuid)
283
+ });
284
+ if (current) {
285
+ if (current.meta.schemaVersion !== void 0 && current.meta.schemaVersion !== CURRENT_SCHEMA_VERSION) throw new SecurityPolicyLegacyError({
286
+ policyType,
287
+ uuid: current.uuid,
288
+ schemaVersion: current.meta.schemaVersion
289
+ });
290
+ await metastoreClient.repository.replaceMetaObject({
291
+ objectType: policyType,
292
+ UUID: current.uuid,
293
+ data,
294
+ name: current.meta.name ?? table
295
+ });
296
+ return {
297
+ action: "updated",
298
+ uuid: current.uuid,
299
+ otherPolicyUuids
300
+ };
301
+ }
302
+ return {
303
+ action: "created",
304
+ uuid: (await metastoreClient.repository.createMetaObject({
305
+ objectType: policyType,
306
+ data,
307
+ branch: DEFAULT_BRANCH,
308
+ name: table
309
+ })).data.id,
310
+ otherPolicyUuids
311
+ };
312
+ };
313
+ /**
314
+ * - `SecurityPolicyInUseError` (`409`): other objects still reference the policy; nothing was deleted.
315
+ * - `404`: no such policy, or it was already deleted.
316
+ */
317
+ const deletePolicy = async (policyType, policyUUID) => {
318
+ try {
319
+ await metastoreClient.repository.deleteMetaObject({
320
+ objectType: policyType,
321
+ UUID: policyUUID
322
+ });
323
+ } catch (error) {
324
+ if (!require_createFetchClient.isApiError(error) || error.response.status !== 409) throw error;
325
+ throw new SecurityPolicyInUseError({
326
+ policyType,
327
+ uuid: policyUUID,
328
+ reason: require_metaObject.metastoreErrorMessage(error.data)
329
+ });
330
+ }
331
+ };
332
+ return {
333
+ listPolicies,
334
+ listPoliciesWithUnreadable,
335
+ getPolicy,
336
+ listRevisions,
337
+ upsertPolicy,
338
+ deletePolicy
339
+ };
340
+ };
341
+ exports.POLICY_SQL_DIALECTS = POLICY_SQL_DIALECTS;
342
+ exports.RLS_COMPARISON_OPS = RLS_COMPARISON_OPS;
343
+ exports.RLS_LIST_OPS = RLS_LIST_OPS;
344
+ exports.RLS_NULL_OPS = RLS_NULL_OPS;
345
+ exports.SECURITY_POLICY_TYPES = SECURITY_POLICY_TYPES;
346
+ exports.SecurityPolicyAmbiguousError = SecurityPolicyAmbiguousError;
347
+ exports.SecurityPolicyInUseError = SecurityPolicyInUseError;
348
+ exports.SecurityPolicyLegacyError = SecurityPolicyLegacyError;
349
+ exports.SecurityPolicyNotFoundError = SecurityPolicyNotFoundError;
350
+ exports.SecurityPolicyUnreadableError = SecurityPolicyUnreadableError;
351
+ exports.clsPolicySchema = clsPolicySchema;
352
+ exports.createSecurityPolicySdk = createSecurityPolicySdk;
353
+ exports.rlsPolicySchema = rlsPolicySchema;
354
+
355
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["z","z","metastoreObjectReadSchema","parseOrThrow","z","formatValidationIssues","isApiError","metastoreErrorMessage"],"sources":["../../../src/sdks/securityPolicy/vocabulary.ts","../../../src/sdks/securityPolicy/schemas.ts","../../../src/sdks/securityPolicy/readSchemas.ts","../../../src/sdks/securityPolicy/securityPolicySdk.ts"],"sourcesContent":["/**\n * The metastore's row- and column-level security vocabulary, schema version 1.2.0.\n *\n * - Each list is the one place a value is added; the types in `./types` derive from it.\n */\n\nexport const SECURITY_POLICY_TYPES = ['rls-policy', 'cls-policy'] as const;\n\nexport const POLICY_SQL_DIALECTS = ['snowflake', 'bigquery'] as const;\n\nexport const RLS_COMPARISON_OPS = ['eq', 'ne', 'gt', 'gte', 'lt', 'lte'] as const;\n\nexport const RLS_LIST_OPS = ['in', 'not_in'] as const;\n\nexport const RLS_NULL_OPS = ['is_null', 'is_not_null'] as const;\n","import { z } from 'zod';\n\nimport type { ClsPolicyData, RlsCondition, RlsPolicyData } from './types';\nimport { POLICY_SQL_DIALECTS, RLS_COMPARISON_OPS, RLS_LIST_OPS, RLS_NULL_OPS } from './vocabulary';\n\n/** A `<bucket>.<table>` key; also the policy's metastore name. */\nconst POLICY_TABLE_PATTERN = /^[A-Za-z0-9_.-]+\\.[A-Za-z0-9_-]+$/;\n\n/** Columns are SQL identifiers that cannot be parameterised, so this pattern is the boundary. */\nconst POLICY_COLUMN_PATTERN = /^[A-Za-z0-9_]+$/;\n\n/** A reader selector `<idp>|<sub>`: the identity provider's issuer, a `|`, the user's `sub`. */\nconst POLICY_SUBJECT_PATTERN = /^[^|\\s]+\\|\\S.*$/;\n\n/**\n * Write validators for untrusted policy input, mirroring metastore schema 1.2.0.\n *\n * - Strict: an unknown key fails, as `additionalProperties: false` does in the metastore.\n * - The identifier patterns are the boundary: `table` and `column` reach SQL unparameterised.\n * - Stricter than the metastore on purpose: a `value` is a string, number, boolean or null, and\n * `values` holds the same; the metastore also lets an arbitrary JSON value through.\n * - The metastore stays the authority; this reports the first problem in words the model can act on.\n */\n\nconst column = z.string().regex(POLICY_COLUMN_PATTERN, 'column must match [A-Za-z0-9_]+');\n\nconst literal = z.union([z.string(), z.number(), z.boolean(), z.null()]);\n\nconst identityEmail = z.strictObject({ $identity: z.literal('email') });\nconst identityGroups = z.strictObject({ $identity: z.literal('groups') });\n\nconst rlsCondition: z.ZodType<RlsCondition> = z.lazy(() =>\n z.union([\n z.strictObject({ true: z.literal(true) }),\n z.strictObject({ false: z.literal(true) }),\n z.strictObject({ and: z.array(rlsCondition).min(2) }),\n z.strictObject({ or: z.array(rlsCondition).min(2) }),\n z.strictObject({\n column,\n op: z.enum(RLS_COMPARISON_OPS),\n value: z.union([literal, identityEmail]),\n }),\n z.strictObject({\n column,\n op: z.enum(RLS_LIST_OPS),\n values: z.union([z.array(literal).min(1), identityGroups]),\n }),\n z.strictObject({ column, op: z.enum(RLS_NULL_OPS) }),\n ]),\n);\n\n/** `[\"*\"]` is everyone and must be the only entry. */\nconst selectorList = (item: z.ZodType<string>) =>\n z\n .array(item)\n .min(1)\n .refine((list) => !list.includes('*') || list.length === 1, {\n message: '\"*\" must be the only entry',\n });\n\nconst subjects = selectorList(\n z.union([\n z.literal('*'),\n z\n .string()\n .max(1024)\n .regex(POLICY_SUBJECT_PATTERN, 'a subject is \"<idp>|<sub>\", never an email'),\n ]),\n);\nconst groups = selectorList(z.string().min(1));\n\n/** A rule selects readers by exactly one of `subjects` or `groups`, then carries `shape`. */\nconst rule = <Shape extends z.ZodRawShape>(shape: Shape) =>\n z.union([z.strictObject({ subjects, ...shape }), z.strictObject({ groups, ...shape })]);\n\nconst table = z.string().regex(POLICY_TABLE_PATTERN, 'table must be \"<bucket>.<table>\"');\nconst dialect = z.enum(POLICY_SQL_DIALECTS).optional();\n\nexport const rlsPolicySchema: z.ZodType<RlsPolicyData> = z.strictObject({\n table,\n dialect,\n rules: z.array(rule({ condition: rlsCondition })).min(1),\n default: rlsCondition.optional(),\n});\n\nexport const clsPolicySchema: z.ZodType<ClsPolicyData> = z.strictObject({\n table,\n dialect,\n rules: z.array(rule({ visible_columns: z.array(column).min(1) })).min(1),\n});\n","import { z } from 'zod';\n\nimport { metastoreObjectReadSchema } from '../../clients/metastore/metaObject';\n\nimport type { SecurityPolicyReadData } from './types';\nimport { POLICY_SQL_DIALECTS } from './vocabulary';\n\n/**\n * What a read of the metastore may hand back for a policy.\n *\n * - `looseObject`: fields the metastore adds still reach callers.\n * - An unknown `dialect` reads as absent; a missing `table` or `rules` drops the object.\n * - The envelope is the metastore's own, shared with every object family.\n */\n\nconst policyReadDataSchema: z.ZodType<SecurityPolicyReadData, unknown> = z.looseObject({\n table: z.string(),\n dialect: z.enum(POLICY_SQL_DIALECTS).optional().catch(undefined),\n rules: z.array(z.record(z.string(), z.unknown())),\n default: z.unknown().optional(),\n});\n\nexport const securityPolicyReadSchema = metastoreObjectReadSchema(policyReadDataSchema);\n","import { z } from 'zod';\n\nimport { metastoreErrorMessage } from '../../clients/metastore/errorMessage';\nimport { formatValidationIssues, parseOrThrow } from '../../errors';\nimport { isApiError } from '../../fetchClient';\n\nimport { securityPolicyReadSchema } from './readSchemas';\nimport type {\n MetastoreClient,\n SecurityPolicy,\n SecurityPolicyDataMap,\n SecurityPolicyType,\n} from './types';\n\nconst DEFAULT_BRANCH = 'main';\n\n/** The rule schema Kai writes; a policy created under another version keeps its own. */\nconst CURRENT_SCHEMA_VERSION = '1.2.0';\n\n/** The project owns more than one policy for the table, so which to replace is not for the SDK to guess. */\nexport class SecurityPolicyAmbiguousError extends Error {\n readonly policyType: SecurityPolicyType;\n readonly table: string;\n readonly uuids: string[];\n\n constructor({\n policyType,\n table,\n uuids,\n }: {\n policyType: SecurityPolicyType;\n table: string;\n uuids: string[];\n }) {\n super(\n `The project has ${uuids.length} ${policyType} policies for table '${table}' ` +\n `(${uuids.join(', ')}); pass the uuid of the one to replace.`,\n );\n this.name = 'SecurityPolicyAmbiguousError';\n this.policyType = policyType;\n this.table = table;\n this.uuids = uuids;\n }\n}\n\n/**\n * Thrown by `deletePolicy` on a `409`: other objects still reference the policy, nothing was deleted.\n *\n * - The metastore does not name the referencing objects, so none is reported here.\n */\nexport class SecurityPolicyInUseError extends Error {\n readonly policyType: SecurityPolicyType;\n readonly uuid: string;\n\n constructor({\n policyType,\n uuid,\n reason,\n }: {\n policyType: SecurityPolicyType;\n uuid: string;\n reason?: string;\n }) {\n super(reason ?? `The ${policyType} policy '${uuid}' is still bound and was not deleted.`);\n this.name = 'SecurityPolicyInUseError';\n this.policyType = policyType;\n this.uuid = uuid;\n }\n}\n\n/**\n * Thrown by `upsertPolicy` when some policy of the type could not be read.\n *\n * - Whether that policy governs the table is unknown, and a second policy on it would AND with it.\n */\nexport class SecurityPolicyUnreadableError extends Error {\n readonly policyType: SecurityPolicyType;\n readonly count: number;\n\n constructor({ policyType, count }: { policyType: SecurityPolicyType; count: number }) {\n super(\n `${count} ${policyType} polic${count === 1 ? 'y' : 'ies'} of the project could not be read, ` +\n `so it is unknown whether the table already has one; nothing was written.`,\n );\n this.name = 'SecurityPolicyUnreadableError';\n this.policyType = policyType;\n this.count = count;\n }\n}\n\n/** The caller named a policy by `uuid` that the project does not own for the table. */\nexport class SecurityPolicyNotFoundError extends Error {\n readonly policyType: SecurityPolicyType;\n readonly table: string;\n readonly uuid: string;\n\n constructor({\n policyType,\n table,\n uuid,\n }: {\n policyType: SecurityPolicyType;\n table: string;\n uuid: string;\n }) {\n super(`The project owns no ${policyType} '${uuid}' for table '${table}'.`);\n this.name = 'SecurityPolicyNotFoundError';\n this.policyType = policyType;\n this.table = table;\n this.uuid = uuid;\n }\n}\n\n/**\n * Thrown by `upsertPolicy` when the policy to replace was written under an older schema.\n *\n * - The metastore validates a write against the schema version the object already has, so 1.2.0\n * `subjects` on a 1.0.0 or 1.1.0 policy (`principal`, `principals`) fail with a 422.\n * - Nothing was written. Delete the policy and create it again; a policy an app binds cannot be deleted.\n */\nexport class SecurityPolicyLegacyError extends Error {\n readonly policyType: SecurityPolicyType;\n readonly uuid: string;\n readonly schemaVersion: string;\n\n constructor({\n policyType,\n uuid,\n schemaVersion,\n }: {\n policyType: SecurityPolicyType;\n uuid: string;\n schemaVersion: string;\n }) {\n super(\n `The ${policyType} '${uuid}' is on schema ${schemaVersion}, not ${CURRENT_SCHEMA_VERSION}, ` +\n `and the metastore keeps a policy on the schema it was created with; nothing was written.`,\n );\n this.name = 'SecurityPolicyLegacyError';\n this.policyType = policyType;\n this.uuid = uuid;\n this.schemaVersion = schemaVersion;\n }\n}\n\ntype Options = {\n metastoreClient: MetastoreClient;\n /** The project the caller writes as; a policy it owns carries this in `meta.projectId`. */\n projectId: number;\n};\n\n/**\n * The policies in a metastore collection response.\n *\n * - A malformed element is dropped, logged without its payload and counted in `unreadable`.\n * - A response that is not a collection throws.\n */\nconst parsePolicies = (\n policyType: SecurityPolicyType,\n data: unknown,\n): { policies: SecurityPolicy[]; unreadable: number } => {\n const items = parseOrThrow(z.array(z.unknown()), data);\n\n const policies: SecurityPolicy[] = [];\n let unreadable = 0;\n for (const item of items) {\n const result = securityPolicyReadSchema.safeParse(item);\n if (result.success) {\n policies.push(result.data);\n continue;\n }\n\n unreadable += 1;\n // Never log the payload: it holds customer identities.\n console.warn(\n `securityPolicySdk: dropped a ${policyType} from the metastore response, it does not ` +\n `match its declared shape`,\n formatValidationIssues(result.error.issues),\n );\n }\n return { policies, unreadable };\n};\n\nexport const createSecurityPolicySdk = ({ metastoreClient, projectId }: Options) => {\n const isOwn = (policy: SecurityPolicy) => policy.meta.projectId === projectId;\n\n // A list without `branch` returns every branch, and a create always writes `main`: a policy on\n // another branch is neither the one to replace nor one that stacks with it.\n const onDefaultBranch = (policy: SecurityPolicy) =>\n policy.meta.branch === undefined || policy.meta.branch === DEFAULT_BRANCH;\n\n /**\n * Every policy of one type the caller can read.\n *\n * - A project admin reads only the policies the project owns. An organization admin also reads\n * organization-scope policies and ones shared into the project; `meta.projectId` tells them apart.\n * - A malformed element is dropped and logged; `listPoliciesWithUnreadable` also counts them.\n * - A response that is not a collection throws.\n */\n const listPoliciesWithUnreadable = async (\n policyType: SecurityPolicyType,\n signal?: AbortSignal,\n ) => {\n const response = await metastoreClient.repository.getMetaObjects(\n { objectType: policyType },\n signal,\n );\n return parsePolicies(policyType, response.data);\n };\n\n const listPolicies = async (policyType: SecurityPolicyType, signal?: AbortSignal) =>\n (await listPoliciesWithUnreadable(policyType, signal)).policies;\n\n /**\n * One policy by UUID, from any project or scope the caller can read.\n *\n * - A policy that does not parse throws a `ValidationError` rather than reading as missing.\n * - `404`: no such policy, or the caller cannot see it.\n */\n const getPolicy = async (\n policyType: SecurityPolicyType,\n policyUUID: string,\n signal?: AbortSignal,\n ) => {\n const response = await metastoreClient.repository.getMetaObject(\n { objectType: policyType, UUID: policyUUID },\n signal,\n );\n return parseOrThrow(securityPolicyReadSchema, response.data);\n };\n\n /**\n * Every revision of one policy, newest first.\n *\n * - The metastore lists revisions per object type only, so this reads them all and keeps the policy's.\n * - A revision that does not parse is dropped and logged, as in `listPolicies`.\n */\n const listRevisions = async (\n policyType: SecurityPolicyType,\n policyUUID: string,\n signal?: AbortSignal,\n ) => {\n const response = await metastoreClient.repository.getMetaObjectRevisions(\n { objectType: policyType },\n signal,\n );\n return parsePolicies(policyType, response.data)\n .policies.filter((revision) => revision.uuid === policyUUID)\n .sort((a, b) => (b.meta.revision ?? 0) - (a.meta.revision ?? 0));\n };\n\n /**\n * Creates the policy for its table, or replaces the one the project owns for it (a PUT).\n *\n * - Found by table on `main`; several owned ones throw `SecurityPolicyAmbiguousError`, `uuid` picks one.\n * - Others' policies are never replaced and come back in `otherPolicyUuids`; no scope is sent.\n * - Refused, nothing written: an unreadable policy of the type, or a legacy-schema one to replace.\n * - `existing`: a batch shares one listing, checks `unreadable` itself and must not repeat a table.\n */\n const upsertPolicy = async <T extends SecurityPolicyType>(\n policyType: T,\n data: SecurityPolicyDataMap[T],\n options: { existing?: SecurityPolicy[]; uuid?: string } = {},\n ): Promise<{ action: 'created' | 'updated'; uuid: string; otherPolicyUuids: string[] }> => {\n const { table } = data;\n let known = options.existing;\n if (known === undefined) {\n const listed = await listPoliciesWithUnreadable(policyType);\n if (listed.unreadable > 0) {\n throw new SecurityPolicyUnreadableError({ policyType, count: listed.unreadable });\n }\n known = listed.policies;\n }\n const onTable = known.filter(\n (policy) => policy.data.table === table && onDefaultBranch(policy),\n );\n const owned = onTable.filter(isOwn);\n const otherPolicyUuids = onTable\n .filter((policy) => !isOwn(policy))\n .map((policy) => policy.uuid);\n\n const current =\n options.uuid === undefined ? owned[0] : owned.find((policy) => policy.uuid === options.uuid);\n if (options.uuid !== undefined && current === undefined) {\n throw new SecurityPolicyNotFoundError({ policyType, table, uuid: options.uuid });\n }\n if (options.uuid === undefined && owned.length > 1) {\n throw new SecurityPolicyAmbiguousError({\n policyType,\n table,\n uuids: owned.map((policy) => policy.uuid),\n });\n }\n\n if (current) {\n if (\n current.meta.schemaVersion !== undefined &&\n current.meta.schemaVersion !== CURRENT_SCHEMA_VERSION\n ) {\n throw new SecurityPolicyLegacyError({\n policyType,\n uuid: current.uuid,\n schemaVersion: current.meta.schemaVersion,\n });\n }\n await metastoreClient.repository.replaceMetaObject({\n objectType: policyType,\n UUID: current.uuid,\n data,\n name: current.meta.name ?? table,\n });\n return { action: 'updated', uuid: current.uuid, otherPolicyUuids };\n }\n\n const created = await metastoreClient.repository.createMetaObject({\n objectType: policyType,\n data,\n branch: DEFAULT_BRANCH,\n name: table,\n });\n return { action: 'created', uuid: created.data.id, otherPolicyUuids };\n };\n\n /**\n * - `SecurityPolicyInUseError` (`409`): other objects still reference the policy; nothing was deleted.\n * - `404`: no such policy, or it was already deleted.\n */\n const deletePolicy = async (policyType: SecurityPolicyType, policyUUID: string) => {\n try {\n await metastoreClient.repository.deleteMetaObject({\n objectType: policyType,\n UUID: policyUUID,\n });\n } catch (error) {\n if (!isApiError(error) || error.response.status !== 409) throw error;\n throw new SecurityPolicyInUseError({\n policyType,\n uuid: policyUUID,\n reason: metastoreErrorMessage(error.data),\n });\n }\n };\n\n return {\n listPolicies,\n listPoliciesWithUnreadable,\n getPolicy,\n listRevisions,\n upsertPolicy,\n deletePolicy,\n };\n};\n"],"mappings":";;;;;;;;;;;AAMA,MAAa,wBAAwB,CAAC,cAAc,YAAY;AAEhE,MAAa,sBAAsB,CAAC,aAAa,UAAU;AAE3D,MAAa,qBAAqB;CAAC;CAAM;CAAM;CAAM;CAAO;CAAM;AAAK;AAEvE,MAAa,eAAe,CAAC,MAAM,QAAQ;AAE3C,MAAa,eAAe,CAAC,WAAW,aAAa;;;ACRrD,MAAM,uBAAuB;;AAG7B,MAAM,wBAAwB;;AAG9B,MAAM,yBAAyB;;;;;;;;;;AAY/B,MAAM,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC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AAA,KAC/B,QAAQ,KAAK,kBAAkB,wBAE/B,MAAM,IAAI,0BAA0B;IAClC;IACA,MAAM,QAAQ;IACd,eAAe,QAAQ,KAAK;GAC9B,CAAC;GAEH,MAAM,gBAAgB,WAAW,kBAAkB;IACjD,YAAY;IACZ,MAAM,QAAQ;IACd;IACA,MAAM,QAAQ,KAAK,QAAQ;GAC7B,CAAC;GACD,OAAO;IAAE,QAAQ;IAAW,MAAM,QAAQ;IAAM;GAAiB;EACnE;EAQA,OAAO;GAAE,QAAQ;GAAW,OAAM,MANZ,gBAAgB,WAAW,iBAAiB;IAChE,YAAY;IACZ;IACA,QAAQ;IACR,MAAM;GACR,CAAC,EAAA,CACyC,KAAK;GAAI;EAAiB;CACtE;;;;;CAMA,MAAM,eAAe,OAAO,YAAgC,eAAuB;EACjF,IAAI;GACF,MAAM,gBAAgB,WAAW,iBAAiB;IAChD,YAAY;IACZ,MAAM;GACR,CAAC;EACH,SAAS,OAAO;GACd,IAAI,CAACG,0BAAAA,WAAW,KAAK,KAAK,MAAM,SAAS,WAAW,KAAK,MAAM;GAC/D,MAAM,IAAI,yBAAyB;IACjC;IACA,MAAM;IACN,QAAQC,mBAAAA,sBAAsB,MAAM,IAAI;GAC1C,CAAC;EACH;CACF;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -0,0 +1,100 @@
1
+ import { n as MetastoreObjectMeta } from "../../metaObject-D7oudegV.cjs";
2
+ import { _ as RLS_COMPARISON_OPS, b as SECURITY_POLICY_TYPES, f as SecurityPolicy, g as POLICY_SQL_DIALECTS, h as SecurityPolicyType, m as SecurityPolicyReadData, p as SecurityPolicyDataMap, r as MetastoreClient, t as ClsPolicyData, u as RlsPolicyData, v as RLS_LIST_OPS, y as RLS_NULL_OPS } from "../../types-BXKL0wTI.cjs";
3
+ import { z } from "zod";
4
+ declare const rlsPolicySchema: z.ZodType<RlsPolicyData>;
5
+ declare const clsPolicySchema: z.ZodType<ClsPolicyData>;
6
+ /** The project owns more than one policy for the table, so which to replace is not for the SDK to guess. */
7
+ declare class SecurityPolicyAmbiguousError extends Error {
8
+ readonly policyType: SecurityPolicyType;
9
+ readonly table: string;
10
+ readonly uuids: string[];
11
+ constructor({ policyType, table, uuids }: {
12
+ policyType: SecurityPolicyType;
13
+ table: string;
14
+ uuids: string[];
15
+ });
16
+ }
17
+ /**
18
+ * Thrown by `deletePolicy` on a `409`: other objects still reference the policy, nothing was deleted.
19
+ *
20
+ * - The metastore does not name the referencing objects, so none is reported here.
21
+ */
22
+ declare class SecurityPolicyInUseError extends Error {
23
+ readonly policyType: SecurityPolicyType;
24
+ readonly uuid: string;
25
+ constructor({ policyType, uuid, reason }: {
26
+ policyType: SecurityPolicyType;
27
+ uuid: string;
28
+ reason?: string;
29
+ });
30
+ }
31
+ /**
32
+ * Thrown by `upsertPolicy` when some policy of the type could not be read.
33
+ *
34
+ * - Whether that policy governs the table is unknown, and a second policy on it would AND with it.
35
+ */
36
+ declare class SecurityPolicyUnreadableError extends Error {
37
+ readonly policyType: SecurityPolicyType;
38
+ readonly count: number;
39
+ constructor({ policyType, count }: {
40
+ policyType: SecurityPolicyType;
41
+ count: number;
42
+ });
43
+ }
44
+ /** The caller named a policy by `uuid` that the project does not own for the table. */
45
+ declare class SecurityPolicyNotFoundError extends Error {
46
+ readonly policyType: SecurityPolicyType;
47
+ readonly table: string;
48
+ readonly uuid: string;
49
+ constructor({ policyType, table, uuid }: {
50
+ policyType: SecurityPolicyType;
51
+ table: string;
52
+ uuid: string;
53
+ });
54
+ }
55
+ /**
56
+ * Thrown by `upsertPolicy` when the policy to replace was written under an older schema.
57
+ *
58
+ * - The metastore validates a write against the schema version the object already has, so 1.2.0
59
+ * `subjects` on a 1.0.0 or 1.1.0 policy (`principal`, `principals`) fail with a 422.
60
+ * - Nothing was written. Delete the policy and create it again; a policy an app binds cannot be deleted.
61
+ */
62
+ declare class SecurityPolicyLegacyError extends Error {
63
+ readonly policyType: SecurityPolicyType;
64
+ readonly uuid: string;
65
+ readonly schemaVersion: string;
66
+ constructor({ policyType, uuid, schemaVersion }: {
67
+ policyType: SecurityPolicyType;
68
+ uuid: string;
69
+ schemaVersion: string;
70
+ });
71
+ }
72
+ type Options = {
73
+ metastoreClient: MetastoreClient;
74
+ /** The project the caller writes as; a policy it owns carries this in `meta.projectId`. */
75
+ projectId: number;
76
+ };
77
+ declare const createSecurityPolicySdk: ({ metastoreClient, projectId }: Options) => {
78
+ listPolicies: (policyType: SecurityPolicyType, signal?: AbortSignal) => Promise<SecurityPolicy[]>;
79
+ listPoliciesWithUnreadable: (policyType: SecurityPolicyType, signal?: AbortSignal) => Promise<{
80
+ policies: SecurityPolicy[];
81
+ unreadable: number;
82
+ }>;
83
+ getPolicy: (policyType: SecurityPolicyType, policyUUID: string, signal?: AbortSignal) => Promise<{
84
+ uuid: string;
85
+ data: SecurityPolicyReadData;
86
+ meta: MetastoreObjectMeta;
87
+ }>;
88
+ listRevisions: (policyType: SecurityPolicyType, policyUUID: string, signal?: AbortSignal) => Promise<SecurityPolicy[]>;
89
+ upsertPolicy: <T extends SecurityPolicyType>(policyType: T, data: SecurityPolicyDataMap[T], options?: {
90
+ existing?: SecurityPolicy[];
91
+ uuid?: string;
92
+ }) => Promise<{
93
+ action: 'created' | 'updated';
94
+ uuid: string;
95
+ otherPolicyUuids: string[];
96
+ }>;
97
+ deletePolicy: (policyType: SecurityPolicyType, policyUUID: string) => Promise<void>;
98
+ };
99
+ export { POLICY_SQL_DIALECTS, RLS_COMPARISON_OPS, RLS_LIST_OPS, RLS_NULL_OPS, SECURITY_POLICY_TYPES, SecurityPolicyAmbiguousError, SecurityPolicyInUseError, SecurityPolicyLegacyError, SecurityPolicyNotFoundError, SecurityPolicyUnreadableError, clsPolicySchema, createSecurityPolicySdk, rlsPolicySchema };
100
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1,100 @@
1
+ import { n as MetastoreObjectMeta } from "../../metaObject-ClvW342q.js";
2
+ import { _ as RLS_COMPARISON_OPS, b as SECURITY_POLICY_TYPES, f as SecurityPolicy, g as POLICY_SQL_DIALECTS, h as SecurityPolicyType, m as SecurityPolicyReadData, p as SecurityPolicyDataMap, r as MetastoreClient, t as ClsPolicyData, u as RlsPolicyData, v as RLS_LIST_OPS, y as RLS_NULL_OPS } from "../../types-DK1bSUNr.js";
3
+ import { z } from "zod";
4
+ declare const rlsPolicySchema: z.ZodType<RlsPolicyData>;
5
+ declare const clsPolicySchema: z.ZodType<ClsPolicyData>;
6
+ /** The project owns more than one policy for the table, so which to replace is not for the SDK to guess. */
7
+ declare class SecurityPolicyAmbiguousError extends Error {
8
+ readonly policyType: SecurityPolicyType;
9
+ readonly table: string;
10
+ readonly uuids: string[];
11
+ constructor({ policyType, table, uuids }: {
12
+ policyType: SecurityPolicyType;
13
+ table: string;
14
+ uuids: string[];
15
+ });
16
+ }
17
+ /**
18
+ * Thrown by `deletePolicy` on a `409`: other objects still reference the policy, nothing was deleted.
19
+ *
20
+ * - The metastore does not name the referencing objects, so none is reported here.
21
+ */
22
+ declare class SecurityPolicyInUseError extends Error {
23
+ readonly policyType: SecurityPolicyType;
24
+ readonly uuid: string;
25
+ constructor({ policyType, uuid, reason }: {
26
+ policyType: SecurityPolicyType;
27
+ uuid: string;
28
+ reason?: string;
29
+ });
30
+ }
31
+ /**
32
+ * Thrown by `upsertPolicy` when some policy of the type could not be read.
33
+ *
34
+ * - Whether that policy governs the table is unknown, and a second policy on it would AND with it.
35
+ */
36
+ declare class SecurityPolicyUnreadableError extends Error {
37
+ readonly policyType: SecurityPolicyType;
38
+ readonly count: number;
39
+ constructor({ policyType, count }: {
40
+ policyType: SecurityPolicyType;
41
+ count: number;
42
+ });
43
+ }
44
+ /** The caller named a policy by `uuid` that the project does not own for the table. */
45
+ declare class SecurityPolicyNotFoundError extends Error {
46
+ readonly policyType: SecurityPolicyType;
47
+ readonly table: string;
48
+ readonly uuid: string;
49
+ constructor({ policyType, table, uuid }: {
50
+ policyType: SecurityPolicyType;
51
+ table: string;
52
+ uuid: string;
53
+ });
54
+ }
55
+ /**
56
+ * Thrown by `upsertPolicy` when the policy to replace was written under an older schema.
57
+ *
58
+ * - The metastore validates a write against the schema version the object already has, so 1.2.0
59
+ * `subjects` on a 1.0.0 or 1.1.0 policy (`principal`, `principals`) fail with a 422.
60
+ * - Nothing was written. Delete the policy and create it again; a policy an app binds cannot be deleted.
61
+ */
62
+ declare class SecurityPolicyLegacyError extends Error {
63
+ readonly policyType: SecurityPolicyType;
64
+ readonly uuid: string;
65
+ readonly schemaVersion: string;
66
+ constructor({ policyType, uuid, schemaVersion }: {
67
+ policyType: SecurityPolicyType;
68
+ uuid: string;
69
+ schemaVersion: string;
70
+ });
71
+ }
72
+ type Options = {
73
+ metastoreClient: MetastoreClient;
74
+ /** The project the caller writes as; a policy it owns carries this in `meta.projectId`. */
75
+ projectId: number;
76
+ };
77
+ declare const createSecurityPolicySdk: ({ metastoreClient, projectId }: Options) => {
78
+ listPolicies: (policyType: SecurityPolicyType, signal?: AbortSignal) => Promise<SecurityPolicy[]>;
79
+ listPoliciesWithUnreadable: (policyType: SecurityPolicyType, signal?: AbortSignal) => Promise<{
80
+ policies: SecurityPolicy[];
81
+ unreadable: number;
82
+ }>;
83
+ getPolicy: (policyType: SecurityPolicyType, policyUUID: string, signal?: AbortSignal) => Promise<{
84
+ uuid: string;
85
+ data: SecurityPolicyReadData;
86
+ meta: MetastoreObjectMeta;
87
+ }>;
88
+ listRevisions: (policyType: SecurityPolicyType, policyUUID: string, signal?: AbortSignal) => Promise<SecurityPolicy[]>;
89
+ upsertPolicy: <T extends SecurityPolicyType>(policyType: T, data: SecurityPolicyDataMap[T], options?: {
90
+ existing?: SecurityPolicy[];
91
+ uuid?: string;
92
+ }) => Promise<{
93
+ action: 'created' | 'updated';
94
+ uuid: string;
95
+ otherPolicyUuids: string[];
96
+ }>;
97
+ deletePolicy: (policyType: SecurityPolicyType, policyUUID: string) => Promise<void>;
98
+ };
99
+ export { POLICY_SQL_DIALECTS, RLS_COMPARISON_OPS, RLS_LIST_OPS, RLS_NULL_OPS, SECURITY_POLICY_TYPES, SecurityPolicyAmbiguousError, SecurityPolicyInUseError, SecurityPolicyLegacyError, SecurityPolicyNotFoundError, SecurityPolicyUnreadableError, clsPolicySchema, createSecurityPolicySdk, rlsPolicySchema };
100
+ //# sourceMappingURL=index.d.ts.map