fern-api 0.26.4 → 0.26.6
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/bundle.cjs +618 -270
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -372886,7 +372886,8 @@ var init_ArraySchemaWithExample2 = __esm({
|
|
|
372886
372886
|
"pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/parseIr/types/ArraySchemaWithExample.js"() {
|
|
372887
372887
|
init_core3();
|
|
372888
372888
|
ArraySchemaWithExample = schemas_exports5.objectWithoutOptionalProperties({
|
|
372889
|
-
value: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaWithExample)
|
|
372889
|
+
value: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaWithExample),
|
|
372890
|
+
example: schemas_exports5.list(schemas_exports5.unknown()).optional()
|
|
372890
372891
|
}).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithSdkGroupName)).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithName)).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription));
|
|
372891
372892
|
}
|
|
372892
372893
|
});
|
|
@@ -438566,6 +438567,88 @@ var require_semver6 = __commonJS({
|
|
|
438566
438567
|
}
|
|
438567
438568
|
});
|
|
438568
438569
|
|
|
438570
|
+
// pnp:/home/circleci/project/.yarn/cache/supports-hyperlinks-npm-2.3.0-d19176eba2-9ee0de3c8c.zip/node_modules/supports-hyperlinks/index.js
|
|
438571
|
+
var require_supports_hyperlinks = __commonJS({
|
|
438572
|
+
"pnp:/home/circleci/project/.yarn/cache/supports-hyperlinks-npm-2.3.0-d19176eba2-9ee0de3c8c.zip/node_modules/supports-hyperlinks/index.js"(exports2, module2) {
|
|
438573
|
+
"use strict";
|
|
438574
|
+
var supportsColor4 = require_supports_color2();
|
|
438575
|
+
var hasFlag4 = require_has_flag();
|
|
438576
|
+
function parseVersion2(versionString) {
|
|
438577
|
+
if (/^\d{3,4}$/.test(versionString)) {
|
|
438578
|
+
const m = /(\d{1,2})(\d{2})/.exec(versionString);
|
|
438579
|
+
return {
|
|
438580
|
+
major: 0,
|
|
438581
|
+
minor: parseInt(m[1], 10),
|
|
438582
|
+
patch: parseInt(m[2], 10)
|
|
438583
|
+
};
|
|
438584
|
+
}
|
|
438585
|
+
const versions = (versionString || "").split(".").map((n2) => parseInt(n2, 10));
|
|
438586
|
+
return {
|
|
438587
|
+
major: versions[0],
|
|
438588
|
+
minor: versions[1],
|
|
438589
|
+
patch: versions[2]
|
|
438590
|
+
};
|
|
438591
|
+
}
|
|
438592
|
+
function supportsHyperlink(stream) {
|
|
438593
|
+
const { env: env5 } = process;
|
|
438594
|
+
if ("FORCE_HYPERLINK" in env5) {
|
|
438595
|
+
return !(env5.FORCE_HYPERLINK.length > 0 && parseInt(env5.FORCE_HYPERLINK, 10) === 0);
|
|
438596
|
+
}
|
|
438597
|
+
if (hasFlag4("no-hyperlink") || hasFlag4("no-hyperlinks") || hasFlag4("hyperlink=false") || hasFlag4("hyperlink=never")) {
|
|
438598
|
+
return false;
|
|
438599
|
+
}
|
|
438600
|
+
if (hasFlag4("hyperlink=true") || hasFlag4("hyperlink=always")) {
|
|
438601
|
+
return true;
|
|
438602
|
+
}
|
|
438603
|
+
if ("NETLIFY" in env5) {
|
|
438604
|
+
return true;
|
|
438605
|
+
}
|
|
438606
|
+
if (!supportsColor4.supportsColor(stream)) {
|
|
438607
|
+
return false;
|
|
438608
|
+
}
|
|
438609
|
+
if (stream && !stream.isTTY) {
|
|
438610
|
+
return false;
|
|
438611
|
+
}
|
|
438612
|
+
if (process.platform === "win32") {
|
|
438613
|
+
return false;
|
|
438614
|
+
}
|
|
438615
|
+
if ("CI" in env5) {
|
|
438616
|
+
return false;
|
|
438617
|
+
}
|
|
438618
|
+
if ("TEAMCITY_VERSION" in env5) {
|
|
438619
|
+
return false;
|
|
438620
|
+
}
|
|
438621
|
+
if ("TERM_PROGRAM" in env5) {
|
|
438622
|
+
const version3 = parseVersion2(env5.TERM_PROGRAM_VERSION);
|
|
438623
|
+
switch (env5.TERM_PROGRAM) {
|
|
438624
|
+
case "iTerm.app":
|
|
438625
|
+
if (version3.major === 3) {
|
|
438626
|
+
return version3.minor >= 1;
|
|
438627
|
+
}
|
|
438628
|
+
return version3.major > 3;
|
|
438629
|
+
case "WezTerm":
|
|
438630
|
+
return version3.major >= 20200620;
|
|
438631
|
+
case "vscode":
|
|
438632
|
+
return version3.major > 1 || version3.major === 1 && version3.minor >= 72;
|
|
438633
|
+
}
|
|
438634
|
+
}
|
|
438635
|
+
if ("VTE_VERSION" in env5) {
|
|
438636
|
+
if (env5.VTE_VERSION === "0.50.0") {
|
|
438637
|
+
return false;
|
|
438638
|
+
}
|
|
438639
|
+
const version3 = parseVersion2(env5.VTE_VERSION);
|
|
438640
|
+
return version3.major > 0 || version3.minor >= 50;
|
|
438641
|
+
}
|
|
438642
|
+
return false;
|
|
438643
|
+
}
|
|
438644
|
+
module2.exports = {
|
|
438645
|
+
supportsHyperlink,
|
|
438646
|
+
stdout: supportsHyperlink(process.stdout),
|
|
438647
|
+
stderr: supportsHyperlink(process.stderr)
|
|
438648
|
+
};
|
|
438649
|
+
}
|
|
438650
|
+
});
|
|
438651
|
+
|
|
438569
438652
|
// pnp:/home/circleci/project/.yarn/cache/builtins-npm-5.0.1-6d4820dd76-66d204657f.zip/node_modules/builtins/index.js
|
|
438570
438653
|
var require_builtins = __commonJS({
|
|
438571
438654
|
"pnp:/home/circleci/project/.yarn/cache/builtins-npm-5.0.1-6d4820dd76-66d204657f.zip/node_modules/builtins/index.js"(exports2, module2) {
|
|
@@ -939805,88 +939888,6 @@ var require_decompress = __commonJS({
|
|
|
939805
939888
|
}
|
|
939806
939889
|
});
|
|
939807
939890
|
|
|
939808
|
-
// pnp:/home/circleci/project/.yarn/cache/supports-hyperlinks-npm-2.3.0-d19176eba2-9ee0de3c8c.zip/node_modules/supports-hyperlinks/index.js
|
|
939809
|
-
var require_supports_hyperlinks = __commonJS({
|
|
939810
|
-
"pnp:/home/circleci/project/.yarn/cache/supports-hyperlinks-npm-2.3.0-d19176eba2-9ee0de3c8c.zip/node_modules/supports-hyperlinks/index.js"(exports2, module2) {
|
|
939811
|
-
"use strict";
|
|
939812
|
-
var supportsColor4 = require_supports_color2();
|
|
939813
|
-
var hasFlag4 = require_has_flag();
|
|
939814
|
-
function parseVersion2(versionString) {
|
|
939815
|
-
if (/^\d{3,4}$/.test(versionString)) {
|
|
939816
|
-
const m = /(\d{1,2})(\d{2})/.exec(versionString);
|
|
939817
|
-
return {
|
|
939818
|
-
major: 0,
|
|
939819
|
-
minor: parseInt(m[1], 10),
|
|
939820
|
-
patch: parseInt(m[2], 10)
|
|
939821
|
-
};
|
|
939822
|
-
}
|
|
939823
|
-
const versions = (versionString || "").split(".").map((n2) => parseInt(n2, 10));
|
|
939824
|
-
return {
|
|
939825
|
-
major: versions[0],
|
|
939826
|
-
minor: versions[1],
|
|
939827
|
-
patch: versions[2]
|
|
939828
|
-
};
|
|
939829
|
-
}
|
|
939830
|
-
function supportsHyperlink(stream) {
|
|
939831
|
-
const { env: env5 } = process;
|
|
939832
|
-
if ("FORCE_HYPERLINK" in env5) {
|
|
939833
|
-
return !(env5.FORCE_HYPERLINK.length > 0 && parseInt(env5.FORCE_HYPERLINK, 10) === 0);
|
|
939834
|
-
}
|
|
939835
|
-
if (hasFlag4("no-hyperlink") || hasFlag4("no-hyperlinks") || hasFlag4("hyperlink=false") || hasFlag4("hyperlink=never")) {
|
|
939836
|
-
return false;
|
|
939837
|
-
}
|
|
939838
|
-
if (hasFlag4("hyperlink=true") || hasFlag4("hyperlink=always")) {
|
|
939839
|
-
return true;
|
|
939840
|
-
}
|
|
939841
|
-
if ("NETLIFY" in env5) {
|
|
939842
|
-
return true;
|
|
939843
|
-
}
|
|
939844
|
-
if (!supportsColor4.supportsColor(stream)) {
|
|
939845
|
-
return false;
|
|
939846
|
-
}
|
|
939847
|
-
if (stream && !stream.isTTY) {
|
|
939848
|
-
return false;
|
|
939849
|
-
}
|
|
939850
|
-
if (process.platform === "win32") {
|
|
939851
|
-
return false;
|
|
939852
|
-
}
|
|
939853
|
-
if ("CI" in env5) {
|
|
939854
|
-
return false;
|
|
939855
|
-
}
|
|
939856
|
-
if ("TEAMCITY_VERSION" in env5) {
|
|
939857
|
-
return false;
|
|
939858
|
-
}
|
|
939859
|
-
if ("TERM_PROGRAM" in env5) {
|
|
939860
|
-
const version3 = parseVersion2(env5.TERM_PROGRAM_VERSION);
|
|
939861
|
-
switch (env5.TERM_PROGRAM) {
|
|
939862
|
-
case "iTerm.app":
|
|
939863
|
-
if (version3.major === 3) {
|
|
939864
|
-
return version3.minor >= 1;
|
|
939865
|
-
}
|
|
939866
|
-
return version3.major > 3;
|
|
939867
|
-
case "WezTerm":
|
|
939868
|
-
return version3.major >= 20200620;
|
|
939869
|
-
case "vscode":
|
|
939870
|
-
return version3.major > 1 || version3.major === 1 && version3.minor >= 72;
|
|
939871
|
-
}
|
|
939872
|
-
}
|
|
939873
|
-
if ("VTE_VERSION" in env5) {
|
|
939874
|
-
if (env5.VTE_VERSION === "0.50.0") {
|
|
939875
|
-
return false;
|
|
939876
|
-
}
|
|
939877
|
-
const version3 = parseVersion2(env5.VTE_VERSION);
|
|
939878
|
-
return version3.major > 0 || version3.minor >= 50;
|
|
939879
|
-
}
|
|
939880
|
-
return false;
|
|
939881
|
-
}
|
|
939882
|
-
module2.exports = {
|
|
939883
|
-
supportsHyperlink,
|
|
939884
|
-
stdout: supportsHyperlink(process.stdout),
|
|
939885
|
-
stderr: supportsHyperlink(process.stderr)
|
|
939886
|
-
};
|
|
939887
|
-
}
|
|
939888
|
-
});
|
|
939889
|
-
|
|
939890
939891
|
// pnp:/home/circleci/project/.yarn/cache/is-buffer-npm-2.0.5-17e563f277-764c9ad8b5.zip/node_modules/is-buffer/index.js
|
|
939891
939892
|
var require_is_buffer = __commonJS({
|
|
939892
939893
|
"pnp:/home/circleci/project/.yarn/cache/is-buffer-npm-2.0.5-17e563f277-764c9ad8b5.zip/node_modules/is-buffer/index.js"(exports2, module2) {
|
|
@@ -973894,6 +973895,11 @@ function isTabbedNavigationConfig3(navigationConfig) {
|
|
|
973894
973895
|
return Array.isArray(navigationConfig) && navigationConfig.length > 0 && navigationConfig[0].tab != null;
|
|
973895
973896
|
}
|
|
973896
973897
|
|
|
973898
|
+
// pnp:/home/circleci/project/packages/cli/configuration/lib/DocsLinks.js
|
|
973899
|
+
var DocsLinks = {
|
|
973900
|
+
oauth: "https://buildwithfern.com/learn/api-definition/fern/api-yml-reference#authentication"
|
|
973901
|
+
};
|
|
973902
|
+
|
|
973897
973903
|
// pnp:/home/circleci/project/packages/cli/configuration/lib/fern-config-json/index.js
|
|
973898
973904
|
var fern_config_json_exports = {};
|
|
973899
973905
|
__export(fern_config_json_exports, {
|
|
@@ -977710,7 +977716,7 @@ var AccessTokenPosthogManager = class {
|
|
|
977710
977716
|
properties: {
|
|
977711
977717
|
...event,
|
|
977712
977718
|
...event.properties,
|
|
977713
|
-
version: "0.26.
|
|
977719
|
+
version: "0.26.6",
|
|
977714
977720
|
usingAccessToken: true
|
|
977715
977721
|
}
|
|
977716
977722
|
});
|
|
@@ -977772,7 +977778,7 @@ var UserPosthogManager = class {
|
|
|
977772
977778
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
977773
977779
|
event: "CLI",
|
|
977774
977780
|
properties: {
|
|
977775
|
-
version: "0.26.
|
|
977781
|
+
version: "0.26.6",
|
|
977776
977782
|
...event,
|
|
977777
977783
|
...event.properties
|
|
977778
977784
|
}
|
|
@@ -988863,9 +988869,12 @@ __export(schemas_exports3, {
|
|
|
988863
988869
|
HttpResponseStreamSchema: () => HttpResponseStreamSchema,
|
|
988864
988870
|
HttpServiceSchema: () => HttpServiceSchema,
|
|
988865
988871
|
MultipleBaseUrlsEnvironmentSchema: () => MultipleBaseUrlsEnvironmentSchema,
|
|
988872
|
+
OAuthAccessTokenRequestPropertiesSchema: () => OAuthAccessTokenRequestPropertiesSchema,
|
|
988873
|
+
OAuthAccessTokenResponsePropertiesSchema: () => OAuthAccessTokenResponsePropertiesSchema,
|
|
988866
988874
|
OAuthClientCredentialsSchema: () => OAuthClientCredentialsSchema,
|
|
988867
988875
|
OAuthGetTokenEndpointSchema: () => OAuthGetTokenEndpointSchema,
|
|
988868
988876
|
OAuthRefreshTokenEndpointSchema: () => OAuthRefreshTokenEndpointSchema,
|
|
988877
|
+
OAuthRefreshTokenRequestPropertiesSchema: () => OAuthRefreshTokenRequestPropertiesSchema,
|
|
988869
988878
|
OAuthSchemeSchema: () => OAuthSchemeSchema,
|
|
988870
988879
|
ObjectPropertySchema: () => ObjectPropertySchema,
|
|
988871
988880
|
ObjectSchema: () => ObjectSchema,
|
|
@@ -988984,29 +988993,37 @@ var HeaderAuthSchemeSchema = AuthVariableSchema.extend({
|
|
|
988984
988993
|
prefix: z.optional(z.string())
|
|
988985
988994
|
});
|
|
988986
988995
|
|
|
988987
|
-
// pnp:/home/circleci/project/packages/cli/yaml/yaml-schema/lib/schemas/
|
|
988988
|
-
var
|
|
988989
|
-
"
|
|
988990
|
-
"
|
|
988991
|
-
|
|
988996
|
+
// pnp:/home/circleci/project/packages/cli/yaml/yaml-schema/lib/schemas/OAuthAccessTokenRequestPropertiesSchema.js
|
|
988997
|
+
var OAuthAccessTokenRequestPropertiesSchema = z.strictObject({
|
|
988998
|
+
"client-id": z.optional(z.string()).describe("The property name for the client ID."),
|
|
988999
|
+
"client-secret": z.optional(z.string()).describe("The property name for the client secret."),
|
|
989000
|
+
scopes: z.optional(z.string()).describe("The property name for the scopes.")
|
|
989001
|
+
});
|
|
989002
|
+
|
|
989003
|
+
// pnp:/home/circleci/project/packages/cli/yaml/yaml-schema/lib/schemas/OAuthAccessTokenResponsePropertiesSchema.js
|
|
989004
|
+
var OAuthAccessTokenResponsePropertiesSchema = z.strictObject({
|
|
989005
|
+
"access-token": z.optional(z.string()).describe("The property name for the access token."),
|
|
989006
|
+
"expires-in": z.optional(z.string()).describe("The property name for the expires in property."),
|
|
989007
|
+
"refresh-token": z.optional(z.string()).describe("The property name for the refresh token.")
|
|
988992
989008
|
});
|
|
988993
989009
|
|
|
988994
989010
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-schema/lib/schemas/OAuthGetTokenEndpointSchema.js
|
|
988995
989011
|
var OAuthGetTokenEndpointSchema = z.strictObject({
|
|
988996
989012
|
endpoint: z.string().describe("The endpoint to get the access token, such as 'auth.get_token')"),
|
|
988997
|
-
"
|
|
989013
|
+
"request-properties": OAuthAccessTokenRequestPropertiesSchema.optional(),
|
|
989014
|
+
"response-properties": OAuthAccessTokenResponsePropertiesSchema.optional()
|
|
988998
989015
|
});
|
|
988999
989016
|
|
|
989000
|
-
// pnp:/home/circleci/project/packages/cli/yaml/yaml-schema/lib/schemas/
|
|
989001
|
-
var
|
|
989002
|
-
"refresh-token": z.string()
|
|
989017
|
+
// pnp:/home/circleci/project/packages/cli/yaml/yaml-schema/lib/schemas/OAuthRefreshTokenRequestPropertiesSchema.js
|
|
989018
|
+
var OAuthRefreshTokenRequestPropertiesSchema = z.strictObject({
|
|
989019
|
+
"refresh-token": z.string().describe("The property name for the refresh token.")
|
|
989003
989020
|
});
|
|
989004
989021
|
|
|
989005
989022
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-schema/lib/schemas/OAuthRefreshTokenEndpointSchema.js
|
|
989006
989023
|
var OAuthRefreshTokenEndpointSchema = z.strictObject({
|
|
989007
989024
|
endpoint: z.string().describe("The endpoint to refresh the access token, such as 'auth.refresh_token')"),
|
|
989008
|
-
"request-properties":
|
|
989009
|
-
"response-properties":
|
|
989025
|
+
"request-properties": OAuthRefreshTokenRequestPropertiesSchema.optional(),
|
|
989026
|
+
"response-properties": OAuthAccessTokenResponsePropertiesSchema.optional()
|
|
989010
989027
|
});
|
|
989011
989028
|
|
|
989012
989029
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-schema/lib/schemas/OAuthClientCredentialsSchema.js
|
|
@@ -990860,7 +990877,8 @@ function getSchemaFromFernType({ fernType, nameOverride, generatedName, descript
|
|
|
990860
990877
|
generatedName,
|
|
990861
990878
|
value: itemType,
|
|
990862
990879
|
description,
|
|
990863
|
-
groupName
|
|
990880
|
+
groupName,
|
|
990881
|
+
example: void 0
|
|
990864
990882
|
}) : void 0,
|
|
990865
990883
|
optional: (itemType) => itemType != null ? SchemaWithExample.optional({
|
|
990866
990884
|
nameOverride,
|
|
@@ -990874,7 +990892,8 @@ function getSchemaFromFernType({ fernType, nameOverride, generatedName, descript
|
|
|
990874
990892
|
generatedName,
|
|
990875
990893
|
value: itemType,
|
|
990876
990894
|
description,
|
|
990877
|
-
groupName
|
|
990895
|
+
groupName,
|
|
990896
|
+
example: void 0
|
|
990878
990897
|
}) : void 0,
|
|
990879
990898
|
literal: (literal2) => SchemaWithExample.literal({
|
|
990880
990899
|
nameOverride,
|
|
@@ -990986,7 +991005,7 @@ function wrapMap({ nameOverride, generatedName, keySchema, valueSchema, wrapAsNu
|
|
|
990986
991005
|
}
|
|
990987
991006
|
|
|
990988
991007
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/convertArray.js
|
|
990989
|
-
function convertArray({ nameOverride, generatedName, breadcrumbs, item, description, wrapAsNullable, context, groupName }) {
|
|
991008
|
+
function convertArray({ nameOverride, generatedName, breadcrumbs, item, description, wrapAsNullable, context, groupName, example }) {
|
|
990990
991009
|
const itemSchema = item == null ? SchemaWithExample.unknown({
|
|
990991
991010
|
nameOverride,
|
|
990992
991011
|
generatedName,
|
|
@@ -991000,10 +991019,11 @@ function convertArray({ nameOverride, generatedName, breadcrumbs, item, descript
|
|
|
991000
991019
|
groupName,
|
|
991001
991020
|
itemSchema,
|
|
991002
991021
|
wrapAsNullable,
|
|
991003
|
-
description
|
|
991022
|
+
description,
|
|
991023
|
+
example
|
|
991004
991024
|
});
|
|
991005
991025
|
}
|
|
991006
|
-
function wrapArray({ nameOverride, generatedName, itemSchema, wrapAsNullable, description, groupName }) {
|
|
991026
|
+
function wrapArray({ nameOverride, generatedName, itemSchema, wrapAsNullable, description, groupName, example }) {
|
|
991007
991027
|
if (wrapAsNullable) {
|
|
991008
991028
|
return SchemaWithExample.nullable({
|
|
991009
991029
|
nameOverride,
|
|
@@ -991013,7 +991033,8 @@ function wrapArray({ nameOverride, generatedName, itemSchema, wrapAsNullable, de
|
|
|
991013
991033
|
generatedName,
|
|
991014
991034
|
value: itemSchema,
|
|
991015
991035
|
description,
|
|
991016
|
-
groupName
|
|
991036
|
+
groupName,
|
|
991037
|
+
example
|
|
991017
991038
|
}),
|
|
991018
991039
|
description,
|
|
991019
991040
|
groupName
|
|
@@ -991024,7 +991045,8 @@ function wrapArray({ nameOverride, generatedName, itemSchema, wrapAsNullable, de
|
|
|
991024
991045
|
generatedName,
|
|
991025
991046
|
value: itemSchema,
|
|
991026
991047
|
description,
|
|
991027
|
-
groupName
|
|
991048
|
+
groupName,
|
|
991049
|
+
example
|
|
991028
991050
|
});
|
|
991029
991051
|
}
|
|
991030
991052
|
|
|
@@ -992099,6 +992121,12 @@ function getExamplesString(schema2) {
|
|
|
992099
992121
|
}
|
|
992100
992122
|
return void 0;
|
|
992101
992123
|
}
|
|
992124
|
+
function getExampleAsArray(schema2) {
|
|
992125
|
+
if (schema2.example != null && Array.isArray(schema2.example)) {
|
|
992126
|
+
return schema2.example;
|
|
992127
|
+
}
|
|
992128
|
+
return void 0;
|
|
992129
|
+
}
|
|
992102
992130
|
|
|
992103
992131
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/convertSchemas.js
|
|
992104
992132
|
var SCHEMA_REFERENCE_PREFIX = "#/components/schemas/";
|
|
@@ -992365,7 +992393,8 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
|
|
|
992365
992393
|
description,
|
|
992366
992394
|
wrapAsNullable,
|
|
992367
992395
|
context,
|
|
992368
|
-
groupName
|
|
992396
|
+
groupName,
|
|
992397
|
+
example: getExampleAsArray(schema2)
|
|
992369
992398
|
});
|
|
992370
992399
|
}
|
|
992371
992400
|
if (schema2.additionalProperties != null && schema2.additionalProperties !== false && hasNoProperties(schema2)) {
|
|
@@ -992760,7 +992789,7 @@ function getPossibleDiscriminantsForSchemaObject({ schema: schema2, context }) {
|
|
|
992760
992789
|
}
|
|
992761
992790
|
for (const [propertyName, propertySchema] of Object.entries(schema2.properties ?? {})) {
|
|
992762
992791
|
const resolvedPropertySchema = isReferenceObject(propertySchema) ? context.resolveSchemaReference(propertySchema) : propertySchema;
|
|
992763
|
-
if (resolvedPropertySchema.type === "string" && resolvedPropertySchema.enum != null && isListOfStrings(resolvedPropertySchema.enum) && resolvedPropertySchema.enum.length === 1 && resolvedPropertySchema.enum[0] != null) {
|
|
992792
|
+
if (resolvedPropertySchema.type === "string" && resolvedPropertySchema.enum != null && isListOfStrings(resolvedPropertySchema.enum) && getEnumSet(resolvedPropertySchema.enum).length === 1 && resolvedPropertySchema.enum[0] != null) {
|
|
992764
992793
|
possibleDiscrimimants[propertyName] = resolvedPropertySchema.enum[0];
|
|
992765
992794
|
}
|
|
992766
992795
|
const maybeConstValue = getProperty(resolvedPropertySchema, "const");
|
|
@@ -992773,6 +992802,20 @@ function getPossibleDiscriminantsForSchemaObject({ schema: schema2, context }) {
|
|
|
992773
992802
|
}
|
|
992774
992803
|
return possibleDiscrimimants;
|
|
992775
992804
|
}
|
|
992805
|
+
function getEnumSet(enums) {
|
|
992806
|
+
if (!enums) {
|
|
992807
|
+
return [];
|
|
992808
|
+
}
|
|
992809
|
+
const set7 = /* @__PURE__ */ new Set();
|
|
992810
|
+
enums.forEach((item) => {
|
|
992811
|
+
if (typeof item === "string") {
|
|
992812
|
+
set7.add(item.toLowerCase());
|
|
992813
|
+
} else {
|
|
992814
|
+
set7.add(item);
|
|
992815
|
+
}
|
|
992816
|
+
});
|
|
992817
|
+
return Array.from(set7);
|
|
992818
|
+
}
|
|
992776
992819
|
function getProperty(object4, property5) {
|
|
992777
992820
|
const extensionValue = object4[property5];
|
|
992778
992821
|
if (extensionValue != null) {
|
|
@@ -993111,6 +993154,20 @@ var ExampleTypeFactory = class {
|
|
|
993111
993154
|
itemExamples.push(itemExample);
|
|
993112
993155
|
}
|
|
993113
993156
|
}
|
|
993157
|
+
} else if (schema2.example != null && schema2.example.length > 0) {
|
|
993158
|
+
for (const item of schema2.example) {
|
|
993159
|
+
const itemExample = this.buildExampleHelper({
|
|
993160
|
+
exampleId,
|
|
993161
|
+
example: item,
|
|
993162
|
+
schema: schema2.value,
|
|
993163
|
+
depth: depth + 1,
|
|
993164
|
+
visitedSchemaIds,
|
|
993165
|
+
options: options2
|
|
993166
|
+
});
|
|
993167
|
+
if (itemExample != null) {
|
|
993168
|
+
itemExamples.push(itemExample);
|
|
993169
|
+
}
|
|
993170
|
+
}
|
|
993114
993171
|
} else {
|
|
993115
993172
|
const itemExample = this.buildExampleHelper({
|
|
993116
993173
|
exampleId,
|
|
@@ -993529,7 +993586,8 @@ function convertSchemaToSchemaWithExample(schema2) {
|
|
|
993529
993586
|
value: convertSchemaToSchemaWithExample(schema2.value),
|
|
993530
993587
|
generatedName: schema2.generatedName,
|
|
993531
993588
|
nameOverride: schema2.nameOverride,
|
|
993532
|
-
groupName: schema2.groupName
|
|
993589
|
+
groupName: schema2.groupName,
|
|
993590
|
+
example: void 0
|
|
993533
993591
|
});
|
|
993534
993592
|
case "enum":
|
|
993535
993593
|
return SchemaWithExample.enum({
|
|
@@ -1002526,10 +1002584,10 @@ var CliContext = class {
|
|
|
1002526
1002584
|
return "fern-api";
|
|
1002527
1002585
|
}
|
|
1002528
1002586
|
getPackageVersion() {
|
|
1002529
|
-
if ("0.26.
|
|
1002587
|
+
if ("0.26.6" == null) {
|
|
1002530
1002588
|
this.logger.error("CLI_VERSION is not defined");
|
|
1002531
1002589
|
}
|
|
1002532
|
-
return "0.26.
|
|
1002590
|
+
return "0.26.6";
|
|
1002533
1002591
|
}
|
|
1002534
1002592
|
getCliName() {
|
|
1002535
1002593
|
if ("fern" == null) {
|
|
@@ -1007044,43 +1007102,107 @@ async function convertOAuthClientCredentials({ propertyResolver, endpointResolve
|
|
|
1007044
1007102
|
}
|
|
1007045
1007103
|
|
|
1007046
1007104
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/convertOAuthUtils.js
|
|
1007105
|
+
var DEFAULT_TOKEN_ENDPOINT = {
|
|
1007106
|
+
requestProperties: {
|
|
1007107
|
+
type: "access_token",
|
|
1007108
|
+
client_id: ["client_id"],
|
|
1007109
|
+
client_secret: ["client_secret"],
|
|
1007110
|
+
scopes: void 0
|
|
1007111
|
+
},
|
|
1007112
|
+
responseProperties: {
|
|
1007113
|
+
type: "access_token",
|
|
1007114
|
+
access_token: ["access_token"],
|
|
1007115
|
+
expires_in: void 0,
|
|
1007116
|
+
refresh_token: void 0
|
|
1007117
|
+
}
|
|
1007118
|
+
};
|
|
1007119
|
+
var DEFAULT_REFRESH_TOKEN_ENDPOINT = {
|
|
1007120
|
+
requestProperties: {
|
|
1007121
|
+
type: "refresh_token",
|
|
1007122
|
+
refresh_token: ["refresh_token"]
|
|
1007123
|
+
},
|
|
1007124
|
+
responseProperties: {
|
|
1007125
|
+
type: "access_token",
|
|
1007126
|
+
access_token: ["access_token"],
|
|
1007127
|
+
refresh_token: void 0,
|
|
1007128
|
+
expires_in: void 0
|
|
1007129
|
+
}
|
|
1007130
|
+
};
|
|
1007047
1007131
|
function getTokenEndpoint(oauthSchema) {
|
|
1007048
|
-
|
|
1007049
|
-
const maybeRefreshToken = oauthSchema["get-token"]["response-properties"]["refresh-token"];
|
|
1007132
|
+
var _a5, _b4;
|
|
1007050
1007133
|
return {
|
|
1007051
1007134
|
endpoint: oauthSchema["get-token"].endpoint,
|
|
1007052
|
-
requestProperties: {
|
|
1007053
|
-
|
|
1007054
|
-
|
|
1007055
|
-
|
|
1007056
|
-
|
|
1007057
|
-
}
|
|
1007058
|
-
responseProperties: {
|
|
1007059
|
-
type: "access_token",
|
|
1007060
|
-
access_token: getResponsePropertyComponents(oauthSchema["get-token"]["response-properties"]["access-token"]),
|
|
1007061
|
-
expires_in: maybeExpiresIn != null ? getResponsePropertyComponents(maybeExpiresIn) : void 0,
|
|
1007062
|
-
refresh_token: maybeRefreshToken != null ? getResponsePropertyComponents(maybeRefreshToken) : void 0
|
|
1007063
|
-
}
|
|
1007135
|
+
requestProperties: getTokenEndpointRequestProperties({
|
|
1007136
|
+
requestProperties: (_a5 = oauthSchema["get-token"]) == null ? void 0 : _a5["request-properties"]
|
|
1007137
|
+
}),
|
|
1007138
|
+
responseProperties: getTokenEndpointResponseProperties({
|
|
1007139
|
+
responseProperties: (_b4 = oauthSchema["get-token"]) == null ? void 0 : _b4["response-properties"]
|
|
1007140
|
+
})
|
|
1007064
1007141
|
};
|
|
1007065
1007142
|
}
|
|
1007066
1007143
|
function getRefreshTokenEndpoint(oauthSchema) {
|
|
1007144
|
+
var _a5, _b4;
|
|
1007067
1007145
|
if (oauthSchema["refresh-token"] == null) {
|
|
1007068
1007146
|
return void 0;
|
|
1007069
1007147
|
}
|
|
1007070
|
-
const maybeExpiresIn = oauthSchema["get-token"]["response-properties"]["expires-in"];
|
|
1007071
|
-
const maybeRefreshToken = oauthSchema["get-token"]["response-properties"]["refresh-token"];
|
|
1007072
1007148
|
return {
|
|
1007073
1007149
|
endpoint: oauthSchema["refresh-token"].endpoint,
|
|
1007074
|
-
requestProperties: {
|
|
1007075
|
-
|
|
1007076
|
-
|
|
1007077
|
-
|
|
1007078
|
-
|
|
1007079
|
-
|
|
1007080
|
-
|
|
1007081
|
-
|
|
1007082
|
-
|
|
1007083
|
-
|
|
1007150
|
+
requestProperties: getRefreshTokenEndpointRequestProperties({
|
|
1007151
|
+
requestProperties: (_a5 = oauthSchema["refresh-token"]) == null ? void 0 : _a5["request-properties"]
|
|
1007152
|
+
}),
|
|
1007153
|
+
responseProperties: getRefreshTokenEndpointResponseProperties({
|
|
1007154
|
+
responseProperties: (_b4 = oauthSchema["refresh-token"]) == null ? void 0 : _b4["response-properties"]
|
|
1007155
|
+
})
|
|
1007156
|
+
};
|
|
1007157
|
+
}
|
|
1007158
|
+
function getTokenEndpointRequestProperties({ requestProperties }) {
|
|
1007159
|
+
if (requestProperties == null) {
|
|
1007160
|
+
return DEFAULT_TOKEN_ENDPOINT.requestProperties;
|
|
1007161
|
+
}
|
|
1007162
|
+
const maybeClientId = requestProperties["client-id"];
|
|
1007163
|
+
const maybeClientSecret = requestProperties["client-secret"];
|
|
1007164
|
+
const maybeScopes = requestProperties.scopes;
|
|
1007165
|
+
return {
|
|
1007166
|
+
type: "access_token",
|
|
1007167
|
+
client_id: maybeClientId != null ? getRequestPropertyComponents(maybeClientId) : DEFAULT_TOKEN_ENDPOINT.requestProperties.client_id,
|
|
1007168
|
+
client_secret: maybeClientSecret != null ? getRequestPropertyComponents(maybeClientSecret) : DEFAULT_TOKEN_ENDPOINT.requestProperties.client_secret,
|
|
1007169
|
+
scopes: maybeScopes != null ? getRequestPropertyComponents(maybeScopes) : DEFAULT_TOKEN_ENDPOINT.requestProperties.scopes
|
|
1007170
|
+
};
|
|
1007171
|
+
}
|
|
1007172
|
+
function getTokenEndpointResponseProperties({ responseProperties }) {
|
|
1007173
|
+
return getTokenEndpointResponsePropertiesWithDefault({
|
|
1007174
|
+
responseProperties,
|
|
1007175
|
+
defaultValue: DEFAULT_TOKEN_ENDPOINT.responseProperties
|
|
1007176
|
+
});
|
|
1007177
|
+
}
|
|
1007178
|
+
function getRefreshTokenEndpointRequestProperties({ requestProperties }) {
|
|
1007179
|
+
if (requestProperties == null) {
|
|
1007180
|
+
return DEFAULT_REFRESH_TOKEN_ENDPOINT.requestProperties;
|
|
1007181
|
+
}
|
|
1007182
|
+
const maybeRefreshToken = requestProperties["refresh-token"];
|
|
1007183
|
+
return {
|
|
1007184
|
+
type: "refresh_token",
|
|
1007185
|
+
refresh_token: maybeRefreshToken != null ? getRequestPropertyComponents(maybeRefreshToken) : DEFAULT_REFRESH_TOKEN_ENDPOINT.requestProperties.refresh_token
|
|
1007186
|
+
};
|
|
1007187
|
+
}
|
|
1007188
|
+
function getRefreshTokenEndpointResponseProperties({ responseProperties }) {
|
|
1007189
|
+
return getTokenEndpointResponsePropertiesWithDefault({
|
|
1007190
|
+
responseProperties,
|
|
1007191
|
+
defaultValue: DEFAULT_REFRESH_TOKEN_ENDPOINT.responseProperties
|
|
1007192
|
+
});
|
|
1007193
|
+
}
|
|
1007194
|
+
function getTokenEndpointResponsePropertiesWithDefault({ responseProperties, defaultValue }) {
|
|
1007195
|
+
if (responseProperties == null) {
|
|
1007196
|
+
return defaultValue;
|
|
1007197
|
+
}
|
|
1007198
|
+
const maybeAccessToken = responseProperties["access-token"];
|
|
1007199
|
+
const maybeExpiresIn = responseProperties["expires-in"];
|
|
1007200
|
+
const maybeRefreshToken = responseProperties["refresh-token"];
|
|
1007201
|
+
return {
|
|
1007202
|
+
type: "access_token",
|
|
1007203
|
+
access_token: maybeAccessToken != null ? getResponsePropertyComponents(maybeAccessToken) : defaultValue.access_token,
|
|
1007204
|
+
expires_in: maybeExpiresIn != null ? getResponsePropertyComponents(maybeExpiresIn) : defaultValue.expires_in,
|
|
1007205
|
+
refresh_token: maybeRefreshToken != null ? getResponsePropertyComponents(maybeRefreshToken) : defaultValue.refresh_token
|
|
1007084
1007206
|
};
|
|
1007085
1007207
|
}
|
|
1007086
1007208
|
|
|
@@ -1012785,6 +1012907,21 @@ var ValidNavigationRule = {
|
|
|
1012785
1012907
|
}
|
|
1012786
1012908
|
};
|
|
1012787
1012909
|
|
|
1012910
|
+
// pnp:/home/circleci/project/.yarn/cache/terminal-link-npm-3.0.0-82cbbd7f4a-85a78ae50a.zip/node_modules/terminal-link/index.js
|
|
1012911
|
+
var import_supports_hyperlinks = __toESM(require_supports_hyperlinks());
|
|
1012912
|
+
function terminalLink(text8, url, { target = "stdout", ...options2 } = {}) {
|
|
1012913
|
+
if (!import_supports_hyperlinks.default[target]) {
|
|
1012914
|
+
if (options2.fallback === false) {
|
|
1012915
|
+
return text8;
|
|
1012916
|
+
}
|
|
1012917
|
+
return typeof options2.fallback === "function" ? options2.fallback(text8, url) : `${text8} (\u200B${url}\u200B)`;
|
|
1012918
|
+
}
|
|
1012919
|
+
return ansi_escapes_default.link(text8, url);
|
|
1012920
|
+
}
|
|
1012921
|
+
terminalLink.isSupported = import_supports_hyperlinks.default.stdout;
|
|
1012922
|
+
terminalLink.stderr = (text8, url, options2 = {}) => terminalLink(text8, url, { target: "stderr", ...options2 });
|
|
1012923
|
+
terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
|
|
1012924
|
+
|
|
1012788
1012925
|
// pnp:/home/circleci/project/packages/cli/yaml/validator/lib/utils/propertyValidatorUtils.js
|
|
1012789
1012926
|
var REQUEST_PREFIX2 = "$request.";
|
|
1012790
1012927
|
var RESPONSE_PREFIX = "$response.";
|
|
@@ -1012813,6 +1012950,15 @@ function requestTypeHasProperty({ typeResolver, file, endpoint, propertyComponen
|
|
|
1012813
1012950
|
});
|
|
1012814
1012951
|
}
|
|
1012815
1012952
|
function inlinedRequestTypeHasProperty({ typeResolver, file, requestType, propertyComponents, validate: validate3 }) {
|
|
1012953
|
+
if (isQueryParameterProperty({
|
|
1012954
|
+
typeResolver,
|
|
1012955
|
+
file,
|
|
1012956
|
+
requestType,
|
|
1012957
|
+
propertyComponents,
|
|
1012958
|
+
validate: validate3
|
|
1012959
|
+
})) {
|
|
1012960
|
+
return true;
|
|
1012961
|
+
}
|
|
1012816
1012962
|
if (requestType.body == null) {
|
|
1012817
1012963
|
return false;
|
|
1012818
1012964
|
}
|
|
@@ -1012848,9 +1012994,25 @@ function inlinedRequestTypeHasProperty({ typeResolver, file, requestType, proper
|
|
|
1012848
1012994
|
validate: validate3
|
|
1012849
1012995
|
});
|
|
1012850
1012996
|
}
|
|
1012997
|
+
function isQueryParameterProperty({ typeResolver, file, requestType, propertyComponents, validate: validate3 }) {
|
|
1012998
|
+
if (propertyComponents.length !== 1 || typeof requestType === "string" || requestType["query-parameters"] == null) {
|
|
1012999
|
+
return false;
|
|
1013000
|
+
}
|
|
1013001
|
+
const queryParameter = requestType["query-parameters"][propertyComponents[0] ?? ""];
|
|
1013002
|
+
if (queryParameter == null) {
|
|
1013003
|
+
return false;
|
|
1013004
|
+
}
|
|
1013005
|
+
const resolvedQueryParameterType = typeResolver.resolveType({
|
|
1013006
|
+
type: typeof queryParameter !== "string" ? queryParameter.type : queryParameter,
|
|
1013007
|
+
file
|
|
1013008
|
+
});
|
|
1013009
|
+
return validate3({
|
|
1013010
|
+
resolvedType: resolvedQueryParameterType
|
|
1013011
|
+
});
|
|
1013012
|
+
}
|
|
1012851
1013013
|
function resolvedTypeHasProperty2({ typeResolver, file, resolvedType, propertyComponents, validate: validate3 }) {
|
|
1012852
1013014
|
if (propertyComponents.length === 0) {
|
|
1012853
|
-
return validate3(resolvedType);
|
|
1013015
|
+
return validate3({ resolvedType });
|
|
1012854
1013016
|
}
|
|
1012855
1013017
|
const objectSchema = maybeObjectSchema2(resolvedType);
|
|
1012856
1013018
|
if (objectSchema == null) {
|
|
@@ -1012993,29 +1013155,61 @@ function trimPrefix(value, prefix) {
|
|
|
1012993
1013155
|
}
|
|
1012994
1013156
|
|
|
1012995
1013157
|
// pnp:/home/circleci/project/packages/cli/yaml/validator/lib/rules/valid-oauth/validateUtils.js
|
|
1012996
|
-
|
|
1012997
|
-
|
|
1012998
|
-
|
|
1012999
|
-
|
|
1013000
|
-
|
|
1013001
|
-
|
|
1013002
|
-
|
|
1013003
|
-
|
|
1013004
|
-
return violations;
|
|
1013005
|
-
}
|
|
1013006
|
-
if (!requestTypeHasProperty({
|
|
1013158
|
+
var DEFAULT_CLIENT_ID = `${REQUEST_PREFIX2}client_id`;
|
|
1013159
|
+
var DEFAULT_CLIENT_SECRET = `${REQUEST_PREFIX2}client_secret`;
|
|
1013160
|
+
var DEFAULT_ACCESS_TOKEN = `${RESPONSE_PREFIX}access_token`;
|
|
1013161
|
+
var DEFAULT_REFRESH_TOKEN = `${REQUEST_PREFIX2}refresh_token`;
|
|
1013162
|
+
function validateClientIdRequestProperty({ endpointId, endpoint, typeResolver, file, clientIdProperty }) {
|
|
1013163
|
+
return validateRequestProperty({
|
|
1013164
|
+
endpointId,
|
|
1013165
|
+
endpoint,
|
|
1013007
1013166
|
typeResolver,
|
|
1013008
1013167
|
file,
|
|
1013168
|
+
requestProperty: clientIdProperty,
|
|
1013169
|
+
propertyValidator: {
|
|
1013170
|
+
propertyID: "client-id",
|
|
1013171
|
+
validate: isStringType
|
|
1013172
|
+
}
|
|
1013173
|
+
});
|
|
1013174
|
+
}
|
|
1013175
|
+
function validateClientSecretRequestProperty({ endpointId, endpoint, typeResolver, file, clientSecretProperty }) {
|
|
1013176
|
+
return validateRequestProperty({
|
|
1013177
|
+
endpointId,
|
|
1013009
1013178
|
endpoint,
|
|
1013010
|
-
|
|
1013011
|
-
|
|
1013012
|
-
|
|
1013013
|
-
|
|
1013014
|
-
|
|
1013015
|
-
|
|
1013016
|
-
}
|
|
1013017
|
-
}
|
|
1013018
|
-
|
|
1013179
|
+
typeResolver,
|
|
1013180
|
+
file,
|
|
1013181
|
+
requestProperty: clientSecretProperty,
|
|
1013182
|
+
propertyValidator: {
|
|
1013183
|
+
propertyID: "client-secret",
|
|
1013184
|
+
validate: isStringType
|
|
1013185
|
+
}
|
|
1013186
|
+
});
|
|
1013187
|
+
}
|
|
1013188
|
+
function validateScopesRequestProperty({ endpointId, endpoint, typeResolver, file, scopesProperty }) {
|
|
1013189
|
+
return validateRequestProperty({
|
|
1013190
|
+
endpointId,
|
|
1013191
|
+
endpoint,
|
|
1013192
|
+
typeResolver,
|
|
1013193
|
+
file,
|
|
1013194
|
+
requestProperty: scopesProperty,
|
|
1013195
|
+
propertyValidator: {
|
|
1013196
|
+
propertyID: "scopes",
|
|
1013197
|
+
validate: isStringType
|
|
1013198
|
+
}
|
|
1013199
|
+
});
|
|
1013200
|
+
}
|
|
1013201
|
+
function validateRefreshTokenRequestProperty({ endpointId, endpoint, typeResolver, file, refreshTokenProperty }) {
|
|
1013202
|
+
return validateRequestProperty({
|
|
1013203
|
+
endpointId,
|
|
1013204
|
+
endpoint,
|
|
1013205
|
+
typeResolver,
|
|
1013206
|
+
file,
|
|
1013207
|
+
requestProperty: refreshTokenProperty,
|
|
1013208
|
+
propertyValidator: {
|
|
1013209
|
+
propertyID: "refresh-token",
|
|
1013210
|
+
validate: isStringType
|
|
1013211
|
+
}
|
|
1013212
|
+
});
|
|
1013019
1013213
|
}
|
|
1013020
1013214
|
function validateAccessTokenResponseProperty({ endpointId, typeResolver, file, resolvedResponseType, accessTokenProperty }) {
|
|
1013021
1013215
|
return validateResponseProperty({
|
|
@@ -1013062,31 +1013256,48 @@ function isValidExpiresInProperty({ typeResolver, file, resolvedType, propertyCo
|
|
|
1013062
1013256
|
file,
|
|
1013063
1013257
|
resolvedType,
|
|
1013064
1013258
|
propertyComponents,
|
|
1013065
|
-
validate:
|
|
1013259
|
+
validate: isIntegerType
|
|
1013066
1013260
|
});
|
|
1013067
1013261
|
}
|
|
1013068
|
-
function isValidExpiryType(resolvedType) {
|
|
1013069
|
-
const primitiveType = maybePrimitiveType(resolvedType);
|
|
1013070
|
-
if (primitiveType == null) {
|
|
1013071
|
-
return false;
|
|
1013072
|
-
}
|
|
1013073
|
-
return primitiveType === "INTEGER";
|
|
1013074
|
-
}
|
|
1013075
1013262
|
function isValidTokenProperty({ typeResolver, file, resolvedType, propertyComponents }) {
|
|
1013076
1013263
|
return resolvedTypeHasProperty2({
|
|
1013077
1013264
|
typeResolver,
|
|
1013078
1013265
|
file,
|
|
1013079
1013266
|
resolvedType,
|
|
1013080
1013267
|
propertyComponents,
|
|
1013081
|
-
validate:
|
|
1013268
|
+
validate: isStringType
|
|
1013082
1013269
|
});
|
|
1013083
1013270
|
}
|
|
1013084
|
-
function
|
|
1013085
|
-
const
|
|
1013086
|
-
|
|
1013087
|
-
|
|
1013271
|
+
function validateRequestProperty({ endpointId, endpoint, typeResolver, file, requestProperty, propertyValidator }) {
|
|
1013272
|
+
const violations = [];
|
|
1013273
|
+
const requestPropertyComponents = getRequestPropertyComponents2(requestProperty);
|
|
1013274
|
+
if (requestPropertyComponents == null) {
|
|
1013275
|
+
violations.push({
|
|
1013276
|
+
severity: "error",
|
|
1013277
|
+
message: `OAuth configuration for endpoint ${source_default.bold(endpointId)} must define a dot-delimited '${propertyValidator.propertyID}' property starting with $request (e.g. $request.${propertyValidator.propertyID}).`
|
|
1013278
|
+
});
|
|
1013279
|
+
return violations;
|
|
1013088
1013280
|
}
|
|
1013089
|
-
|
|
1013281
|
+
if (requestPropertyComponents.length > 1) {
|
|
1013282
|
+
violations.push({
|
|
1013283
|
+
severity: "error",
|
|
1013284
|
+
message: `OAuth configuration for endpoint ${source_default.bold(endpointId)} cannot reference nested $request properties like '${requestProperty}'; expected '$request.${propertyValidator.propertyID}' instead.`
|
|
1013285
|
+
});
|
|
1013286
|
+
return violations;
|
|
1013287
|
+
}
|
|
1013288
|
+
if (!requestTypeHasProperty({
|
|
1013289
|
+
typeResolver,
|
|
1013290
|
+
file,
|
|
1013291
|
+
endpoint,
|
|
1013292
|
+
propertyComponents: requestPropertyComponents,
|
|
1013293
|
+
validate: propertyValidator.validate
|
|
1013294
|
+
})) {
|
|
1013295
|
+
violations.push({
|
|
1013296
|
+
severity: "error",
|
|
1013297
|
+
message: `OAuth configuration for endpoint ${source_default.bold(endpointId)} specifies '${propertyValidator.propertyID}' ${requestProperty}, which is not a valid '${propertyValidator.propertyID}' type.`
|
|
1013298
|
+
});
|
|
1013299
|
+
}
|
|
1013300
|
+
return violations;
|
|
1013090
1013301
|
}
|
|
1013091
1013302
|
function validateResponseProperty({ endpointId, typeResolver, file, resolvedResponseType, responseProperty, propertyValidator }) {
|
|
1013092
1013303
|
const violations = [];
|
|
@@ -1013110,17 +1013321,41 @@ function validateResponseProperty({ endpointId, typeResolver, file, resolvedResp
|
|
|
1013110
1013321
|
}
|
|
1013111
1013322
|
return violations;
|
|
1013112
1013323
|
}
|
|
1013324
|
+
function isIntegerType({ resolvedType }) {
|
|
1013325
|
+
return maybePrimitiveType(resolvedType) === "INTEGER";
|
|
1013326
|
+
}
|
|
1013327
|
+
function isStringType({ resolvedType }) {
|
|
1013328
|
+
return maybePrimitiveType(resolvedType) === "STRING";
|
|
1013329
|
+
}
|
|
1013113
1013330
|
|
|
1013114
1013331
|
// pnp:/home/circleci/project/packages/cli/yaml/validator/lib/rules/valid-oauth/validateRefreshTokenEndpoint.js
|
|
1013115
1013332
|
function validateRefreshTokenEndpoint({ endpointId, endpoint, typeResolver, file, refreshEndpoint }) {
|
|
1013333
|
+
var _a5, _b4, _c4, _d2;
|
|
1013116
1013334
|
const violations = [];
|
|
1013117
|
-
|
|
1013118
|
-
|
|
1013119
|
-
|
|
1013120
|
-
|
|
1013121
|
-
|
|
1013122
|
-
|
|
1013123
|
-
|
|
1013335
|
+
const maybeRefreshToken = (_a5 = refreshEndpoint["request-properties"]) == null ? void 0 : _a5["refresh-token"];
|
|
1013336
|
+
if (maybeRefreshToken != null) {
|
|
1013337
|
+
violations.push(...validateRefreshTokenRequestProperty({
|
|
1013338
|
+
endpointId,
|
|
1013339
|
+
endpoint,
|
|
1013340
|
+
typeResolver,
|
|
1013341
|
+
file,
|
|
1013342
|
+
refreshTokenProperty: maybeRefreshToken
|
|
1013343
|
+
}));
|
|
1013344
|
+
} else {
|
|
1013345
|
+
const refreshTokenViolations = validateRefreshTokenRequestProperty({
|
|
1013346
|
+
endpointId,
|
|
1013347
|
+
endpoint,
|
|
1013348
|
+
typeResolver,
|
|
1013349
|
+
file,
|
|
1013350
|
+
refreshTokenProperty: DEFAULT_REFRESH_TOKEN
|
|
1013351
|
+
});
|
|
1013352
|
+
if (refreshTokenViolations.length > 0) {
|
|
1013353
|
+
violations.push({
|
|
1013354
|
+
severity: "error",
|
|
1013355
|
+
message: `OAuth configuration for endpoint ${source_default.bold(endpointId)} is missing a valid refresh-token, such as '${DEFAULT_REFRESH_TOKEN}'.`
|
|
1013356
|
+
});
|
|
1013357
|
+
}
|
|
1013358
|
+
}
|
|
1013124
1013359
|
const resolvedResponseType = resolveResponseType({ endpoint, typeResolver, file });
|
|
1013125
1013360
|
if (resolvedResponseType == null) {
|
|
1013126
1013361
|
violations.push({
|
|
@@ -1013129,17 +1013364,31 @@ function validateRefreshTokenEndpoint({ endpointId, endpoint, typeResolver, file
|
|
|
1013129
1013364
|
});
|
|
1013130
1013365
|
return violations;
|
|
1013131
1013366
|
}
|
|
1013132
|
-
const
|
|
1013133
|
-
if (
|
|
1013367
|
+
const maybeAccessToken = (_b4 = refreshEndpoint["response-properties"]) == null ? void 0 : _b4["access-token"];
|
|
1013368
|
+
if (maybeAccessToken != null) {
|
|
1013134
1013369
|
violations.push(...validateAccessTokenResponseProperty({
|
|
1013135
1013370
|
endpointId,
|
|
1013136
1013371
|
typeResolver,
|
|
1013137
|
-
file
|
|
1013372
|
+
file,
|
|
1013138
1013373
|
resolvedResponseType,
|
|
1013139
|
-
accessTokenProperty
|
|
1013374
|
+
accessTokenProperty: maybeAccessToken
|
|
1013140
1013375
|
}));
|
|
1013376
|
+
} else {
|
|
1013377
|
+
const accessTokenViolations = validateAccessTokenResponseProperty({
|
|
1013378
|
+
endpointId,
|
|
1013379
|
+
typeResolver,
|
|
1013380
|
+
file,
|
|
1013381
|
+
resolvedResponseType,
|
|
1013382
|
+
accessTokenProperty: DEFAULT_ACCESS_TOKEN
|
|
1013383
|
+
});
|
|
1013384
|
+
if (accessTokenViolations.length > 0) {
|
|
1013385
|
+
violations.push({
|
|
1013386
|
+
severity: "error",
|
|
1013387
|
+
message: `OAuth configuration for endpoint ${source_default.bold(endpointId)} is missing a valid access-token, such as '${DEFAULT_ACCESS_TOKEN}'.`
|
|
1013388
|
+
});
|
|
1013389
|
+
}
|
|
1013141
1013390
|
}
|
|
1013142
|
-
const expiresInProperty = refreshEndpoint["response-properties"]["expires-in"];
|
|
1013391
|
+
const expiresInProperty = (_c4 = refreshEndpoint == null ? void 0 : refreshEndpoint["response-properties"]) == null ? void 0 : _c4["expires-in"];
|
|
1013143
1013392
|
if (expiresInProperty != null) {
|
|
1013144
1013393
|
violations.push(...validateExpiresInResponseProperty({
|
|
1013145
1013394
|
endpointId,
|
|
@@ -1013149,7 +1013398,7 @@ function validateRefreshTokenEndpoint({ endpointId, endpoint, typeResolver, file
|
|
|
1013149
1013398
|
expiresInProperty
|
|
1013150
1013399
|
}));
|
|
1013151
1013400
|
}
|
|
1013152
|
-
const refreshTokenProperty = refreshEndpoint["response-properties"]["refresh-token"];
|
|
1013401
|
+
const refreshTokenProperty = (_d2 = refreshEndpoint == null ? void 0 : refreshEndpoint["response-properties"]) == null ? void 0 : _d2["refresh-token"];
|
|
1013153
1013402
|
if (refreshTokenProperty != null) {
|
|
1013154
1013403
|
violations.push(...validateRefreshTokenResponseProperty({
|
|
1013155
1013404
|
endpointId,
|
|
@@ -1013164,7 +1013413,66 @@ function validateRefreshTokenEndpoint({ endpointId, endpoint, typeResolver, file
|
|
|
1013164
1013413
|
|
|
1013165
1013414
|
// pnp:/home/circleci/project/packages/cli/yaml/validator/lib/rules/valid-oauth/validateTokenEndpoint.js
|
|
1013166
1013415
|
function validateTokenEndpoint({ endpointId, endpoint, typeResolver, file, tokenEndpoint }) {
|
|
1013416
|
+
var _a5, _b4, _c4, _d2, _e, _f;
|
|
1013167
1013417
|
const violations = [];
|
|
1013418
|
+
const maybeClientId = (_a5 = tokenEndpoint["request-properties"]) == null ? void 0 : _a5["client-id"];
|
|
1013419
|
+
if (maybeClientId != null) {
|
|
1013420
|
+
violations.push(...validateClientIdRequestProperty({
|
|
1013421
|
+
endpointId,
|
|
1013422
|
+
endpoint,
|
|
1013423
|
+
typeResolver,
|
|
1013424
|
+
file,
|
|
1013425
|
+
clientIdProperty: maybeClientId
|
|
1013426
|
+
}));
|
|
1013427
|
+
} else {
|
|
1013428
|
+
const clientIdViolations = validateClientIdRequestProperty({
|
|
1013429
|
+
endpointId,
|
|
1013430
|
+
endpoint,
|
|
1013431
|
+
typeResolver,
|
|
1013432
|
+
file,
|
|
1013433
|
+
clientIdProperty: DEFAULT_CLIENT_ID
|
|
1013434
|
+
});
|
|
1013435
|
+
if (clientIdViolations.length > 0) {
|
|
1013436
|
+
violations.push({
|
|
1013437
|
+
severity: "error",
|
|
1013438
|
+
message: `OAuth configuration for endpoint ${source_default.bold(endpointId)} is missing a valid client-id, such as '${DEFAULT_CLIENT_ID}'.`
|
|
1013439
|
+
});
|
|
1013440
|
+
}
|
|
1013441
|
+
}
|
|
1013442
|
+
const maybeClientSecret = (_b4 = tokenEndpoint["request-properties"]) == null ? void 0 : _b4["client-secret"];
|
|
1013443
|
+
if (maybeClientSecret != null) {
|
|
1013444
|
+
violations.push(...validateClientSecretRequestProperty({
|
|
1013445
|
+
endpointId,
|
|
1013446
|
+
endpoint,
|
|
1013447
|
+
typeResolver,
|
|
1013448
|
+
file,
|
|
1013449
|
+
clientSecretProperty: maybeClientSecret
|
|
1013450
|
+
}));
|
|
1013451
|
+
} else {
|
|
1013452
|
+
const clientSecretViolations = validateClientSecretRequestProperty({
|
|
1013453
|
+
endpointId,
|
|
1013454
|
+
endpoint,
|
|
1013455
|
+
typeResolver,
|
|
1013456
|
+
file,
|
|
1013457
|
+
clientSecretProperty: DEFAULT_CLIENT_SECRET
|
|
1013458
|
+
});
|
|
1013459
|
+
if (clientSecretViolations.length > 0) {
|
|
1013460
|
+
violations.push({
|
|
1013461
|
+
severity: "error",
|
|
1013462
|
+
message: `OAuth configuration for endpoint ${source_default.bold(endpointId)} is missing a valid client-secret, such as '${DEFAULT_CLIENT_SECRET}'.`
|
|
1013463
|
+
});
|
|
1013464
|
+
}
|
|
1013465
|
+
}
|
|
1013466
|
+
const scopesProperty = (_c4 = tokenEndpoint == null ? void 0 : tokenEndpoint["request-properties"]) == null ? void 0 : _c4.scopes;
|
|
1013467
|
+
if (scopesProperty != null) {
|
|
1013468
|
+
violations.push(...validateScopesRequestProperty({
|
|
1013469
|
+
endpointId,
|
|
1013470
|
+
endpoint,
|
|
1013471
|
+
typeResolver,
|
|
1013472
|
+
file,
|
|
1013473
|
+
scopesProperty
|
|
1013474
|
+
}));
|
|
1013475
|
+
}
|
|
1013168
1013476
|
const resolvedResponseType = resolveResponseType({ endpoint, typeResolver, file });
|
|
1013169
1013477
|
if (resolvedResponseType == null) {
|
|
1013170
1013478
|
violations.push({
|
|
@@ -1013173,14 +1013481,31 @@ function validateTokenEndpoint({ endpointId, endpoint, typeResolver, file, token
|
|
|
1013173
1013481
|
});
|
|
1013174
1013482
|
return violations;
|
|
1013175
1013483
|
}
|
|
1013176
|
-
|
|
1013177
|
-
|
|
1013178
|
-
|
|
1013179
|
-
|
|
1013180
|
-
|
|
1013181
|
-
|
|
1013182
|
-
|
|
1013183
|
-
|
|
1013484
|
+
const maybeAccessToken = (_d2 = tokenEndpoint["response-properties"]) == null ? void 0 : _d2["access-token"];
|
|
1013485
|
+
if (maybeAccessToken != null) {
|
|
1013486
|
+
violations.push(...validateAccessTokenResponseProperty({
|
|
1013487
|
+
endpointId,
|
|
1013488
|
+
typeResolver,
|
|
1013489
|
+
file,
|
|
1013490
|
+
resolvedResponseType,
|
|
1013491
|
+
accessTokenProperty: maybeAccessToken
|
|
1013492
|
+
}));
|
|
1013493
|
+
} else {
|
|
1013494
|
+
const accessTokenViolations = validateAccessTokenResponseProperty({
|
|
1013495
|
+
endpointId,
|
|
1013496
|
+
typeResolver,
|
|
1013497
|
+
file,
|
|
1013498
|
+
resolvedResponseType,
|
|
1013499
|
+
accessTokenProperty: DEFAULT_ACCESS_TOKEN
|
|
1013500
|
+
});
|
|
1013501
|
+
if (accessTokenViolations.length > 0) {
|
|
1013502
|
+
violations.push({
|
|
1013503
|
+
severity: "error",
|
|
1013504
|
+
message: `OAuth configuration for endpoint ${source_default.bold(endpointId)} is missing a valid access-token, such as '${DEFAULT_ACCESS_TOKEN}'.`
|
|
1013505
|
+
});
|
|
1013506
|
+
}
|
|
1013507
|
+
}
|
|
1013508
|
+
const expiresInProperty = (_e = tokenEndpoint == null ? void 0 : tokenEndpoint["response-properties"]) == null ? void 0 : _e["expires-in"];
|
|
1013184
1013509
|
if (expiresInProperty != null) {
|
|
1013185
1013510
|
violations.push(...validateExpiresInResponseProperty({
|
|
1013186
1013511
|
endpointId,
|
|
@@ -1013190,7 +1013515,7 @@ function validateTokenEndpoint({ endpointId, endpoint, typeResolver, file, token
|
|
|
1013190
1013515
|
expiresInProperty
|
|
1013191
1013516
|
}));
|
|
1013192
1013517
|
}
|
|
1013193
|
-
const refreshTokenProperty = tokenEndpoint["response-properties"]["refresh-token"];
|
|
1013518
|
+
const refreshTokenProperty = (_f = tokenEndpoint == null ? void 0 : tokenEndpoint["response-properties"]) == null ? void 0 : _f["refresh-token"];
|
|
1013194
1013519
|
if (refreshTokenProperty != null) {
|
|
1013195
1013520
|
violations.push(...validateRefreshTokenResponseProperty({
|
|
1013196
1013521
|
endpointId,
|
|
@@ -1013228,6 +1013553,9 @@ function validateClientCredentials({ endpointId, endpoint, typeResolver, file, r
|
|
|
1013228
1013553
|
}
|
|
1013229
1013554
|
|
|
1013230
1013555
|
// pnp:/home/circleci/project/packages/cli/yaml/validator/lib/rules/valid-oauth/valid-oauth.js
|
|
1013556
|
+
var DOCS_LINK_MESSAGE = `For details, see the ${terminalLink("docs", DocsLinks.oauth, {
|
|
1013557
|
+
fallback: (text8, url) => `${text8}: ${url}`
|
|
1013558
|
+
})}.`;
|
|
1013231
1013559
|
var ValidOauthRule = {
|
|
1013232
1013560
|
name: "valid-oauth",
|
|
1013233
1013561
|
create: ({ workspace }) => {
|
|
@@ -1013246,7 +1013574,7 @@ var ValidOauthRule = {
|
|
|
1013246
1013574
|
return [
|
|
1013247
1013575
|
{
|
|
1013248
1013576
|
severity: "error",
|
|
1013249
|
-
message: `File declares oauth scheme '${oauthScheme.name}', but no imports are declared to reference the required token endpoint(s)
|
|
1013577
|
+
message: `File declares oauth scheme '${oauthScheme.name}', but no imports are declared to reference the required token endpoint(s). ${DOCS_LINK_MESSAGE}`
|
|
1013250
1013578
|
}
|
|
1013251
1013579
|
];
|
|
1013252
1013580
|
}
|
|
@@ -1013268,7 +1013596,7 @@ var ValidOauthRule = {
|
|
|
1013268
1013596
|
return [
|
|
1013269
1013597
|
{
|
|
1013270
1013598
|
severity: "error",
|
|
1013271
|
-
message: `File declares oauth scheme '${oauthScheme.name}', but the OAuth 'get-token' endpoint could not be resolved
|
|
1013599
|
+
message: `File declares oauth scheme '${oauthScheme.name}', but the OAuth 'get-token' endpoint could not be resolved. ${DOCS_LINK_MESSAGE}`
|
|
1013272
1013600
|
}
|
|
1013273
1013601
|
];
|
|
1013274
1013602
|
}
|
|
@@ -1013286,7 +1013614,7 @@ var ValidOauthRule = {
|
|
|
1013286
1013614
|
return [
|
|
1013287
1013615
|
{
|
|
1013288
1013616
|
severity: "error",
|
|
1013289
|
-
message: `File declares oauth scheme '${oauthScheme.name}', but the OAuth 'refresh-token' endpoint could not be resolved
|
|
1013617
|
+
message: `File declares oauth scheme '${oauthScheme.name}', but the OAuth 'refresh-token' endpoint could not be resolved. ${DOCS_LINK_MESSAGE}`
|
|
1013290
1013618
|
}
|
|
1013291
1013619
|
];
|
|
1013292
1013620
|
}
|
|
@@ -1013306,8 +1013634,8 @@ var ValidOauthRule = {
|
|
|
1013306
1013634
|
rootApiFile: workspace.definition.rootApiFile.contents
|
|
1013307
1013635
|
});
|
|
1013308
1013636
|
switch (oauthSchema.type) {
|
|
1013309
|
-
case "client-credentials":
|
|
1013310
|
-
|
|
1013637
|
+
case "client-credentials": {
|
|
1013638
|
+
const violations = validateClientCredentials({
|
|
1013311
1013639
|
endpointId,
|
|
1013312
1013640
|
endpoint,
|
|
1013313
1013641
|
typeResolver,
|
|
@@ -1013316,6 +1013644,14 @@ var ValidOauthRule = {
|
|
|
1013316
1013644
|
resolvedRefreshEndpoint,
|
|
1013317
1013645
|
clientCredentials: oauthSchema
|
|
1013318
1013646
|
});
|
|
1013647
|
+
if (violations.length > 0) {
|
|
1013648
|
+
return violations.map((violation) => ({
|
|
1013649
|
+
severity: violation.severity,
|
|
1013650
|
+
message: violation.message + ` ${DOCS_LINK_MESSAGE}`
|
|
1013651
|
+
}));
|
|
1013652
|
+
}
|
|
1013653
|
+
return [];
|
|
1013654
|
+
}
|
|
1013319
1013655
|
default:
|
|
1013320
1013656
|
assertNever(oauthSchema.type);
|
|
1013321
1013657
|
}
|
|
@@ -1013440,7 +1013776,7 @@ function isValidResultsProperty({ typeResolver, file, resolvedType, propertyComp
|
|
|
1013440
1013776
|
validate: isValidResultsType
|
|
1013441
1013777
|
});
|
|
1013442
1013778
|
}
|
|
1013443
|
-
function isValidResultsType(resolvedType) {
|
|
1013779
|
+
function isValidResultsType({ resolvedType }) {
|
|
1013444
1013780
|
return true;
|
|
1013445
1013781
|
}
|
|
1013446
1013782
|
|
|
@@ -1013513,7 +1013849,7 @@ function isValidCursorProperty({ typeResolver, file, resolvedType, propertyCompo
|
|
|
1013513
1013849
|
validate: isValidCursorType
|
|
1013514
1013850
|
});
|
|
1013515
1013851
|
}
|
|
1013516
|
-
function isValidCursorType(resolvedType) {
|
|
1013852
|
+
function isValidCursorType({ resolvedType }) {
|
|
1013517
1013853
|
const primitiveType = maybePrimitiveType(resolvedType);
|
|
1013518
1013854
|
if (primitiveType == null) {
|
|
1013519
1013855
|
return false;
|
|
@@ -1013570,7 +1013906,7 @@ function isValidOffsetProperty({ typeResolver, file, resolvedType, propertyCompo
|
|
|
1013570
1013906
|
validate: isValidOffsetType
|
|
1013571
1013907
|
});
|
|
1013572
1013908
|
}
|
|
1013573
|
-
function isValidOffsetType(resolvedType) {
|
|
1013909
|
+
function isValidOffsetType({ resolvedType }) {
|
|
1013574
1013910
|
const primitiveType = maybePrimitiveType(resolvedType);
|
|
1013575
1013911
|
if (primitiveType == null) {
|
|
1013576
1013912
|
return false;
|
|
@@ -1019206,24 +1019542,29 @@ function convertExampleEndpoint({ example }) {
|
|
|
1019206
1019542
|
function convertExampleResponse5({ example }) {
|
|
1019207
1019543
|
switch (example.type) {
|
|
1019208
1019544
|
case "ok":
|
|
1019209
|
-
|
|
1019210
|
-
case "body":
|
|
1019211
|
-
return IrVersions_exports.V43.ExampleResponse.ok({ body: example.value.value });
|
|
1019212
|
-
case "sse":
|
|
1019213
|
-
return IrVersions_exports.V43.ExampleResponse.ok({
|
|
1019214
|
-
body: void 0
|
|
1019215
|
-
});
|
|
1019216
|
-
case "stream":
|
|
1019217
|
-
return IrVersions_exports.V43.ExampleResponse.ok({
|
|
1019218
|
-
body: void 0
|
|
1019219
|
-
});
|
|
1019220
|
-
}
|
|
1019545
|
+
return convertExampleSuccessResponse({ example: example.value });
|
|
1019221
1019546
|
case "error":
|
|
1019222
1019547
|
return IrVersions_exports.V43.ExampleResponse.error(example);
|
|
1019223
1019548
|
default:
|
|
1019224
1019549
|
assertNever(example);
|
|
1019225
1019550
|
}
|
|
1019226
1019551
|
}
|
|
1019552
|
+
function convertExampleSuccessResponse({ example }) {
|
|
1019553
|
+
switch (example.type) {
|
|
1019554
|
+
case "body":
|
|
1019555
|
+
return IrVersions_exports.V43.ExampleResponse.ok({ body: example.value });
|
|
1019556
|
+
case "sse":
|
|
1019557
|
+
return IrVersions_exports.V43.ExampleResponse.ok({
|
|
1019558
|
+
body: void 0
|
|
1019559
|
+
});
|
|
1019560
|
+
case "stream":
|
|
1019561
|
+
return IrVersions_exports.V43.ExampleResponse.ok({
|
|
1019562
|
+
body: void 0
|
|
1019563
|
+
});
|
|
1019564
|
+
default:
|
|
1019565
|
+
assertNever(example);
|
|
1019566
|
+
}
|
|
1019567
|
+
}
|
|
1019227
1019568
|
|
|
1019228
1019569
|
// pnp:/home/circleci/project/packages/cli/generation/ir-migrations/lib/migrations/v5-to-v4/convertName.js
|
|
1019229
1019570
|
function convertNameToV1(name2) {
|
|
@@ -1021796,23 +1022137,6 @@ var import_fs8 = require("fs");
|
|
|
1021796
1022137
|
var import_promises41 = require("fs/promises");
|
|
1021797
1022138
|
var import_path35 = __toESM(require("path"));
|
|
1021798
1022139
|
var import_promises42 = require("stream/promises");
|
|
1021799
|
-
|
|
1021800
|
-
// pnp:/home/circleci/project/.yarn/cache/terminal-link-npm-3.0.0-82cbbd7f4a-85a78ae50a.zip/node_modules/terminal-link/index.js
|
|
1021801
|
-
var import_supports_hyperlinks = __toESM(require_supports_hyperlinks());
|
|
1021802
|
-
function terminalLink(text8, url, { target = "stdout", ...options2 } = {}) {
|
|
1021803
|
-
if (!import_supports_hyperlinks.default[target]) {
|
|
1021804
|
-
if (options2.fallback === false) {
|
|
1021805
|
-
return text8;
|
|
1021806
|
-
}
|
|
1021807
|
-
return typeof options2.fallback === "function" ? options2.fallback(text8, url) : `${text8} (\u200B${url}\u200B)`;
|
|
1021808
|
-
}
|
|
1021809
|
-
return ansi_escapes_default.link(text8, url);
|
|
1021810
|
-
}
|
|
1021811
|
-
terminalLink.isSupported = import_supports_hyperlinks.default.stdout;
|
|
1021812
|
-
terminalLink.stderr = (text8, url, options2 = {}) => terminalLink(text8, url, { target: "stderr", ...options2 });
|
|
1021813
|
-
terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
|
|
1021814
|
-
|
|
1021815
|
-
// pnp:/home/circleci/project/packages/cli/generation/remote-generation/remote-workspace-runner/lib/RemoteTaskHandler.js
|
|
1021816
1022140
|
var import_tmp_promise9 = __toESM(require_tmp_promise());
|
|
1021817
1022141
|
var _isFinished, _createdSnippets, _snippetsS3PreSignedReadUrl;
|
|
1021818
1022142
|
var RemoteTaskHandler = class {
|
|
@@ -1052878,7 +1053202,8 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain2
|
|
|
1052878
1053202
|
token,
|
|
1052879
1053203
|
uploadUrls,
|
|
1052880
1053204
|
version: version3,
|
|
1052881
|
-
editThisPage
|
|
1053205
|
+
editThisPage,
|
|
1053206
|
+
absolutePathToFernFolder: docsWorkspace.absoluteFilepath
|
|
1052882
1053207
|
});
|
|
1052883
1053208
|
context.logger.debug("Calling registerDocs... ", JSON.stringify(registerDocsRequest, void 0, 4));
|
|
1052884
1053209
|
const registerDocsResponse = await fdr.docs.v2.write.finishDocsRegister(docsRegistrationId, registerDocsRequest);
|
|
@@ -1052898,7 +1053223,7 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain2
|
|
|
1052898
1053223
|
}
|
|
1052899
1053224
|
}
|
|
1052900
1053225
|
}
|
|
1052901
|
-
async function constructRegisterDocsRequest({ parsedDocsConfig, organization, fernWorkspaces, context, token, uploadUrls, version: version3, editThisPage }) {
|
|
1053226
|
+
async function constructRegisterDocsRequest({ parsedDocsConfig, organization, fernWorkspaces, context, token, uploadUrls, version: version3, editThisPage, absolutePathToFernFolder }) {
|
|
1052902
1053227
|
const fullSlugs = Object.fromEntries(Object.entries(parsedDocsConfig.pages).map(([pageId, pageContent]) => {
|
|
1052903
1053228
|
const frontmatter = (0, import_gray_matter2.default)(pageContent);
|
|
1052904
1053229
|
const fullSlug = frontmatter.data.slug;
|
|
@@ -1052915,10 +1053240,11 @@ async function constructRegisterDocsRequest({ parsedDocsConfig, organization, fe
|
|
|
1052915
1053240
|
token,
|
|
1052916
1053241
|
uploadUrls,
|
|
1052917
1053242
|
version: version3,
|
|
1052918
|
-
fullSlugs
|
|
1053243
|
+
fullSlugs,
|
|
1053244
|
+
absolutePathToFernFolder
|
|
1052919
1053245
|
});
|
|
1052920
1053246
|
let pages = {
|
|
1052921
|
-
...entries(parsedDocsConfig.pages).reduce((pages2, [pageFilepath, pageContents]) => ({
|
|
1053247
|
+
...entries({ ...parsedDocsConfig.pages }).reduce((pages2, [pageFilepath, pageContents]) => ({
|
|
1052922
1053248
|
...pages2,
|
|
1052923
1053249
|
[pageFilepath]: {
|
|
1052924
1053250
|
markdown: pageContents,
|
|
@@ -1052958,7 +1053284,7 @@ function createEditThisPageUrl(editThisPage, pageFilepath) {
|
|
|
1052958
1053284
|
const { owner, repo, branch = "main", host = "https://github.com" } = editThisPage.github;
|
|
1052959
1053285
|
return `${wrapWithHttps(host)}/${owner}/${repo}/blob/${branch}/fern/${pageFilepath}`;
|
|
1052960
1053286
|
}
|
|
1052961
|
-
async function convertDocsConfiguration({ parsedDocsConfig, organization, fernWorkspaces, context, token, uploadUrls, version: version3, fullSlugs }) {
|
|
1053287
|
+
async function convertDocsConfiguration({ parsedDocsConfig, organization, fernWorkspaces, context, token, uploadUrls, version: version3, fullSlugs, absolutePathToFernFolder }) {
|
|
1052962
1053288
|
var _a5, _b4;
|
|
1052963
1053289
|
const convertedNavigation = await convertNavigationConfig({
|
|
1052964
1053290
|
navigationConfig: parsedDocsConfig.navigation,
|
|
@@ -1052969,7 +1053295,8 @@ async function convertDocsConfiguration({ parsedDocsConfig, organization, fernWo
|
|
|
1052969
1053295
|
context,
|
|
1052970
1053296
|
token,
|
|
1052971
1053297
|
version: version3,
|
|
1052972
|
-
fullSlugs
|
|
1053298
|
+
fullSlugs,
|
|
1053299
|
+
absolutePathToFernFolder
|
|
1052973
1053300
|
});
|
|
1052974
1053301
|
const config = {
|
|
1052975
1053302
|
title: parsedDocsConfig.title,
|
|
@@ -1052999,12 +1053326,10 @@ async function convertDocsConfiguration({ parsedDocsConfig, organization, fernWo
|
|
|
1052999
1053326
|
};
|
|
1053000
1053327
|
return {
|
|
1053001
1053328
|
config,
|
|
1053002
|
-
pages:
|
|
1053003
|
-
...convertedNavigation.pages
|
|
1053004
|
-
}
|
|
1053329
|
+
pages: convertedNavigation.pages
|
|
1053005
1053330
|
};
|
|
1053006
1053331
|
}
|
|
1053007
|
-
async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs }) {
|
|
1053332
|
+
async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs, absolutePathToFernFolder }) {
|
|
1053008
1053333
|
let config;
|
|
1053009
1053334
|
let pages = {};
|
|
1053010
1053335
|
switch (navigationConfig.type) {
|
|
@@ -1053017,7 +1053342,8 @@ async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfi
|
|
|
1053017
1053342
|
context,
|
|
1053018
1053343
|
token,
|
|
1053019
1053344
|
version: version3,
|
|
1053020
|
-
fullSlugs
|
|
1053345
|
+
fullSlugs,
|
|
1053346
|
+
absolutePathToFernFolder
|
|
1053021
1053347
|
})));
|
|
1053022
1053348
|
for (const untabbedItem of untabbedItems) {
|
|
1053023
1053349
|
pages = {
|
|
@@ -1053030,19 +1053356,23 @@ async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfi
|
|
|
1053030
1053356
|
};
|
|
1053031
1053357
|
break;
|
|
1053032
1053358
|
}
|
|
1053033
|
-
case "tabbed":
|
|
1053359
|
+
case "tabbed": {
|
|
1053360
|
+
const tabbedItem = await convertTabbedNavigation(navigationConfig.items, tabs, {
|
|
1053361
|
+
parsedDocsConfig,
|
|
1053362
|
+
organization,
|
|
1053363
|
+
fernWorkspaces,
|
|
1053364
|
+
context,
|
|
1053365
|
+
token,
|
|
1053366
|
+
version: version3,
|
|
1053367
|
+
fullSlugs,
|
|
1053368
|
+
absolutePathToFernFolder
|
|
1053369
|
+
});
|
|
1053034
1053370
|
config = {
|
|
1053035
|
-
tabs:
|
|
1053036
|
-
parsedDocsConfig,
|
|
1053037
|
-
organization,
|
|
1053038
|
-
fernWorkspaces,
|
|
1053039
|
-
context,
|
|
1053040
|
-
token,
|
|
1053041
|
-
version: version3,
|
|
1053042
|
-
fullSlugs
|
|
1053043
|
-
})
|
|
1053371
|
+
tabs: tabbedItem.tabs
|
|
1053044
1053372
|
};
|
|
1053373
|
+
pages = { ...pages, ...tabbedItem.pages };
|
|
1053045
1053374
|
break;
|
|
1053375
|
+
}
|
|
1053046
1053376
|
case "versioned":
|
|
1053047
1053377
|
config = {
|
|
1053048
1053378
|
versions: await Promise.all(navigationConfig.versions.map(async (version4) => {
|
|
@@ -1053055,7 +1053385,8 @@ async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfi
|
|
|
1053055
1053385
|
context,
|
|
1053056
1053386
|
token,
|
|
1053057
1053387
|
version: version4.version,
|
|
1053058
|
-
fullSlugs
|
|
1053388
|
+
fullSlugs,
|
|
1053389
|
+
absolutePathToFernFolder
|
|
1053059
1053390
|
});
|
|
1053060
1053391
|
pages = {
|
|
1053061
1053392
|
...pages,
|
|
@@ -1053092,7 +1053423,7 @@ function convertAvailability2(availability) {
|
|
|
1053092
1053423
|
assertNever(availability);
|
|
1053093
1053424
|
}
|
|
1053094
1053425
|
}
|
|
1053095
|
-
async function convertUnversionedNavigationConfig({ navigationConfig, tabs, parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs }) {
|
|
1053426
|
+
async function convertUnversionedNavigationConfig({ navigationConfig, tabs, parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs, absolutePathToFernFolder }) {
|
|
1053096
1053427
|
let config;
|
|
1053097
1053428
|
let pages = {};
|
|
1053098
1053429
|
switch (navigationConfig.type) {
|
|
@@ -1053105,7 +1053436,8 @@ async function convertUnversionedNavigationConfig({ navigationConfig, tabs, pars
|
|
|
1053105
1053436
|
context,
|
|
1053106
1053437
|
token,
|
|
1053107
1053438
|
version: version3,
|
|
1053108
|
-
fullSlugs
|
|
1053439
|
+
fullSlugs,
|
|
1053440
|
+
absolutePathToFernFolder
|
|
1053109
1053441
|
})));
|
|
1053110
1053442
|
config = {
|
|
1053111
1053443
|
items: untabbedItems.map((item) => item.item)
|
|
@@ -1053119,17 +1053451,20 @@ async function convertUnversionedNavigationConfig({ navigationConfig, tabs, pars
|
|
|
1053119
1053451
|
break;
|
|
1053120
1053452
|
}
|
|
1053121
1053453
|
case "tabbed": {
|
|
1053454
|
+
const tabbedItem = await convertTabbedNavigation(navigationConfig.items, tabs, {
|
|
1053455
|
+
parsedDocsConfig,
|
|
1053456
|
+
organization,
|
|
1053457
|
+
fernWorkspaces,
|
|
1053458
|
+
context,
|
|
1053459
|
+
token,
|
|
1053460
|
+
version: version3,
|
|
1053461
|
+
fullSlugs,
|
|
1053462
|
+
absolutePathToFernFolder
|
|
1053463
|
+
});
|
|
1053122
1053464
|
config = {
|
|
1053123
|
-
tabs:
|
|
1053124
|
-
parsedDocsConfig,
|
|
1053125
|
-
organization,
|
|
1053126
|
-
fernWorkspaces,
|
|
1053127
|
-
context,
|
|
1053128
|
-
token,
|
|
1053129
|
-
version: version3,
|
|
1053130
|
-
fullSlugs
|
|
1053131
|
-
})
|
|
1053465
|
+
tabs: tabbedItem.tabs
|
|
1053132
1053466
|
};
|
|
1053467
|
+
pages = { ...pages, ...tabbedItem.pages };
|
|
1053133
1053468
|
break;
|
|
1053134
1053469
|
}
|
|
1053135
1053470
|
default:
|
|
@@ -1053140,8 +1053475,9 @@ async function convertUnversionedNavigationConfig({ navigationConfig, tabs, pars
|
|
|
1053140
1053475
|
pages
|
|
1053141
1053476
|
};
|
|
1053142
1053477
|
}
|
|
1053143
|
-
function convertTabbedNavigation(items, tabs, { parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs }) {
|
|
1053144
|
-
|
|
1053478
|
+
async function convertTabbedNavigation(items, tabs, { parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs, absolutePathToFernFolder }) {
|
|
1053479
|
+
let pages = {};
|
|
1053480
|
+
const convertedTabs = await Promise.all(items.map(async (tabbedItem) => {
|
|
1053145
1053481
|
const tabConfig = tabs == null ? void 0 : tabs[tabbedItem.tab];
|
|
1053146
1053482
|
if (tabConfig == null) {
|
|
1053147
1053483
|
throw new Error(`Couldn't find config for tab id ${tabbedItem.tab}`);
|
|
@@ -1053167,8 +1053503,15 @@ function convertTabbedNavigation(items, tabs, { parsedDocsConfig, organization,
|
|
|
1053167
1053503
|
context,
|
|
1053168
1053504
|
token,
|
|
1053169
1053505
|
version: version3,
|
|
1053170
|
-
fullSlugs
|
|
1053506
|
+
fullSlugs,
|
|
1053507
|
+
absolutePathToFernFolder
|
|
1053171
1053508
|
})));
|
|
1053509
|
+
tabbedItems.forEach((tabbedItem2) => {
|
|
1053510
|
+
pages = {
|
|
1053511
|
+
...pages,
|
|
1053512
|
+
...tabbedItem2.pages
|
|
1053513
|
+
};
|
|
1053514
|
+
});
|
|
1053172
1053515
|
return {
|
|
1053173
1053516
|
title: tabConfig.displayName,
|
|
1053174
1053517
|
icon: tabConfig.icon,
|
|
@@ -1053176,6 +1053519,10 @@ function convertTabbedNavigation(items, tabs, { parsedDocsConfig, organization,
|
|
|
1053176
1053519
|
urlSlugOverride: tabConfig.slug
|
|
1053177
1053520
|
};
|
|
1053178
1053521
|
}));
|
|
1053522
|
+
return {
|
|
1053523
|
+
tabs: convertedTabs,
|
|
1053524
|
+
pages
|
|
1053525
|
+
};
|
|
1053179
1053526
|
}
|
|
1053180
1053527
|
function convertDocsTypographyConfiguration({ typographyConfiguration, parsedDocsConfig, uploadUrls, context, fullSlugs }) {
|
|
1053181
1053528
|
if (typographyConfiguration == null) {
|
|
@@ -1053334,7 +1053681,7 @@ function convertImageReference2({ imageReference: imageReference2, parsedDocsCon
|
|
|
1053334
1053681
|
}
|
|
1053335
1053682
|
return file.fileId;
|
|
1053336
1053683
|
}
|
|
1053337
|
-
async function convertNavigationItem2({ item, parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs }) {
|
|
1053684
|
+
async function convertNavigationItem2({ item, parsedDocsConfig, organization, fernWorkspaces, context, token, version: version3, fullSlugs, absolutePathToFernFolder }) {
|
|
1053338
1053685
|
var _a5, _b4;
|
|
1053339
1053686
|
let convertedItem;
|
|
1053340
1053687
|
let pages = {};
|
|
@@ -1053360,7 +1053707,8 @@ async function convertNavigationItem2({ item, parsedDocsConfig, organization, fe
|
|
|
1053360
1053707
|
context,
|
|
1053361
1053708
|
token,
|
|
1053362
1053709
|
version: version3,
|
|
1053363
|
-
fullSlugs
|
|
1053710
|
+
fullSlugs,
|
|
1053711
|
+
absolutePathToFernFolder
|
|
1053364
1053712
|
})));
|
|
1053365
1053713
|
convertedItem = {
|
|
1053366
1053714
|
type: "section",
|
|
@@ -1053400,8 +1053748,7 @@ async function convertNavigationItem2({ item, parsedDocsConfig, organization, fe
|
|
|
1053400
1053748
|
const changelogItems = [];
|
|
1053401
1053749
|
if (workspace.changelog != null) {
|
|
1053402
1053750
|
for (const file of workspace.changelog.files) {
|
|
1053403
|
-
const
|
|
1053404
|
-
const filename = splitFilepath[splitFilepath.length - 1];
|
|
1053751
|
+
const filename = last_default(file.absoluteFilepath.split("/"));
|
|
1053405
1053752
|
if (filename == null) {
|
|
1053406
1053753
|
continue;
|
|
1053407
1053754
|
}
|
|
@@ -1053409,12 +1053756,13 @@ async function convertNavigationItem2({ item, parsedDocsConfig, organization, fe
|
|
|
1053409
1053756
|
if (changelogDate == null) {
|
|
1053410
1053757
|
continue;
|
|
1053411
1053758
|
}
|
|
1053412
|
-
|
|
1053759
|
+
const relativePath = relative(absolutePathToFernFolder, file.absoluteFilepath);
|
|
1053760
|
+
pages[relativePath] = {
|
|
1053413
1053761
|
markdown: file.contents
|
|
1053414
1053762
|
};
|
|
1053415
1053763
|
changelogItems.push({
|
|
1053416
1053764
|
date: changelogDate.toISOString(),
|
|
1053417
|
-
pageId:
|
|
1053765
|
+
pageId: relativePath
|
|
1053418
1053766
|
});
|
|
1053419
1053767
|
}
|
|
1053420
1053768
|
}
|