introspectron 0.2.12 → 2.0.2

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/query.js ADDED
@@ -0,0 +1,425 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeIntrospectionQuery = void 0;
4
+ // @ts-nocheck
5
+ /*
6
+ * IMPORTANT: when editing this file, ensure all operators (e.g. `@>`) are
7
+ * specified in the correct namespace (e.g. `operator(pg_catalog.@>)`). It looks
8
+ * weird, but it prevents clashes with extensions or user code that may
9
+ * overload operators, e.g. extension `intarray` overloads `@>`.
10
+ *
11
+ * NOTE: I'm not doing this with `=` because that way lies madness.
12
+ */
13
+ const makeIntrospectionQuery = (serverVersionNum, options = {}) => {
14
+ const { pgLegacyFunctionsOnly = false, pgIgnoreRBAC = true } = options;
15
+ const unionRBAC = `
16
+ union all
17
+ select pg_roles.oid _oid, pg_roles.*
18
+ from pg_roles, accessible_roles, pg_auth_members
19
+ where pg_auth_members.roleid = pg_roles.oid
20
+ and pg_auth_members.member = accessible_roles._oid
21
+ `;
22
+ return `\
23
+ -- @see https://www.postgresql.org/docs/9.5/static/catalogs.html
24
+ -- @see https://github.com/graphile/graphile-engine/blob/master/packages/graphile-build-pg/src/plugins/introspectionQuery.js
25
+ --
26
+ -- ## Parameters
27
+ -- - \`$1\`: An array of strings that represent the namespaces we are introspecting.
28
+ -- - \`$2\`: set true to include functions/tables/etc that come from extensions
29
+ with
30
+ ${!pgIgnoreRBAC ? 'recursive' : ''} accessible_roles(_oid) as (
31
+ select oid _oid, pg_roles.*
32
+ from pg_roles
33
+ where rolname = current_user
34
+ ${!pgIgnoreRBAC ? unionRBAC : ''}
35
+ ),
36
+ -- @see https://www.postgresql.org/docs/9.5/static/catalog-pg-namespace.html
37
+ namespace as (
38
+ select
39
+ 'namespace' as "kind",
40
+ nsp.oid as "id",
41
+ nsp.nspname as "name",
42
+ dsc.description as "description"
43
+ from
44
+ pg_catalog.pg_namespace as nsp
45
+ left join pg_catalog.pg_description as dsc on dsc.objoid = nsp.oid and dsc.classoid = 'pg_catalog.pg_namespace'::regclass
46
+ where
47
+ nsp.nspname = any ($1)
48
+ order by
49
+ nsp.nspname
50
+ ),
51
+ -- Select all of the remote procedures we can use in this schema. This comes
52
+ -- first so that we can select types and classes using the information we get
53
+ -- from it.
54
+ --
55
+ -- @see https://www.postgresql.org/docs/9.6/static/catalog-pg-proc.html
56
+ procedure as (
57
+ select
58
+ 'procedure' as "kind",
59
+ pro.oid as "id",
60
+ pro.proname as "name",
61
+ dsc.description as "description",
62
+ pro.pronamespace as "namespaceId",
63
+ nsp.nspname as "namespaceName",
64
+ pro.proisstrict as "isStrict",
65
+ pro.proretset as "returnsSet",
66
+ case
67
+ when pro.provolatile = 'i' then true
68
+ when pro.provolatile = 's' then true
69
+ else false
70
+ end as "isStable",
71
+ pro.prorettype as "returnTypeId",
72
+ coalesce(pro.proallargtypes, pro.proargtypes) as "argTypeIds",
73
+ coalesce(pro.proargmodes, array[]::text[]) as "argModes",
74
+ coalesce(pro.proargnames, array[]::text[]) as "argNames",
75
+ pro.pronargs as "inputArgsCount",
76
+ pro.pronargdefaults as "argDefaultsNum",
77
+ pro.procost as "cost",
78
+ exists(select 1 from accessible_roles where has_function_privilege(accessible_roles.oid, pro.oid, 'EXECUTE')) as "aclExecutable",
79
+ (select lanname from pg_catalog.pg_language where pg_language.oid = pro.prolang) as "language"
80
+ from
81
+ pg_catalog.pg_proc as pro
82
+ left join pg_catalog.pg_description as dsc on dsc.objoid = pro.oid and dsc.classoid = 'pg_catalog.pg_proc'::regclass
83
+ left join pg_catalog.pg_namespace as nsp on nsp.oid = pro.pronamespace
84
+ where
85
+ pro.pronamespace in (select "id" from namespace) and
86
+ -- Currently we don’t support functions with variadic arguments. In the
87
+ -- future we may, but for now let’s just ignore functions with variadic
88
+ -- arguments.
89
+ -- TODO: Variadic arguments.
90
+ pro.provariadic = 0 and
91
+ -- Filter our aggregate functions and window functions.
92
+ ${serverVersionNum >= 110000
93
+ ? "pro.prokind = 'f'"
94
+ : 'pro.proisagg = false and pro.proiswindow = false'} and
95
+ ${pgLegacyFunctionsOnly
96
+ ? `\
97
+ -- We want to make sure the argument mode for all of our arguments is
98
+ -- \`IN\` which means \`proargmodes\` will be null.
99
+ pro.proargmodes is null and
100
+ -- Do not select procedures that return \`RECORD\` (oid 2249).
101
+ pro.prorettype operator(pg_catalog.<>) 2249 and`
102
+ : `\
103
+ -- We want to make sure the argument modes for all of our arguments are
104
+ -- \`IN\`, \`OUT\`, \`INOUT\`, or \`TABLE\` (not \`VARIADIC\`).
105
+ (pro.proargmodes is null or pro.proargmodes operator(pg_catalog.<@) array['i','o','b','t']::"char"[]) and
106
+ -- Do not select procedures that return \`RECORD\` (oid 2249) unless they
107
+ -- have \`OUT\`, \`INOUT\`, or \`TABLE\` arguments to define the return type.
108
+ (pro.prorettype operator(pg_catalog.<>) 2249 or pro.proargmodes && array['o','b','t']::"char"[]) and
109
+ -- Do not select procedures that have \`RECORD\` arguments.
110
+ (pro.proallargtypes is null or not (pro.proallargtypes operator(pg_catalog.@>) array[2249::oid])) and`}
111
+ -- Do not select procedures that create range types. These are utility
112
+ -- functions that really don’t need to be exposed in an API.
113
+ pro.proname not in (
114
+ select typ.typname
115
+ from pg_catalog.pg_type as typ
116
+ where typ.typtype = 'r'
117
+ and typ.typnamespace = pro.pronamespace
118
+ ) and
119
+ -- Do not expose trigger functions (type trigger has oid 2279)
120
+ pro.prorettype operator(pg_catalog.<>) 2279 and
121
+ -- We don't want functions that will clash with GraphQL (treat them as private)
122
+ pro.proname not like E'\\\\_\\\\_%' and
123
+ -- We also don’t want procedures that have been defined in our namespace
124
+ -- twice. This leads to duplicate fields in the API which throws an
125
+ -- error. In the future we may support this case. For now though, it is
126
+ -- too complex.
127
+ (
128
+ select count(pro2.*)
129
+ from pg_catalog.pg_proc as pro2
130
+ where pro2.pronamespace = pro.pronamespace
131
+ and pro2.proname = pro.proname
132
+ ) = 1 and
133
+ ($2 is true or not exists(
134
+ select 1
135
+ from pg_catalog.pg_depend
136
+ where pg_depend.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
137
+ and pg_depend.deptype = 'e'
138
+ and pg_depend.classid = 'pg_catalog.pg_proc'::pg_catalog.regclass
139
+ and pg_depend.objid = pro.oid
140
+ ))
141
+ order by
142
+ pro.pronamespace, pro.proname
143
+ ),
144
+ -- @see https://www.postgresql.org/docs/9.5/static/catalog-pg-class.html
145
+ class as (
146
+ select
147
+ 'class' as "kind",
148
+ rel.oid as "id",
149
+ rel.relname as "name",
150
+ rel.relkind as "classKind",
151
+ dsc.description as "description",
152
+ rel.relnamespace as "namespaceId",
153
+ nsp.nspname as "namespaceName",
154
+ rel.reltype as "typeId",
155
+ -- Here we determine whether or not we can use this class in a
156
+ -- \`SELECT\`’s \`FROM\` clause. In order to determine this we look at them
157
+ -- \`relkind\` column, if it is \`i\` (index) or \`c\` (composite), we cannot
158
+ -- select this class. Otherwise we can.
159
+ rel.relkind not in ('i', 'c') as "isSelectable",
160
+ -- Here we are determining whether we can insert/update/delete a class.
161
+ -- This is helpful as it lets us detect non-updatable views and then
162
+ -- exclude them from being inserted/updated/deleted into. For more info
163
+ -- on how \`pg_catalog.pg_relation_is_updatable\` works:
164
+ --
165
+ -- - https://www.postgresql.org/message-id/CAEZATCV2_qN9P3zbvADwME_TkYf2gR_X2cLQR4R+pqkwxGxqJg@mail.gmail.com
166
+ -- - https://github.com/postgres/postgres/blob/2410a2543e77983dab1f63f48b2adcd23dba994e/src/backend/utils/adt/misc.c#L684
167
+ -- - https://github.com/postgres/postgres/blob/3aff33aa687e47d52f453892498b30ac98a296af/src/backend/rewrite/rewriteHandler.c#L2351
168
+ (pg_catalog.pg_relation_is_updatable(rel.oid, true)::bit(8) operator(pg_catalog.&) B'00010000') = B'00010000' as "isDeletable",
169
+ (pg_catalog.pg_relation_is_updatable(rel.oid, true)::bit(8) operator(pg_catalog.&) B'00001000') = B'00001000' as "isInsertable",
170
+ (pg_catalog.pg_relation_is_updatable(rel.oid, true)::bit(8) operator(pg_catalog.&) B'00000100') = B'00000100' as "isUpdatable",
171
+ exists(select 1 from accessible_roles where has_table_privilege(accessible_roles.oid, rel.oid, 'SELECT')) as "aclSelectable",
172
+ exists(select 1 from accessible_roles where has_table_privilege(accessible_roles.oid, rel.oid, 'INSERT')) as "aclInsertable",
173
+ exists(select 1 from accessible_roles where has_table_privilege(accessible_roles.oid, rel.oid, 'UPDATE')) as "aclUpdatable",
174
+ exists(select 1 from accessible_roles where has_table_privilege(accessible_roles.oid, rel.oid, 'DELETE')) as "aclDeletable"
175
+ from
176
+ pg_catalog.pg_class as rel
177
+ left join pg_catalog.pg_description as dsc on dsc.objoid = rel.oid and dsc.objsubid = 0 and dsc.classoid = 'pg_catalog.pg_class'::regclass
178
+ left join pg_catalog.pg_namespace as nsp on nsp.oid = rel.relnamespace
179
+ where
180
+ rel.relpersistence in ('p') and
181
+ -- We don't want classes that will clash with GraphQL (treat them as private)
182
+ rel.relname not like E'\\\\_\\\\_%' and
183
+ rel.relkind in ('r', 'v', 'm', 'c', 'f') and
184
+ ($2 is true or not exists(
185
+ select 1
186
+ from pg_catalog.pg_depend
187
+ where pg_depend.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
188
+ and pg_depend.deptype = 'e'
189
+ and pg_depend.classid = 'pg_catalog.pg_class'::pg_catalog.regclass
190
+ and pg_depend.objid = rel.oid
191
+ ))
192
+ order by
193
+ rel.relnamespace, rel.relname
194
+ ),
195
+ -- @see https://www.postgresql.org/docs/9.5/static/catalog-pg-attribute.html
196
+ attribute as (
197
+ select
198
+ 'attribute' as "kind",
199
+ att.attrelid as "classId",
200
+ att.attnum as "num",
201
+ att.attname as "name",
202
+ dsc.description as "description",
203
+ att.atttypid as "typeId",
204
+ nullif(att.atttypmod, -1) as "typeModifier",
205
+ att.attnotnull as "isNotNull",
206
+ att.atthasdef as "hasDefault",
207
+ ${serverVersionNum >= 100000 ? 'att.attidentity' : "''"} as "identity",
208
+ exists(select 1 from accessible_roles where has_column_privilege(accessible_roles.oid, att.attrelid, att.attname, 'SELECT')) as "aclSelectable",
209
+ exists(select 1 from accessible_roles where has_column_privilege(accessible_roles.oid, att.attrelid, att.attname, 'INSERT')) as "aclInsertable",
210
+ exists(select 1 from accessible_roles where has_column_privilege(accessible_roles.oid, att.attrelid, att.attname, 'UPDATE')) as "aclUpdatable",
211
+ -- https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c62dd80cdf149e2792b13c13777a539f5abb0370
212
+ att.attacl is not null and exists(select 1 from aclexplode(att.attacl) aclitem where aclitem.privilege_type = 'SELECT' and grantee in (select oid from accessible_roles)) as "columnLevelSelectGrant"
213
+ from
214
+ pg_catalog.pg_attribute as att
215
+ left join pg_catalog.pg_description as dsc on dsc.objoid = att.attrelid and dsc.objsubid = att.attnum and dsc.classoid = 'pg_catalog.pg_class'::regclass
216
+ where
217
+ att.attrelid in (select "id" from class) and
218
+ att.attnum > 0 and
219
+ -- We don't want attributes that will clash with GraphQL (treat them as private)
220
+ att.attname not like E'\\\\_\\\\_%' and
221
+ not att.attisdropped
222
+ order by
223
+ att.attrelid, att.attnum
224
+ ),
225
+ -- @see https://www.postgresql.org/docs/9.5/static/catalog-pg-type.html
226
+ type as (
227
+ -- Use another \`WITH\` statement here, because our \`WHERE\` clause will need
228
+ -- to use it.
229
+ with type_all as (
230
+ select
231
+ 'type' as "kind",
232
+ typ.oid as "id",
233
+ typ.typname as "name",
234
+ dsc.description as "description",
235
+ typ.typnamespace as "namespaceId",
236
+ -- We include the namespace name in types only because we select so
237
+ -- many types that are outside of our core set of namespaces. Having
238
+ -- the namespace name is super helpful when generating SQL, so
239
+ -- conditionally having namespace names for types is a pain.
240
+ nsp.nspname as "namespaceName",
241
+ typ.typtype as "type",
242
+ typ.typcategory as "category",
243
+ typ.typnotnull as "domainIsNotNull",
244
+ nullif(typ.typelem, 0) as "arrayItemTypeId",
245
+ typ.typlen as "typeLength",
246
+ (typ.typelem <> 0 and typ.typlen = -1) as "isPgArray",
247
+ nullif(typ.typrelid, 0) as "classId",
248
+ nullif(typ.typbasetype, 0) as "domainBaseTypeId",
249
+ nullif(typ.typtypmod, -1) as "domainTypeModifier",
250
+ typ.typdefaultbin is not null as "domainHasDefault",
251
+ -- If this type is an enum type, let’s select all of its enum variants.
252
+ --
253
+ -- @see https://www.postgresql.org/docs/9.5/static/catalog-pg-enum.html
254
+ case
255
+ when typ.typtype = 'e' then array(
256
+ select enm.enumlabel
257
+ from pg_catalog.pg_enum as enm
258
+ where enm.enumtypid = typ.oid
259
+ order by enm.enumsortorder
260
+ )
261
+ else null
262
+ end as "enumVariants",
263
+ -- If this type is a range type, we want to select the sub type of the
264
+ -- range.
265
+ --
266
+ -- @see https://www.postgresql.org/docs/9.6/static/catalog-pg-range.html
267
+ case
268
+ when typ.typtype = 'r' then (
269
+ select rng.rngsubtype
270
+ from pg_catalog.pg_range as rng
271
+ where rng.rngtypid = typ.oid
272
+ limit 1
273
+ )
274
+ else null
275
+ end as "rangeSubTypeId"
276
+ from
277
+ pg_catalog.pg_type as typ
278
+ left join pg_catalog.pg_description as dsc on dsc.objoid = typ.oid and dsc.classoid = 'pg_catalog.pg_type'::regclass
279
+ left join pg_catalog.pg_namespace as nsp on nsp.oid = typ.typnamespace
280
+ )
281
+ select
282
+ *
283
+ from
284
+ type_all as typ
285
+ where
286
+ typ.id in (
287
+ select "typeId" from class
288
+ union all
289
+ select "typeId" from attribute
290
+ union all
291
+ select "returnTypeId" from procedure
292
+ union all
293
+ select unnest("argTypeIds") from procedure
294
+ union all
295
+ -- If this type is a base type for *any* domain type, we will include it
296
+ -- in our selection. This may mean we fetch more types than we need, but
297
+ -- the alternative is to do some funky SQL recursion which would be hard
298
+ -- code to read. So we prefer code readability over selecting like 3 or
299
+ -- 4 less type rows.
300
+ --
301
+ -- We also do this for range sub types and array item types.
302
+ select "domainBaseTypeId" from type_all
303
+ union all
304
+ select "rangeSubTypeId" from type_all
305
+ union all
306
+ select "arrayItemTypeId" from type_all
307
+ )
308
+ order by
309
+ "namespaceId", "name"
310
+ ),
311
+ -- @see https://www.postgresql.org/docs/9.5/static/catalog-pg-constraint.html
312
+ "constraint" as (
313
+ select distinct on (con.conrelid, con.conkey, con.confrelid, con.confkey)
314
+ 'constraint' as "kind",
315
+ con.oid as "id",
316
+ con.conname as "name",
317
+ con.contype as "type",
318
+ con.conrelid as "classId",
319
+ nullif(con.confrelid, 0) as "foreignClassId",
320
+ dsc.description as "description",
321
+ con.conkey as "keyAttributeNums",
322
+ con.confkey as "foreignKeyAttributeNums"
323
+ from
324
+ pg_catalog.pg_constraint as con
325
+ inner join class on (con.conrelid = class.id)
326
+ left join pg_catalog.pg_description as dsc on dsc.objoid = con.oid and dsc.classoid = 'pg_catalog.pg_constraint'::regclass
327
+ where
328
+ -- Only get constraints for classes we have selected.
329
+ con.conrelid in (select "id" from class where "namespaceId" in (select "id" from namespace)) and
330
+ case
331
+ -- If this is a foreign key constraint, we want to ensure that the
332
+ -- foreign class is also in the list of classes we have already
333
+ -- selected.
334
+ when con.contype = 'f' then con.confrelid in (select "id" from class where "namespaceId" in (select "id" from namespace))
335
+ -- Otherwise, this should be true.
336
+ else true
337
+ end and
338
+ -- We only want foreign key, primary key, and unique constraints. We
339
+ -- made add support for more constraints in the future.
340
+ con.contype in ('f', 'p', 'u')
341
+ order by
342
+ con.conrelid, con.conkey, con.confrelid, con.confkey, con.conname
343
+ ),
344
+ -- @see https://www.postgresql.org/docs/9.5/static/catalog-pg-extension.html
345
+ "extension" as (
346
+ select
347
+ 'extension' as "kind",
348
+ ext.oid as "id",
349
+ ext.extname as "name",
350
+ ext.extnamespace as "namespaceId",
351
+ nsp.nspname as "namespaceName",
352
+ ext.extrelocatable as "relocatable",
353
+ ext.extversion as "version",
354
+ ext.extconfig as "configurationClassIds",
355
+ dsc.description as "description"
356
+ from
357
+ pg_catalog.pg_extension as ext
358
+ left join pg_catalog.pg_description as dsc on dsc.objoid = ext.oid and dsc.classoid = 'pg_catalog.pg_extension'::regclass
359
+ left join pg_catalog.pg_namespace as nsp on nsp.oid = ext.extnamespace
360
+ order by
361
+ ext.extname, ext.oid
362
+ ),
363
+ -- @see https://www.postgresql.org/docs/9.5/static/catalog-pg-index.html
364
+ "indexes" as (
365
+ select
366
+ 'index' as "kind",
367
+ idx.indexrelid as "id",
368
+ idx_more.relname as "name",
369
+ nsp.nspname as "namespaceName",
370
+ idx.indrelid as "classId",
371
+ idx.indnatts as "numberOfAttributes",
372
+ idx.indisunique as "isUnique",
373
+ idx.indisprimary as "isPrimary",
374
+ idx.indimmediate as "isImmediate", -- enforce uniqueness immediately on insert
375
+ idx.indisreplident as "isReplicaIdentity",
376
+ idx.indisvalid as "isValid", -- if false, don't use for queries
377
+ idx.indpred is not null as "isPartial", -- if true, index is not on on rows.
378
+ idx.indkey as "attributeNums",
379
+ am.amname as "indexType",
380
+ ${serverVersionNum >= 90600
381
+ ? `\
382
+ (
383
+ select array_agg(pg_index_column_has_property(idx.indexrelid,n::int2,'asc'))
384
+ from unnest(idx.indkey) with ordinality as ord(key,n)
385
+ ) as "attributePropertiesAsc",
386
+ (
387
+ select array_agg(pg_index_column_has_property(idx.indexrelid,n::int2,'nulls_first'))
388
+ from unnest(idx.indkey) with ordinality as ord(key,n)
389
+ ) as "attributePropertiesNullsFirst",`
390
+ : ''}
391
+ dsc.description as "description"
392
+ from
393
+ pg_catalog.pg_index as idx
394
+ inner join pg_catalog.pg_class idx_more on (idx.indexrelid = idx_more.oid)
395
+ inner join class on (idx.indrelid = class.id)
396
+ inner join pg_catalog.pg_namespace as nsp on (nsp.oid = idx_more.relnamespace)
397
+ inner join pg_catalog.pg_am as am on (am.oid = idx_more.relam)
398
+ left join pg_catalog.pg_description as dsc on dsc.objoid = idx.indexrelid and dsc.objsubid = 0 and dsc.classoid = 'pg_catalog.pg_class'::regclass
399
+ where
400
+ idx.indislive is not false and
401
+ idx.indisexclusion is not true and -- exclusion index
402
+ idx.indcheckxmin is not true and -- always valid?
403
+ idx.indpred is null -- no partial index predicate
404
+ order by
405
+ idx.indrelid, idx.indexrelid
406
+ )
407
+ select row_to_json(x) as object from namespace as x
408
+ union all
409
+ select row_to_json(x) as object from class as x
410
+ union all
411
+ select row_to_json(x) as object from attribute as x
412
+ union all
413
+ select row_to_json(x) as object from type as x
414
+ union all
415
+ select row_to_json(x) as object from "constraint" as x
416
+ union all
417
+ select row_to_json(x) as object from procedure as x
418
+ union all
419
+ select row_to_json(x) as object from extension as x
420
+ union all
421
+ select row_to_json(x) as object from indexes as x
422
+ ;
423
+ `;
424
+ };
425
+ exports.makeIntrospectionQuery = makeIntrospectionQuery;
package/utils.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const parseTags: (str: any) => any;
2
+ export declare const deepClone: (value: any) => any;
package/utils.js ADDED
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deepClone = exports.parseTags = void 0;
4
+ // @ts-nocheck
5
+ const parseTags = (str) => {
6
+ return str.split(/\r?\n/).reduce((prev, curr) => {
7
+ if (prev.text !== '') {
8
+ return { ...prev, text: `${prev.text}\n${curr}` };
9
+ }
10
+ const match = curr.match(/^@[a-zA-Z][a-zA-Z0-9_]*($|\s)/);
11
+ if (!match) {
12
+ return { ...prev, text: curr };
13
+ }
14
+ const key = match[0].substr(1).trim();
15
+ const value = match[0] === curr ? true : curr.replace(match[0], '');
16
+ return {
17
+ ...prev,
18
+ tags: {
19
+ ...prev.tags,
20
+ [key]: !Object.prototype.hasOwnProperty.call(prev.tags, key)
21
+ ? value
22
+ : Array.isArray(prev.tags[key])
23
+ ? [...prev.tags[key], value]
24
+ : [prev.tags[key], value]
25
+ }
26
+ };
27
+ }, {
28
+ tags: {},
29
+ text: ''
30
+ });
31
+ };
32
+ exports.parseTags = parseTags;
33
+ const deepClone = (value) => {
34
+ if (Array.isArray(value)) {
35
+ return value.map((val) => (0, exports.deepClone)(val));
36
+ }
37
+ else if (typeof value === 'object' && value) {
38
+ return Object.keys(value).reduce((memo, k) => {
39
+ memo[k] = (0, exports.deepClone)(value[k]);
40
+ return memo;
41
+ }, {});
42
+ }
43
+ else {
44
+ return value;
45
+ }
46
+ };
47
+ exports.deepClone = deepClone;
package/CHANGELOG.md DELETED
@@ -1,167 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [0.2.12](https://github.com/launchql/launchql-gen/compare/introspectron@0.2.11...introspectron@0.2.12) (2021-05-06)
7
-
8
- **Note:** Version bump only for package introspectron
9
-
10
-
11
-
12
-
13
-
14
- ## [0.2.11](https://github.com/launchql/launchql-gen/compare/introspectron@0.2.10...introspectron@0.2.11) (2021-05-06)
15
-
16
- **Note:** Version bump only for package introspectron
17
-
18
-
19
-
20
-
21
-
22
- ## [0.2.10](https://github.com/launchql/launchql-gen/compare/introspectron@0.2.9...introspectron@0.2.10) (2021-05-06)
23
-
24
- **Note:** Version bump only for package introspectron
25
-
26
-
27
-
28
-
29
-
30
- ## [0.2.9](https://github.com/launchql/launchql-gen/compare/introspectron@0.2.8...introspectron@0.2.9) (2021-05-06)
31
-
32
-
33
- ### Bug Fixes
34
-
35
- * unfilter custom scalar ([5861299](https://github.com/launchql/launchql-gen/commit/5861299bf3fec34dd048250ecd365a99046db100))
36
- * **introspectron:** selections should not filter custom scalar types ([1c60fd9](https://github.com/launchql/launchql-gen/commit/1c60fd9e663d8fc371de5869a40dd67fd4797672))
37
-
38
-
39
-
40
-
41
-
42
- ## [0.2.8](https://github.com/launchql/launchql-gen/compare/introspectron@0.2.7...introspectron@0.2.8) (2021-03-04)
43
-
44
- **Note:** Version bump only for package introspectron
45
-
46
-
47
-
48
-
49
-
50
- ## [0.2.7](https://github.com/launchql/launchql-gen/compare/introspectron@0.2.6...introspectron@0.2.7) (2021-03-04)
51
-
52
- **Note:** Version bump only for package introspectron
53
-
54
-
55
-
56
-
57
-
58
- ## [0.2.6](https://github.com/launchql/launchql-gen/compare/introspectron@0.2.5...introspectron@0.2.6) (2021-03-04)
59
-
60
- **Note:** Version bump only for package introspectron
61
-
62
-
63
-
64
-
65
-
66
- ## [0.2.5](https://github.com/launchql/launchql-gen/compare/introspectron@0.2.4...introspectron@0.2.5) (2021-03-04)
67
-
68
- **Note:** Version bump only for package introspectron
69
-
70
-
71
-
72
-
73
-
74
- ## [0.2.4](https://github.com/launchql/launchql-gen/compare/introspectron@0.2.3...introspectron@0.2.4) (2021-02-11)
75
-
76
- **Note:** Version bump only for package introspectron
77
-
78
-
79
-
80
-
81
-
82
- ## [0.2.3](https://github.com/launchql/launchql-gen/compare/introspectron@0.2.2...introspectron@0.2.3) (2021-02-11)
83
-
84
- **Note:** Version bump only for package introspectron
85
-
86
-
87
-
88
-
89
-
90
- ## [0.2.2](https://github.com/pyramation/launchql-gen/compare/introspectron@0.2.1...introspectron@0.2.2) (2020-12-27)
91
-
92
-
93
- ### Bug Fixes
94
-
95
- * add 1 more level of selection for generated queries ([3f2447f](https://github.com/pyramation/launchql-gen/commit/3f2447ff73d36eea5f7970af45877473f15d71bc))
96
-
97
-
98
-
99
-
100
-
101
- ## [0.2.1](https://github.com/pyramation/launchql-gen/compare/introspectron@0.2.0...introspectron@0.2.1) (2020-10-17)
102
-
103
- **Note:** Version bump only for package introspectron
104
-
105
-
106
-
107
-
108
-
109
- # [0.2.0](https://github.com/pyramation/launchql-gen/compare/introspectron@0.1.1...introspectron@0.2.0) (2020-10-05)
110
-
111
- **Note:** Version bump only for package introspectron
112
-
113
-
114
-
115
-
116
-
117
- ## [0.1.1](https://github.com/pyramation/launchql-gen/compare/introspectron@0.0.6...introspectron@0.1.1) (2020-09-05)
118
-
119
- **Note:** Version bump only for package introspectron
120
-
121
-
122
-
123
-
124
-
125
- # [0.1.0](https://github.com/pyramation/launchql-gen/compare/introspectron@0.0.6...introspectron@0.1.0) (2020-09-05)
126
-
127
- **Note:** Version bump only for package introspectron
128
-
129
-
130
-
131
-
132
-
133
- ## [0.0.6](https://github.com/pyramation/launchql-gen/compare/introspectron@0.0.5...introspectron@0.0.6) (2020-09-05)
134
-
135
- **Note:** Version bump only for package introspectron
136
-
137
-
138
-
139
-
140
-
141
- ## [0.0.5](https://github.com/pyramation/launchql-gen/compare/introspectron@0.0.4...introspectron@0.0.5) (2020-09-05)
142
-
143
- **Note:** Version bump only for package introspectron
144
-
145
-
146
-
147
-
148
-
149
- ## [0.0.4](https://github.com/pyramation/launchql-gen/compare/introspectron@0.0.3...introspectron@0.0.4) (2020-09-04)
150
-
151
- **Note:** Version bump only for package introspectron
152
-
153
-
154
-
155
-
156
-
157
- ## [0.0.3](https://github.com/pyramation/launchql-gen/compare/introspectron@0.0.2...introspectron@0.0.3) (2020-09-04)
158
-
159
- **Note:** Version bump only for package introspectron
160
-
161
-
162
-
163
-
164
-
165
- ## 0.0.2 (2020-09-04)
166
-
167
- **Note:** Version bump only for package introspectron