Skip to content

Commit 7a19653

Browse files
authored
feat: support dual package formats (ESM/CJS) (#10)
1 parent a610c76 commit 7a19653

File tree

10 files changed

+428
-73
lines changed

10 files changed

+428
-73
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
node_modules/
55
**/node_modules/
66
# Build outputs
7+
lib/
8+
esm/
79
dist/
8-

api/openapispec/docs.go

Lines changed: 116 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ const docTemplate = `{
3838
"description": "The size of the page. Default to 10",
3939
"name": "pageSize",
4040
"in": "query"
41+
},
42+
{
43+
"type": "string",
44+
"description": "Which field to sort the list by. Default to id",
45+
"name": "sortBy",
46+
"in": "query"
47+
},
48+
{
49+
"type": "boolean",
50+
"description": "Whether to sort the list in ascending order. Default to false",
51+
"name": "ascending",
52+
"in": "query"
4153
}
4254
],
4355
"responses": {
@@ -376,6 +388,18 @@ const docTemplate = `{
376388
"description": "The size of the page. Default to 10",
377389
"name": "pageSize",
378390
"in": "query"
391+
},
392+
{
393+
"type": "string",
394+
"description": "Which field to sort the list by. Default to id",
395+
"name": "sortBy",
396+
"in": "query"
397+
},
398+
{
399+
"type": "boolean",
400+
"description": "Whether to sort the list in ascending order. Default to false",
401+
"name": "ascending",
402+
"in": "query"
379403
}
380404
],
381405
"responses": {
@@ -702,6 +726,18 @@ const docTemplate = `{
702726
"description": "The size of the page. Default to 10",
703727
"name": "pageSize",
704728
"in": "query"
729+
},
730+
{
731+
"type": "string",
732+
"description": "Which field to sort the list by. Default to id",
733+
"name": "sortBy",
734+
"in": "query"
735+
},
736+
{
737+
"type": "boolean",
738+
"description": "Whether to sort the list in ascending order. Default to false",
739+
"name": "ascending",
740+
"in": "query"
705741
}
706742
],
707743
"responses": {
@@ -1046,6 +1082,18 @@ const docTemplate = `{
10461082
"description": "The size of the page. Default to 10",
10471083
"name": "pageSize",
10481084
"in": "query"
1085+
},
1086+
{
1087+
"type": "string",
1088+
"description": "Which field to sort the list by. Default to id",
1089+
"name": "sortBy",
1090+
"in": "query"
1091+
},
1092+
{
1093+
"type": "boolean",
1094+
"description": "Whether to sort the list in ascending order. Default to false",
1095+
"name": "ascending",
1096+
"in": "query"
10491097
}
10501098
],
10511099
"responses": {
@@ -1405,6 +1453,18 @@ const docTemplate = `{
14051453
"description": "The size of the page. Default to 10",
14061454
"name": "pageSize",
14071455
"in": "query"
1456+
},
1457+
{
1458+
"type": "string",
1459+
"description": "Which field to sort the list by. Default to id",
1460+
"name": "sortBy",
1461+
"in": "query"
1462+
},
1463+
{
1464+
"type": "boolean",
1465+
"description": "Whether to sort the list in ascending order. Default to false",
1466+
"name": "ascending",
1467+
"in": "query"
14081468
}
14091469
],
14101470
"responses": {
@@ -1649,6 +1709,18 @@ const docTemplate = `{
16491709
"description": "The size of the page. Default to 10",
16501710
"name": "pageSize",
16511711
"in": "query"
1712+
},
1713+
{
1714+
"type": "string",
1715+
"description": "Which field to sort the list by. Default to id",
1716+
"name": "sortBy",
1717+
"in": "query"
1718+
},
1719+
{
1720+
"type": "boolean",
1721+
"description": "Whether to sort the list in ascending order. Default to false",
1722+
"name": "ascending",
1723+
"in": "query"
16521724
}
16531725
],
16541726
"responses": {
@@ -1846,6 +1918,18 @@ const docTemplate = `{
18461918
"description": "The size of the page. Default to 10",
18471919
"name": "pageSize",
18481920
"in": "query"
1921+
},
1922+
{
1923+
"type": "string",
1924+
"description": "Which field to sort the list by. Default to id",
1925+
"name": "sortBy",
1926+
"in": "query"
1927+
},
1928+
{
1929+
"type": "boolean",
1930+
"description": "Whether to sort the list in ascending order. Default to false",
1931+
"name": "ascending",
1932+
"in": "query"
18491933
}
18501934
],
18511935
"responses": {
@@ -2196,6 +2280,18 @@ const docTemplate = `{
21962280
"description": "The size of the page. Default to 10",
21972281
"name": "pageSize",
21982282
"in": "query"
2283+
},
2284+
{
2285+
"type": "string",
2286+
"description": "Which field to sort the list by. Default to id",
2287+
"name": "sortBy",
2288+
"in": "query"
2289+
},
2290+
{
2291+
"type": "boolean",
2292+
"description": "Whether to sort the list in ascending order. Default to false",
2293+
"name": "ascending",
2294+
"in": "query"
21992295
}
22002296
],
22012297
"responses": {
@@ -3280,6 +3376,18 @@ const docTemplate = `{
32803376
"description": "The size of the page. Default to 10",
32813377
"name": "pageSize",
32823378
"in": "query"
3379+
},
3380+
{
3381+
"type": "string",
3382+
"description": "Which field to sort the list by. Default to id",
3383+
"name": "sortBy",
3384+
"in": "query"
3385+
},
3386+
{
3387+
"type": "boolean",
3388+
"description": "Whether to sort the list in ascending order. Default to false",
3389+
"name": "ascending",
3390+
"in": "query"
32833391
}
32843392
],
32853393
"responses": {
@@ -3866,18 +3974,18 @@ const docTemplate = `{
38663974
"constant.SourceProviderType": {
38673975
"type": "string",
38683976
"enum": [
3869-
"git",
38703977
"git",
38713978
"github",
38723979
"oci",
3873-
"local"
3980+
"local",
3981+
"git"
38743982
],
38753983
"x-enum-varnames": [
3876-
"DefaultSourceType",
38773984
"SourceProviderTypeGit",
38783985
"SourceProviderTypeGithub",
38793986
"SourceProviderTypeOCI",
3880-
"SourceProviderTypeLocal"
3987+
"SourceProviderTypeLocal",
3988+
"DefaultSourceType"
38813989
]
38823990
},
38833991
"constant.StackState": {
@@ -4277,6 +4385,10 @@ const docTemplate = `{
42774385
"description": "ResourceType is the type of the resource.",
42784386
"type": "string"
42794387
},
4388+
"resourceURN": {
4389+
"description": "ResourceURN is the urn of the resource.",
4390+
"type": "string"
4391+
},
42804392
"status": {
42814393
"description": "Status is the status of the resource.",
42824394
"type": "string"

0 commit comments

Comments
 (0)