@antelopejs/cloud-sdk 0.0.0-stage → 0.1.1
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/README.md +67 -2
- package/dist/api-error.d.ts +21 -0
- package/dist/api-error.js +27 -0
- package/dist/api.d.ts +193 -0
- package/dist/api.js +224 -0
- package/dist/environments.d.ts +48 -0
- package/dist/environments.js +81 -0
- package/dist/generated/cloud-api.d.ts +1612 -0
- package/dist/generated/cloud-api.js +6 -0
- package/dist/guards.d.ts +9 -0
- package/dist/guards.js +16 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/dist/resources.d.ts +43 -0
- package/dist/resources.js +2 -0
- package/dist/result.d.ts +25 -0
- package/dist/result.js +36 -0
- package/dist/sse.d.ts +6 -0
- package/dist/sse.js +45 -0
- package/openapi/cloud.openapi.yaml +556 -0
- package/openapi/environments.yaml +341 -0
- package/openapi/resources.openapi.yaml +274 -0
- package/openapi/variables.parts.yaml +127 -0
- package/package.json +69 -4
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
schemas:
|
|
2
|
+
VariableOrigin:
|
|
3
|
+
description: Where a variable's value comes from. `manual` is a variable set by hand on its service. `resource` is wired from a value another service of the environment publishes, such as the `REDIS_URL` of a Redis resource, and follows that value.
|
|
4
|
+
oneOf:
|
|
5
|
+
- type: object
|
|
6
|
+
required: [type]
|
|
7
|
+
properties:
|
|
8
|
+
type: { type: string, const: manual }
|
|
9
|
+
- type: object
|
|
10
|
+
required: [type, serviceId, publishedKey]
|
|
11
|
+
properties:
|
|
12
|
+
type: { type: string, const: resource }
|
|
13
|
+
serviceId:
|
|
14
|
+
description: The service that publishes the value.
|
|
15
|
+
type: string
|
|
16
|
+
publishedKey:
|
|
17
|
+
description: The key the publisher publishes the value under.
|
|
18
|
+
type: string
|
|
19
|
+
EnvironmentVariable:
|
|
20
|
+
description: A variable of one service of an environment. Secret values are write-only, so `value` is null whenever `secret` is true, masked or not.
|
|
21
|
+
type: object
|
|
22
|
+
required: [serviceId, key, secret, value, origin]
|
|
23
|
+
properties:
|
|
24
|
+
serviceId:
|
|
25
|
+
description: The service the variable is set on.
|
|
26
|
+
type: string
|
|
27
|
+
key: { type: string }
|
|
28
|
+
secret: { type: boolean }
|
|
29
|
+
value:
|
|
30
|
+
description: The value in clear; null when the variable is secret, or when a `resource` variable follows a value that is not available.
|
|
31
|
+
type: [string, "null"]
|
|
32
|
+
origin: { $ref: '#/schemas/VariableOrigin' }
|
|
33
|
+
EnvironmentVariableList:
|
|
34
|
+
type: object
|
|
35
|
+
required: [variables]
|
|
36
|
+
properties:
|
|
37
|
+
variables:
|
|
38
|
+
type: array
|
|
39
|
+
items: { $ref: '#/schemas/EnvironmentVariable' }
|
|
40
|
+
VariableWrite:
|
|
41
|
+
type: object
|
|
42
|
+
required: [value]
|
|
43
|
+
properties:
|
|
44
|
+
value:
|
|
45
|
+
description: The new value. It cannot be empty.
|
|
46
|
+
type: string
|
|
47
|
+
secret:
|
|
48
|
+
description: Whether a variable the service does not hold yet is created as a secret, which can never be read back. Defaults to true. A variable the service already holds keeps its kind, and one wired from a resource is refused.
|
|
49
|
+
type: boolean
|
|
50
|
+
listPath:
|
|
51
|
+
get:
|
|
52
|
+
operationId: listVariables
|
|
53
|
+
description: Lists the variables of every service of the environment, those wired from a resource included. Requires the project's deploy permission. Secret values are never returned.
|
|
54
|
+
security: [{ bearerAuth: [] }]
|
|
55
|
+
parameters:
|
|
56
|
+
- in: path
|
|
57
|
+
name: projectId
|
|
58
|
+
required: true
|
|
59
|
+
schema: { type: string }
|
|
60
|
+
- in: path
|
|
61
|
+
name: environmentId
|
|
62
|
+
required: true
|
|
63
|
+
schema: { type: string }
|
|
64
|
+
responses:
|
|
65
|
+
'200':
|
|
66
|
+
content:
|
|
67
|
+
application/json:
|
|
68
|
+
schema: { $ref: './cloud.openapi.yaml#/components/schemas/EnvironmentVariableList' }
|
|
69
|
+
default: { $ref: './cloud.openapi.yaml#/components/responses/Error' }
|
|
70
|
+
itemPath:
|
|
71
|
+
put:
|
|
72
|
+
operationId: setVariable
|
|
73
|
+
description: Sets a variable of a service of the environment and answers the variable as listed. A key the service does not hold is created, as a secret unless `secret` is false; a held plain or secret variable keeps its kind. A variable wired from a resource is refused. Requires the project's deploy permission.
|
|
74
|
+
security: [{ bearerAuth: [] }]
|
|
75
|
+
parameters:
|
|
76
|
+
- in: path
|
|
77
|
+
name: projectId
|
|
78
|
+
required: true
|
|
79
|
+
schema: { type: string }
|
|
80
|
+
- in: path
|
|
81
|
+
name: environmentId
|
|
82
|
+
required: true
|
|
83
|
+
schema: { type: string }
|
|
84
|
+
- in: path
|
|
85
|
+
name: serviceId
|
|
86
|
+
required: true
|
|
87
|
+
schema: { type: string }
|
|
88
|
+
- in: path
|
|
89
|
+
name: key
|
|
90
|
+
required: true
|
|
91
|
+
schema: { type: string }
|
|
92
|
+
requestBody:
|
|
93
|
+
required: true
|
|
94
|
+
content:
|
|
95
|
+
application/json:
|
|
96
|
+
schema: { $ref: './cloud.openapi.yaml#/components/schemas/VariableWrite' }
|
|
97
|
+
responses:
|
|
98
|
+
'200':
|
|
99
|
+
content:
|
|
100
|
+
application/json:
|
|
101
|
+
schema: { $ref: './cloud.openapi.yaml#/components/schemas/EnvironmentVariable' }
|
|
102
|
+
default: { $ref: './cloud.openapi.yaml#/components/responses/Error' }
|
|
103
|
+
delete:
|
|
104
|
+
operationId: deleteVariable
|
|
105
|
+
description: Removes a variable of a service of the environment, one wired from a resource included. Requires the project's deploy permission.
|
|
106
|
+
security: [{ bearerAuth: [] }]
|
|
107
|
+
parameters:
|
|
108
|
+
- in: path
|
|
109
|
+
name: projectId
|
|
110
|
+
required: true
|
|
111
|
+
schema: { type: string }
|
|
112
|
+
- in: path
|
|
113
|
+
name: environmentId
|
|
114
|
+
required: true
|
|
115
|
+
schema: { type: string }
|
|
116
|
+
- in: path
|
|
117
|
+
name: serviceId
|
|
118
|
+
required: true
|
|
119
|
+
schema: { type: string }
|
|
120
|
+
- in: path
|
|
121
|
+
name: key
|
|
122
|
+
required: true
|
|
123
|
+
schema: { type: string }
|
|
124
|
+
responses:
|
|
125
|
+
'200':
|
|
126
|
+
description: The variable is removed; the answer has no body.
|
|
127
|
+
default: { $ref: './cloud.openapi.yaml#/components/responses/Error' }
|
package/package.json
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/cloud-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Typed client for the AntelopeJS Cloud API",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"antelopejs",
|
|
7
|
+
"api",
|
|
8
|
+
"cloud",
|
|
9
|
+
"sdk"
|
|
10
|
+
],
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/AntelopeJS/cloud-sdk.git",
|
|
15
|
+
"directory": "sdk"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"!dist/**/*.map",
|
|
20
|
+
"openapi"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./errors": {
|
|
29
|
+
"types": "./dist/api-error.d.ts",
|
|
30
|
+
"default": "./dist/api-error.js"
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"provenance": true,
|
|
37
|
+
"registry": "https://registry.npmjs.org/"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"generate": "openapi-typescript openapi/cloud.openapi.yaml -o src/generated/cloud-api.ts",
|
|
41
|
+
"build": "pnpm run generate && rimraf dist && tsc",
|
|
42
|
+
"check:generated": "pnpm run generate && git diff --exit-code -- src/generated/cloud-api.ts",
|
|
43
|
+
"lint": "oxlint",
|
|
44
|
+
"prepack": "pnpm run build",
|
|
45
|
+
"test": "pnpm run build && rimraf dist-test && tsc -p test && node --test 'dist-test/test/**/*.test.js'",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"release": "pnpm run typecheck && pnpm run lint && pnpm run format:check && pnpm test && release-it",
|
|
48
|
+
"lint:fix": "oxlint --fix && oxfmt .",
|
|
49
|
+
"format": "oxfmt .",
|
|
50
|
+
"format:check": "oxfmt --check ."
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"openapi-fetch": "^0.14.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@antelopejs/tooling-configs": "^0.4.0",
|
|
57
|
+
"@types/node": "^22.19.15",
|
|
58
|
+
"openapi-typescript": "^7.9.1",
|
|
59
|
+
"oxfmt": "^0.66.0",
|
|
60
|
+
"oxlint": "1.81.0",
|
|
61
|
+
"oxlint-tsgolint": "^7.0.2001",
|
|
62
|
+
"release-it": "^19.2.4",
|
|
63
|
+
"release-it-changelogen": "^0.1.0",
|
|
64
|
+
"rimraf": "^6.1.3",
|
|
65
|
+
"typescript": "^5.9.3"
|
|
66
|
+
},
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": ">=20.19"
|
|
69
|
+
},
|
|
70
|
+
"packageManager": "pnpm@10.20.0"
|
|
71
|
+
}
|