@antelopejs/cloud-sdk 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,70 @@
1
1
  {
2
2
  "name": "@antelopejs/cloud-sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
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
+ "registry": "https://registry.npmjs.org/"
37
+ },
38
+ "scripts": {
39
+ "generate": "openapi-typescript openapi/cloud.openapi.yaml -o src/generated/cloud-api.ts",
40
+ "build": "pnpm run generate && rimraf dist && tsc",
41
+ "check:generated": "pnpm run generate && git diff --exit-code -- src/generated/cloud-api.ts",
42
+ "lint": "oxlint",
43
+ "prepack": "pnpm run build",
44
+ "test": "pnpm run build && rimraf dist-test && tsc -p test && node --test 'dist-test/test/**/*.test.js'",
45
+ "typecheck": "tsc --noEmit",
46
+ "release": "pnpm run typecheck && pnpm run lint && pnpm run format:check && pnpm test && release-it",
47
+ "lint:fix": "oxlint --fix && oxfmt .",
48
+ "format": "oxfmt .",
49
+ "format:check": "oxfmt --check ."
50
+ },
51
+ "dependencies": {
52
+ "openapi-fetch": "^0.14.0"
53
+ },
54
+ "devDependencies": {
55
+ "@antelopejs/tooling-configs": "^0.4.0",
56
+ "@types/node": "^22.19.15",
57
+ "openapi-typescript": "^7.9.1",
58
+ "oxfmt": "^0.66.0",
59
+ "oxlint": "1.81.0",
60
+ "oxlint-tsgolint": "^7.0.2001",
61
+ "release-it": "^19.2.4",
62
+ "release-it-changelogen": "^0.1.0",
63
+ "rimraf": "^6.1.3",
64
+ "typescript": "^5.9.3"
65
+ },
66
+ "engines": {
67
+ "node": ">=20.19"
68
+ },
69
+ "packageManager": "pnpm@10.20.0"
70
+ }