@deployport/api-services-corelib 0.1.3 → 0.2.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.
- package/.github/workflows/npm.yaml +21 -0
- package/package.json +22 -5
- package/specular.d.ts +96 -5
- package/specular.js +105 -12
- package/specular.ts +178 -31
- package/specular.yaml +5 -1
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Publish Package to NPM
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [published]
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
id-token: write # required for npm trusted publishing (OIDC)
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v7
|
|
13
|
+
- uses: actions/setup-node@v6
|
|
14
|
+
with:
|
|
15
|
+
node-version: "24"
|
|
16
|
+
registry-url: "https://registry.npmjs.org"
|
|
17
|
+
package-manager-cache: false # never use caching in release builds
|
|
18
|
+
# Trusted publishing requires npm 11.5.1 or later
|
|
19
|
+
- run: npm install -g npm@latest
|
|
20
|
+
- run: npm install
|
|
21
|
+
- run: npm publish
|
package/package.json
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deployport/api-services-corelib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./specular.js",
|
|
6
6
|
"types": "./specular.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./specular.d.ts",
|
|
10
|
+
"default": "./specular.js"
|
|
11
|
+
},
|
|
12
|
+
"./configurator": {
|
|
13
|
+
"types": "./configurator/index.d.ts",
|
|
14
|
+
"default": "./configurator/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
7
17
|
"author": "bithavoc",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/deployport/api-services-corelib-js.git"
|
|
21
|
+
},
|
|
8
22
|
"scripts": {
|
|
9
23
|
"prepublishOnly": "npm run build-configurator",
|
|
10
|
-
"
|
|
24
|
+
"generate": "specular-standalone-compiler generate",
|
|
25
|
+
"build-configurator": "tsc",
|
|
26
|
+
"build": "npm run build-configurator",
|
|
11
27
|
"clean": "rm -rf node_modules && rm -f **/*.js **/*.d.ts"
|
|
12
28
|
},
|
|
13
29
|
"type": "module",
|
|
@@ -15,10 +31,11 @@
|
|
|
15
31
|
"dependencies": {
|
|
16
32
|
"@aws-crypto/sha256-js": "^5.2.0",
|
|
17
33
|
"@aws-sdk/types": "^3.515.0",
|
|
18
|
-
"@deployport/specular-runtime": "^0.1
|
|
34
|
+
"@deployport/specular-runtime": "^0.2.1"
|
|
19
35
|
},
|
|
20
36
|
"devDependencies": {
|
|
21
|
-
"@tsconfig/
|
|
22
|
-
"@types/node": "^
|
|
37
|
+
"@tsconfig/node24": "^24.0.4",
|
|
38
|
+
"@types/node": "^24.13.2",
|
|
39
|
+
"typescript": "^6.0.3"
|
|
23
40
|
}
|
|
24
41
|
}
|
package/specular.d.ts
CHANGED
|
@@ -1,23 +1,114 @@
|
|
|
1
1
|
import { Runtime, Metadata } from '@deployport/specular-runtime';
|
|
2
|
+
/** Marks an operation with digital signature authentication for id4ntity verification
|
|
3
|
+
*/
|
|
2
4
|
export declare class SignedOperationV1 {
|
|
3
5
|
}
|
|
6
|
+
/** entity ServiceSignatureV1
|
|
7
|
+
*/
|
|
4
8
|
export declare class ServiceSignatureV1 {
|
|
9
|
+
/** serviceName parameter
|
|
10
|
+
*/
|
|
5
11
|
ServiceName: string;
|
|
6
12
|
}
|
|
13
|
+
/** Struct metadata
|
|
14
|
+
*/
|
|
7
15
|
export declare const AccessDeniedProblemMeta: Metadata.Struct;
|
|
16
|
+
/** struct AccessDeniedProblem
|
|
17
|
+
*/
|
|
8
18
|
export interface AccessDeniedProblemProperties {
|
|
19
|
+
/** message property
|
|
20
|
+
*/
|
|
9
21
|
message: string;
|
|
10
22
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare class AccessDeniedProblem extends
|
|
23
|
+
/** struct AccessDeniedProblem
|
|
24
|
+
*/
|
|
25
|
+
export declare class AccessDeniedProblem extends Runtime.RpcError implements AccessDeniedProblemProperties, Runtime.StructInterface {
|
|
26
|
+
get __structPath(): Metadata.StructPath;
|
|
14
27
|
}
|
|
28
|
+
/** Struct metadata
|
|
29
|
+
*/
|
|
15
30
|
export declare const ForbiddenProblemMeta: Metadata.Struct;
|
|
31
|
+
/** struct ForbiddenProblem
|
|
32
|
+
*/
|
|
16
33
|
export interface ForbiddenProblemProperties {
|
|
34
|
+
/** message property
|
|
35
|
+
*/
|
|
36
|
+
message: string;
|
|
37
|
+
}
|
|
38
|
+
/** struct ForbiddenProblem
|
|
39
|
+
*/
|
|
40
|
+
export declare class ForbiddenProblem extends Runtime.RpcError implements ForbiddenProblemProperties, Runtime.StructInterface {
|
|
41
|
+
get __structPath(): Metadata.StructPath;
|
|
42
|
+
}
|
|
43
|
+
/** Struct metadata
|
|
44
|
+
*/
|
|
45
|
+
export declare const ProblemActionMeta: Metadata.Struct;
|
|
46
|
+
/** A localized call-to-action surfaced alongside a problem. Title and URL
|
|
47
|
+
* are already resolved to a specific locale; clients render them as-is.
|
|
48
|
+
*/
|
|
49
|
+
export interface ProblemActionProperties {
|
|
50
|
+
/** Optional stable identifier. Clients can key on it to apply custom
|
|
51
|
+
* presentation (icon, ordering) per well-known action.
|
|
52
|
+
*/
|
|
53
|
+
id: string;
|
|
54
|
+
/** BCP 47 tag of the locale the title and url were resolved to. May
|
|
55
|
+
* differ from the caller's requested locale when a fallback was used.
|
|
56
|
+
*/
|
|
57
|
+
locale: string | null;
|
|
58
|
+
/** title property
|
|
59
|
+
*/
|
|
60
|
+
title: string;
|
|
61
|
+
/** url property
|
|
62
|
+
*/
|
|
63
|
+
url: string | null;
|
|
64
|
+
}
|
|
65
|
+
/** A localized call-to-action surfaced alongside a problem. Title and URL
|
|
66
|
+
* are already resolved to a specific locale; clients render them as-is.
|
|
67
|
+
*/
|
|
68
|
+
export interface ProblemAction extends ProblemActionProperties, Runtime.StructInterface {
|
|
69
|
+
}
|
|
70
|
+
/** Struct metadata
|
|
71
|
+
*/
|
|
72
|
+
export declare const ThrottledProblemMeta: Metadata.Struct;
|
|
73
|
+
/** Raised when the caller is being throttled and should retry later.
|
|
74
|
+
*/
|
|
75
|
+
export interface ThrottledProblemProperties {
|
|
76
|
+
/** Optional calls-to-action to help the caller (e.g. support, upgrade,
|
|
77
|
+
* docs links), ordered most-specific first. Empty when none apply.
|
|
78
|
+
*/
|
|
79
|
+
actions: (ProblemActionProperties)[];
|
|
80
|
+
/** message property
|
|
81
|
+
*/
|
|
17
82
|
message: string;
|
|
83
|
+
/** Milliseconds the caller should wait before retrying.
|
|
84
|
+
*/
|
|
85
|
+
retryAfterMs: number | null;
|
|
18
86
|
}
|
|
19
|
-
|
|
87
|
+
/** Raised when the caller is being throttled and should retry later.
|
|
88
|
+
*/
|
|
89
|
+
export declare class ThrottledProblem extends Runtime.RpcError implements ThrottledProblemProperties, Runtime.StructInterface {
|
|
90
|
+
actions: (ProblemActionProperties)[];
|
|
91
|
+
retryAfterMs: number | null;
|
|
92
|
+
get __structPath(): Metadata.StructPath;
|
|
93
|
+
}
|
|
94
|
+
/** Struct metadata
|
|
95
|
+
*/
|
|
96
|
+
export declare const QuotaExceededProblemMeta: Metadata.Struct;
|
|
97
|
+
/** Raised when a resource quota has been exceeded.
|
|
98
|
+
*/
|
|
99
|
+
export interface QuotaExceededProblemProperties {
|
|
100
|
+
/** Optional calls-to-action to help the caller (e.g. request an increase,
|
|
101
|
+
* upgrade, docs links), ordered most-specific first. Empty when none apply.
|
|
102
|
+
*/
|
|
103
|
+
actions: (ProblemActionProperties)[];
|
|
104
|
+
/** message property
|
|
105
|
+
*/
|
|
106
|
+
message: string;
|
|
20
107
|
}
|
|
21
|
-
|
|
108
|
+
/** Raised when a resource quota has been exceeded.
|
|
109
|
+
*/
|
|
110
|
+
export declare class QuotaExceededProblem extends Runtime.RpcError implements QuotaExceededProblemProperties, Runtime.StructInterface {
|
|
111
|
+
actions: (ProblemActionProperties)[];
|
|
112
|
+
get __structPath(): Metadata.StructPath;
|
|
22
113
|
}
|
|
23
114
|
export declare function SpecularPackage(): Metadata.Package;
|
package/specular.js
CHANGED
|
@@ -1,36 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// Marks an operation with digital signature authentication for id4ntity verification
|
|
1
|
+
import { Runtime, Metadata, } from '@deployport/specular-runtime';
|
|
2
|
+
/** Marks an operation with digital signature authentication for id4ntity verification
|
|
3
|
+
*/
|
|
5
4
|
export class SignedOperationV1 {
|
|
6
5
|
}
|
|
7
|
-
|
|
6
|
+
/** entity ServiceSignatureV1
|
|
7
|
+
*/
|
|
8
8
|
export class ServiceSignatureV1 {
|
|
9
|
+
/** serviceName parameter
|
|
10
|
+
*/
|
|
9
11
|
ServiceName = '';
|
|
10
12
|
}
|
|
11
|
-
const _pkg = new Metadata.Package(
|
|
13
|
+
const _pkg = new Metadata.Package("deployport", "corelib");
|
|
14
|
+
/** Struct metadata
|
|
15
|
+
*/
|
|
12
16
|
export const AccessDeniedProblemMeta = new Metadata.Struct(_pkg, "AccessDeniedProblem");
|
|
13
17
|
new Metadata.Property(AccessDeniedProblemMeta, "message", {
|
|
14
18
|
NonNullable: true,
|
|
15
19
|
SubType: "builtin",
|
|
16
20
|
Builtin: "string"
|
|
17
21
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export class AccessDeniedProblem extends
|
|
22
|
+
/** struct AccessDeniedProblem
|
|
23
|
+
*/
|
|
24
|
+
export class AccessDeniedProblem extends Runtime.RpcError {
|
|
25
|
+
get __structPath() {
|
|
26
|
+
return AccessDeniedProblemMeta.path;
|
|
27
|
+
}
|
|
21
28
|
}
|
|
22
29
|
AccessDeniedProblemMeta.problemInstantiate = (msg) => new AccessDeniedProblem(msg);
|
|
30
|
+
/** Struct metadata
|
|
31
|
+
*/
|
|
23
32
|
export const ForbiddenProblemMeta = new Metadata.Struct(_pkg, "ForbiddenProblem");
|
|
24
33
|
new Metadata.Property(ForbiddenProblemMeta, "message", {
|
|
25
34
|
NonNullable: true,
|
|
26
35
|
SubType: "builtin",
|
|
27
36
|
Builtin: "string"
|
|
28
37
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export class ForbiddenProblem extends
|
|
38
|
+
/** struct ForbiddenProblem
|
|
39
|
+
*/
|
|
40
|
+
export class ForbiddenProblem extends Runtime.RpcError {
|
|
41
|
+
get __structPath() {
|
|
42
|
+
return ForbiddenProblemMeta.path;
|
|
43
|
+
}
|
|
32
44
|
}
|
|
33
45
|
ForbiddenProblemMeta.problemInstantiate = (msg) => new ForbiddenProblem(msg);
|
|
46
|
+
/** Struct metadata
|
|
47
|
+
*/
|
|
48
|
+
export const ProblemActionMeta = new Metadata.Struct(_pkg, "ProblemAction");
|
|
49
|
+
new Metadata.Property(ProblemActionMeta, "id", {
|
|
50
|
+
NonNullable: true,
|
|
51
|
+
SubType: "builtin",
|
|
52
|
+
Builtin: "string"
|
|
53
|
+
});
|
|
54
|
+
new Metadata.Property(ProblemActionMeta, "locale", {
|
|
55
|
+
NonNullable: false,
|
|
56
|
+
SubType: "builtin",
|
|
57
|
+
Builtin: "string"
|
|
58
|
+
});
|
|
59
|
+
new Metadata.Property(ProblemActionMeta, "title", {
|
|
60
|
+
NonNullable: true,
|
|
61
|
+
SubType: "builtin",
|
|
62
|
+
Builtin: "string"
|
|
63
|
+
});
|
|
64
|
+
new Metadata.Property(ProblemActionMeta, "url", {
|
|
65
|
+
NonNullable: false,
|
|
66
|
+
SubType: "builtin",
|
|
67
|
+
Builtin: "string"
|
|
68
|
+
});
|
|
69
|
+
/** Struct metadata
|
|
70
|
+
*/
|
|
71
|
+
export const ThrottledProblemMeta = new Metadata.Struct(_pkg, "ThrottledProblem");
|
|
72
|
+
new Metadata.Property(ThrottledProblemMeta, "actions", {
|
|
73
|
+
NonNullable: true,
|
|
74
|
+
SubType: "array",
|
|
75
|
+
Item: {
|
|
76
|
+
NonNullable: true,
|
|
77
|
+
SubType: "userDefined",
|
|
78
|
+
Type: SpecularPackage().requireTypeByName("ProblemAction")
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
new Metadata.Property(ThrottledProblemMeta, "message", {
|
|
82
|
+
NonNullable: true,
|
|
83
|
+
SubType: "builtin",
|
|
84
|
+
Builtin: "string"
|
|
85
|
+
});
|
|
86
|
+
new Metadata.Property(ThrottledProblemMeta, "retryAfterMs", {
|
|
87
|
+
NonNullable: false,
|
|
88
|
+
SubType: "builtin",
|
|
89
|
+
Builtin: "int64"
|
|
90
|
+
});
|
|
91
|
+
/** Raised when the caller is being throttled and should retry later.
|
|
92
|
+
*/
|
|
93
|
+
export class ThrottledProblem extends Runtime.RpcError {
|
|
94
|
+
actions = [];
|
|
95
|
+
retryAfterMs = null;
|
|
96
|
+
get __structPath() {
|
|
97
|
+
return ThrottledProblemMeta.path;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
ThrottledProblemMeta.problemInstantiate = (msg) => new ThrottledProblem(msg);
|
|
101
|
+
/** Struct metadata
|
|
102
|
+
*/
|
|
103
|
+
export const QuotaExceededProblemMeta = new Metadata.Struct(_pkg, "QuotaExceededProblem");
|
|
104
|
+
new Metadata.Property(QuotaExceededProblemMeta, "actions", {
|
|
105
|
+
NonNullable: true,
|
|
106
|
+
SubType: "array",
|
|
107
|
+
Item: {
|
|
108
|
+
NonNullable: true,
|
|
109
|
+
SubType: "userDefined",
|
|
110
|
+
Type: SpecularPackage().requireTypeByName("ProblemAction")
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
new Metadata.Property(QuotaExceededProblemMeta, "message", {
|
|
114
|
+
NonNullable: true,
|
|
115
|
+
SubType: "builtin",
|
|
116
|
+
Builtin: "string"
|
|
117
|
+
});
|
|
118
|
+
/** Raised when a resource quota has been exceeded.
|
|
119
|
+
*/
|
|
120
|
+
export class QuotaExceededProblem extends Runtime.RpcError {
|
|
121
|
+
actions = [];
|
|
122
|
+
get __structPath() {
|
|
123
|
+
return QuotaExceededProblemMeta.path;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
QuotaExceededProblemMeta.problemInstantiate = (msg) => new QuotaExceededProblem(msg);
|
|
34
127
|
export function SpecularPackage() {
|
|
35
128
|
return _pkg;
|
|
36
129
|
}
|
package/specular.ts
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
// JS gen package
|
|
2
1
|
import {
|
|
3
2
|
Runtime,
|
|
4
3
|
Metadata,
|
|
5
4
|
} from '@deployport/specular-runtime';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/** Marks an operation with digital signature authentication for id4ntity verification
|
|
7
|
+
*/
|
|
9
8
|
export class SignedOperationV1 {
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
/** entity ServiceSignatureV1
|
|
12
|
+
*/
|
|
13
13
|
export class ServiceSignatureV1 {
|
|
14
|
+
/** serviceName parameter
|
|
15
|
+
*/
|
|
14
16
|
public ServiceName: string = '';
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
const _pkg = new Metadata.Package(
|
|
18
|
-
|
|
20
|
+
"deployport",
|
|
21
|
+
"corelib",
|
|
19
22
|
);
|
|
20
23
|
|
|
24
|
+
/** Struct metadata
|
|
25
|
+
*/
|
|
21
26
|
export const AccessDeniedProblemMeta = new Metadata.Struct(
|
|
22
27
|
_pkg,
|
|
23
28
|
"AccessDeniedProblem",
|
|
@@ -27,20 +32,23 @@ NonNullable: true,
|
|
|
27
32
|
SubType: "builtin",
|
|
28
33
|
Builtin: "string"
|
|
29
34
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
/** struct AccessDeniedProblem
|
|
36
|
+
*/
|
|
37
|
+
export interface AccessDeniedProblemProperties {
|
|
38
|
+
/** message property
|
|
39
|
+
*/
|
|
40
|
+
message : string
|
|
41
|
+
}
|
|
42
|
+
/** struct AccessDeniedProblem
|
|
43
|
+
*/
|
|
44
|
+
export class AccessDeniedProblem extends Runtime.RpcError implements AccessDeniedProblemProperties, Runtime.StructInterface {
|
|
45
|
+
get __structPath(): Metadata.StructPath {
|
|
46
|
+
return AccessDeniedProblemMeta.path
|
|
47
|
+
}
|
|
48
|
+
}
|
|
43
49
|
AccessDeniedProblemMeta.problemInstantiate = (msg: string) => new AccessDeniedProblem(msg);
|
|
50
|
+
/** Struct metadata
|
|
51
|
+
*/
|
|
44
52
|
export const ForbiddenProblemMeta = new Metadata.Struct(
|
|
45
53
|
_pkg,
|
|
46
54
|
"ForbiddenProblem",
|
|
@@ -50,20 +58,159 @@ NonNullable: true,
|
|
|
50
58
|
SubType: "builtin",
|
|
51
59
|
Builtin: "string"
|
|
52
60
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
export
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
/** struct ForbiddenProblem
|
|
62
|
+
*/
|
|
63
|
+
export interface ForbiddenProblemProperties {
|
|
64
|
+
/** message property
|
|
65
|
+
*/
|
|
66
|
+
message : string
|
|
67
|
+
}
|
|
68
|
+
/** struct ForbiddenProblem
|
|
69
|
+
*/
|
|
70
|
+
export class ForbiddenProblem extends Runtime.RpcError implements ForbiddenProblemProperties, Runtime.StructInterface {
|
|
71
|
+
get __structPath(): Metadata.StructPath {
|
|
72
|
+
return ForbiddenProblemMeta.path
|
|
73
|
+
}
|
|
74
|
+
}
|
|
66
75
|
ForbiddenProblemMeta.problemInstantiate = (msg: string) => new ForbiddenProblem(msg);
|
|
76
|
+
/** Struct metadata
|
|
77
|
+
*/
|
|
78
|
+
export const ProblemActionMeta = new Metadata.Struct(
|
|
79
|
+
_pkg,
|
|
80
|
+
"ProblemAction",
|
|
81
|
+
);
|
|
82
|
+
new Metadata.Property(ProblemActionMeta, "id", {
|
|
83
|
+
NonNullable: true,
|
|
84
|
+
SubType: "builtin",
|
|
85
|
+
Builtin: "string"
|
|
86
|
+
});
|
|
87
|
+
new Metadata.Property(ProblemActionMeta, "locale", {
|
|
88
|
+
NonNullable: false,
|
|
89
|
+
SubType: "builtin",
|
|
90
|
+
Builtin: "string"
|
|
91
|
+
});
|
|
92
|
+
new Metadata.Property(ProblemActionMeta, "title", {
|
|
93
|
+
NonNullable: true,
|
|
94
|
+
SubType: "builtin",
|
|
95
|
+
Builtin: "string"
|
|
96
|
+
});
|
|
97
|
+
new Metadata.Property(ProblemActionMeta, "url", {
|
|
98
|
+
NonNullable: false,
|
|
99
|
+
SubType: "builtin",
|
|
100
|
+
Builtin: "string"
|
|
101
|
+
});
|
|
102
|
+
/** A localized call-to-action surfaced alongside a problem. Title and URL
|
|
103
|
+
* are already resolved to a specific locale; clients render them as-is.
|
|
104
|
+
*/
|
|
105
|
+
export interface ProblemActionProperties {
|
|
106
|
+
/** Optional stable identifier. Clients can key on it to apply custom
|
|
107
|
+
* presentation (icon, ordering) per well-known action.
|
|
108
|
+
*/
|
|
109
|
+
id : string
|
|
110
|
+
/** BCP 47 tag of the locale the title and url were resolved to. May
|
|
111
|
+
* differ from the caller's requested locale when a fallback was used.
|
|
112
|
+
*/
|
|
113
|
+
locale : string| null
|
|
114
|
+
/** title property
|
|
115
|
+
*/
|
|
116
|
+
title : string
|
|
117
|
+
/** url property
|
|
118
|
+
*/
|
|
119
|
+
url : string| null
|
|
120
|
+
}
|
|
121
|
+
/** A localized call-to-action surfaced alongside a problem. Title and URL
|
|
122
|
+
* are already resolved to a specific locale; clients render them as-is.
|
|
123
|
+
*/
|
|
124
|
+
export interface ProblemAction extends ProblemActionProperties, Runtime.StructInterface {}
|
|
125
|
+
/** Struct metadata
|
|
126
|
+
*/
|
|
127
|
+
export const ThrottledProblemMeta = new Metadata.Struct(
|
|
128
|
+
_pkg,
|
|
129
|
+
"ThrottledProblem",
|
|
130
|
+
);
|
|
131
|
+
new Metadata.Property(ThrottledProblemMeta, "actions", {
|
|
132
|
+
NonNullable: true,
|
|
133
|
+
SubType: "array",
|
|
134
|
+
Item: {
|
|
135
|
+
NonNullable: true,
|
|
136
|
+
SubType: "userDefined",
|
|
137
|
+
Type: SpecularPackage().requireTypeByName("ProblemAction")
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
new Metadata.Property(ThrottledProblemMeta, "message", {
|
|
141
|
+
NonNullable: true,
|
|
142
|
+
SubType: "builtin",
|
|
143
|
+
Builtin: "string"
|
|
144
|
+
});
|
|
145
|
+
new Metadata.Property(ThrottledProblemMeta, "retryAfterMs", {
|
|
146
|
+
NonNullable: false,
|
|
147
|
+
SubType: "builtin",
|
|
148
|
+
Builtin: "int64"
|
|
149
|
+
});
|
|
150
|
+
/** Raised when the caller is being throttled and should retry later.
|
|
151
|
+
*/
|
|
152
|
+
export interface ThrottledProblemProperties {
|
|
153
|
+
/** Optional calls-to-action to help the caller (e.g. support, upgrade,
|
|
154
|
+
* docs links), ordered most-specific first. Empty when none apply.
|
|
155
|
+
*/
|
|
156
|
+
actions : (ProblemActionProperties)[]
|
|
157
|
+
/** message property
|
|
158
|
+
*/
|
|
159
|
+
message : string
|
|
160
|
+
/** Milliseconds the caller should wait before retrying.
|
|
161
|
+
*/
|
|
162
|
+
retryAfterMs : number| null
|
|
163
|
+
}
|
|
164
|
+
/** Raised when the caller is being throttled and should retry later.
|
|
165
|
+
*/
|
|
166
|
+
export class ThrottledProblem extends Runtime.RpcError implements ThrottledProblemProperties, Runtime.StructInterface {
|
|
167
|
+
actions : (ProblemActionProperties)[] = []
|
|
168
|
+
retryAfterMs : number| null = null
|
|
169
|
+
get __structPath(): Metadata.StructPath {
|
|
170
|
+
return ThrottledProblemMeta.path
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
ThrottledProblemMeta.problemInstantiate = (msg: string) => new ThrottledProblem(msg);
|
|
174
|
+
/** Struct metadata
|
|
175
|
+
*/
|
|
176
|
+
export const QuotaExceededProblemMeta = new Metadata.Struct(
|
|
177
|
+
_pkg,
|
|
178
|
+
"QuotaExceededProblem",
|
|
179
|
+
);
|
|
180
|
+
new Metadata.Property(QuotaExceededProblemMeta, "actions", {
|
|
181
|
+
NonNullable: true,
|
|
182
|
+
SubType: "array",
|
|
183
|
+
Item: {
|
|
184
|
+
NonNullable: true,
|
|
185
|
+
SubType: "userDefined",
|
|
186
|
+
Type: SpecularPackage().requireTypeByName("ProblemAction")
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
new Metadata.Property(QuotaExceededProblemMeta, "message", {
|
|
190
|
+
NonNullable: true,
|
|
191
|
+
SubType: "builtin",
|
|
192
|
+
Builtin: "string"
|
|
193
|
+
});
|
|
194
|
+
/** Raised when a resource quota has been exceeded.
|
|
195
|
+
*/
|
|
196
|
+
export interface QuotaExceededProblemProperties {
|
|
197
|
+
/** Optional calls-to-action to help the caller (e.g. request an increase,
|
|
198
|
+
* upgrade, docs links), ordered most-specific first. Empty when none apply.
|
|
199
|
+
*/
|
|
200
|
+
actions : (ProblemActionProperties)[]
|
|
201
|
+
/** message property
|
|
202
|
+
*/
|
|
203
|
+
message : string
|
|
204
|
+
}
|
|
205
|
+
/** Raised when a resource quota has been exceeded.
|
|
206
|
+
*/
|
|
207
|
+
export class QuotaExceededProblem extends Runtime.RpcError implements QuotaExceededProblemProperties, Runtime.StructInterface {
|
|
208
|
+
actions : (ProblemActionProperties)[] = []
|
|
209
|
+
get __structPath(): Metadata.StructPath {
|
|
210
|
+
return QuotaExceededProblemMeta.path
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
QuotaExceededProblemMeta.problemInstantiate = (msg: string) => new QuotaExceededProblem(msg);
|
|
67
214
|
|
|
68
215
|
export function SpecularPackage() {
|
|
69
216
|
return _pkg;
|
package/specular.yaml
CHANGED