@fragno-dev/backoffice-api 0.0.0-stage → 0.0.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/LICENSE.md +16 -0
- package/README.md +90 -2
- package/dist/api.d.ts +35 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +10 -0
- package/dist/api.js.map +1 -0
- package/dist/errors.d.ts +45 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +35 -0
- package/dist/errors.js.map +1 -0
- package/dist/openapi.d.ts +46 -0
- package/dist/openapi.d.ts.map +1 -0
- package/dist/openapi.js +205 -0
- package/dist/openapi.js.map +1 -0
- package/dist/v0/account.d.ts +171 -0
- package/dist/v0/account.d.ts.map +1 -0
- package/dist/v0/account.js +78 -0
- package/dist/v0/account.js.map +1 -0
- package/dist/v0/api.d.ts +3437 -0
- package/dist/v0/api.d.ts.map +1 -0
- package/dist/v0/api.js +52 -0
- package/dist/v0/api.js.map +1 -0
- package/dist/v0/app-actions.d.ts +105 -0
- package/dist/v0/app-actions.d.ts.map +1 -0
- package/dist/v0/app-actions.js +100 -0
- package/dist/v0/app-actions.js.map +1 -0
- package/dist/v0/apps.d.ts +417 -0
- package/dist/v0/apps.d.ts.map +1 -0
- package/dist/v0/apps.js +163 -0
- package/dist/v0/apps.js.map +1 -0
- package/dist/v0/automation.d.ts +730 -0
- package/dist/v0/automation.d.ts.map +1 -0
- package/dist/v0/automation.js +355 -0
- package/dist/v0/automation.js.map +1 -0
- package/dist/v0/capabilities.d.ts +97 -0
- package/dist/v0/capabilities.d.ts.map +1 -0
- package/dist/v0/capabilities.js +41 -0
- package/dist/v0/capabilities.js.map +1 -0
- package/dist/v0/client.d.ts +39 -0
- package/dist/v0/client.d.ts.map +1 -0
- package/dist/v0/client.js +61 -0
- package/dist/v0/client.js.map +1 -0
- package/dist/v0/events.d.ts +789 -0
- package/dist/v0/events.d.ts.map +1 -0
- package/dist/v0/events.js +153 -0
- package/dist/v0/events.js.map +1 -0
- package/dist/v0/forms.d.ts +172 -0
- package/dist/v0/forms.d.ts.map +1 -0
- package/dist/v0/forms.js +88 -0
- package/dist/v0/forms.js.map +1 -0
- package/dist/v0/hooks.d.ts +61 -0
- package/dist/v0/hooks.d.ts.map +1 -0
- package/dist/v0/hooks.js +49 -0
- package/dist/v0/hooks.js.map +1 -0
- package/dist/v0/identity.d.ts +73 -0
- package/dist/v0/identity.d.ts.map +1 -0
- package/dist/v0/identity.js +46 -0
- package/dist/v0/identity.js.map +1 -0
- package/dist/v0/integrations.d.ts +847 -0
- package/dist/v0/integrations.d.ts.map +1 -0
- package/dist/v0/integrations.js +255 -0
- package/dist/v0/integrations.js.map +1 -0
- package/dist/v0/javascript.d.ts +160 -0
- package/dist/v0/javascript.d.ts.map +1 -0
- package/dist/v0/javascript.js +123 -0
- package/dist/v0/javascript.js.map +1 -0
- package/dist/v0/marketplace.d.ts +825 -0
- package/dist/v0/marketplace.d.ts.map +1 -0
- package/dist/v0/marketplace.js +284 -0
- package/dist/v0/marketplace.js.map +1 -0
- package/dist/v0/organization.d.ts +182 -0
- package/dist/v0/organization.d.ts.map +1 -0
- package/dist/v0/organization.js +88 -0
- package/dist/v0/organization.js.map +1 -0
- package/dist/v0/otp.d.ts +37 -0
- package/dist/v0/otp.d.ts.map +1 -0
- package/dist/v0/otp.js +29 -0
- package/dist/v0/otp.js.map +1 -0
- package/dist/v0/pi.d.ts +322 -0
- package/dist/v0/pi.d.ts.map +1 -0
- package/dist/v0/pi.js +146 -0
- package/dist/v0/pi.js.map +1 -0
- package/dist/v0/sandbox.d.ts +173 -0
- package/dist/v0/sandbox.d.ts.map +1 -0
- package/dist/v0/sandbox.js +97 -0
- package/dist/v0/sandbox.js.map +1 -0
- package/dist/v0/shared/bytes.d.ts +12 -0
- package/dist/v0/shared/bytes.d.ts.map +1 -0
- package/dist/v0/shared/bytes.js +16 -0
- package/dist/v0/shared/bytes.js.map +1 -0
- package/dist/v0/shared/datetime.d.ts +10 -0
- package/dist/v0/shared/datetime.d.ts.map +1 -0
- package/dist/v0/shared/datetime.js +14 -0
- package/dist/v0/shared/datetime.js.map +1 -0
- package/dist/v0/shared/json.d.ts +9 -0
- package/dist/v0/shared/json.d.ts.map +1 -0
- package/dist/v0/shared/json.js +14 -0
- package/dist/v0/shared/json.js.map +1 -0
- package/dist/v0/shared/pagination.d.ts +11 -0
- package/dist/v0/shared/pagination.d.ts.map +1 -0
- package/dist/v0/shared/pagination.js +11 -0
- package/dist/v0/shared/pagination.js.map +1 -0
- package/dist/v0/shared/permissions.d.ts +279 -0
- package/dist/v0/shared/permissions.d.ts.map +1 -0
- package/dist/v0/shared/permissions.js +285 -0
- package/dist/v0/shared/permissions.js.map +1 -0
- package/dist/v0/shared/pi-agent-name.d.ts +10 -0
- package/dist/v0/shared/pi-agent-name.d.ts.map +1 -0
- package/dist/v0/shared/pi-agent-name.js +11 -0
- package/dist/v0/shared/pi-agent-name.js.map +1 -0
- package/dist/v0/shared/scope.d.ts +305 -0
- package/dist/v0/shared/scope.d.ts.map +1 -0
- package/dist/v0/shared/scope.js +279 -0
- package/dist/v0/shared/scope.js.map +1 -0
- package/dist/v0/state.d.ts +512 -0
- package/dist/v0/state.d.ts.map +1 -0
- package/dist/v0/state.js +267 -0
- package/dist/v0/state.js.map +1 -0
- package/dist/v0/store.d.ts +138 -0
- package/dist/v0/store.d.ts.map +1 -0
- package/dist/v0/store.js +83 -0
- package/dist/v0/store.js.map +1 -0
- package/dist/v0/upload.d.ts +568 -0
- package/dist/v0/upload.d.ts.map +1 -0
- package/dist/v0/upload.js +109 -0
- package/dist/v0/upload.js.map +1 -0
- package/dist/v0/web.d.ts +47 -0
- package/dist/v0/web.d.ts.map +1 -0
- package/dist/v0/web.js +31 -0
- package/dist/v0/web.js.map +1 -0
- package/dist/v0/workflow.d.ts +267 -0
- package/dist/v0/workflow.d.ts.map +1 -0
- package/dist/v0/workflow.js +116 -0
- package/dist/v0/workflow.js.map +1 -0
- package/package.json +64 -3
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { BackofficePermissionRequirement } from "./shared/permissions.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/v0/apps.d.ts
|
|
4
|
+
/** App permission declarations and grants are sets; duplicate entries are malformed input. */
|
|
5
|
+
declare const appPermissionsSchema: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
6
|
+
/** App identity is global; an installation refers to the same registry ID. */
|
|
7
|
+
declare const backofficeAppLookupInputSchema: z.ZodLazy<z.ZodObject<{
|
|
8
|
+
appId: z.ZodString;
|
|
9
|
+
}, z.core.$strict>>;
|
|
10
|
+
type BackofficeAppLookupInput = z.infer<typeof backofficeAppLookupInputSchema>;
|
|
11
|
+
/** Addresses outlive the registration's other fields, so a slug never changes once chosen. */
|
|
12
|
+
declare const appSlugSchema: z.ZodLazy<z.ZodString>;
|
|
13
|
+
/** One operation an app serves on its own server, called through the app's integration connection. */
|
|
14
|
+
declare const appActionSchema: z.ZodLazy<z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
label: z.ZodString;
|
|
17
|
+
description: z.ZodString;
|
|
18
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
19
|
+
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
20
|
+
}, z.core.$strict>>;
|
|
21
|
+
type AppAction = z.infer<typeof appActionSchema>;
|
|
22
|
+
/**
|
|
23
|
+
* What an app lets Backoffice call. Each installation approves one revision of it; with
|
|
24
|
+
* `changeApproval: "automatic"`, later revisions apply to every installation without approval.
|
|
25
|
+
*/
|
|
26
|
+
declare const appActionsDeclarationSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
27
|
+
kind: z.ZodLiteral<"none">;
|
|
28
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
29
|
+
kind: z.ZodLiteral<"endpoint">;
|
|
30
|
+
endpointUrl: z.ZodURL;
|
|
31
|
+
changeApproval: z.ZodEnum<{
|
|
32
|
+
installation: "installation";
|
|
33
|
+
automatic: "automatic";
|
|
34
|
+
}>;
|
|
35
|
+
actions: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
label: z.ZodString;
|
|
38
|
+
description: z.ZodString;
|
|
39
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
40
|
+
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
41
|
+
}, z.core.$strict>>>;
|
|
42
|
+
}, z.core.$strict>], "kind">>;
|
|
43
|
+
type AppActionsDeclaration = z.infer<typeof appActionsDeclarationSchema>;
|
|
44
|
+
/** Backoffice-specific registration data; OAuth metadata remains authoritative in Auth. */
|
|
45
|
+
declare const backofficeAppSchema: z.ZodLazy<z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
slug: z.ZodLazy<z.ZodString>;
|
|
48
|
+
oauthClientId: z.ZodString;
|
|
49
|
+
requestedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
50
|
+
actions: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
51
|
+
kind: z.ZodLiteral<"none">;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
kind: z.ZodLiteral<"endpoint">;
|
|
54
|
+
endpointUrl: z.ZodURL;
|
|
55
|
+
changeApproval: z.ZodEnum<{
|
|
56
|
+
installation: "installation";
|
|
57
|
+
automatic: "automatic";
|
|
58
|
+
}>;
|
|
59
|
+
actions: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
60
|
+
id: z.ZodString;
|
|
61
|
+
label: z.ZodString;
|
|
62
|
+
description: z.ZodString;
|
|
63
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
64
|
+
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
65
|
+
}, z.core.$strict>>>;
|
|
66
|
+
}, z.core.$strict>], "kind">>;
|
|
67
|
+
actionsRevision: z.ZodLazy<z.ZodNumber>;
|
|
68
|
+
createdAt: z.ZodISODateTime;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
type BackofficeApp = z.infer<typeof backofficeAppSchema>;
|
|
71
|
+
/**
|
|
72
|
+
* The owner's resources an installation may act on: everything the owner has, or some of the
|
|
73
|
+
* projects it owns. Project lists are sets; they are normalized so equal selections compare equal
|
|
74
|
+
* regardless of order.
|
|
75
|
+
*/
|
|
76
|
+
declare const appInstallationResourceScopeSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
77
|
+
kind: z.ZodLiteral<"owner">;
|
|
78
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
79
|
+
kind: z.ZodLiteral<"projects">;
|
|
80
|
+
projectIds: z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodArray<z.ZodString>>;
|
|
81
|
+
}, z.core.$strict>], "kind">>;
|
|
82
|
+
type AppInstallationResourceScope = z.infer<typeof appInstallationResourceScopeSchema>;
|
|
83
|
+
/** What an owner approves: permissions, and the resources they apply to. */
|
|
84
|
+
declare const appInstallationAccessSchema: z.ZodLazy<z.ZodObject<{
|
|
85
|
+
grantedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
86
|
+
resourceScope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
87
|
+
kind: z.ZodLiteral<"owner">;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
kind: z.ZodLiteral<"projects">;
|
|
90
|
+
projectIds: z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodArray<z.ZodString>>;
|
|
91
|
+
}, z.core.$strict>], "kind">>;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
/** An app-side tenant, such as a Bookkeeping organization, claimed by the app's server. */
|
|
94
|
+
declare const appInstallationExternalAccountSchema: z.ZodLazy<z.ZodObject<{
|
|
95
|
+
id: z.ZodString;
|
|
96
|
+
label: z.ZodString;
|
|
97
|
+
}, z.core.$strict>>;
|
|
98
|
+
type AppInstallationExternalAccount = z.infer<typeof appInstallationExternalAccountSchema>;
|
|
99
|
+
/** Access changes are explicit control-plane operations and cannot change the owner. */
|
|
100
|
+
declare const backofficeAppInstallationAccessInputSchema: z.ZodLazy<z.ZodObject<{
|
|
101
|
+
appId: z.ZodString;
|
|
102
|
+
grantedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
103
|
+
resourceScope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
104
|
+
kind: z.ZodLiteral<"owner">;
|
|
105
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
106
|
+
kind: z.ZodLiteral<"projects">;
|
|
107
|
+
projectIds: z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodArray<z.ZodString>>;
|
|
108
|
+
}, z.core.$strict>], "kind">>;
|
|
109
|
+
}, z.core.$strict>>;
|
|
110
|
+
type BackofficeAppInstallationAccessInput = z.infer<typeof backofficeAppInstallationAccessInputSchema>;
|
|
111
|
+
/** Installing approves access and, at the reviewed revision, the app's declared actions. */
|
|
112
|
+
declare const backofficeAppInstallInputSchema: z.ZodLazy<z.ZodObject<{
|
|
113
|
+
appId: z.ZodString;
|
|
114
|
+
grantedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
115
|
+
resourceScope: z.ZodDefault<z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
116
|
+
kind: z.ZodLiteral<"owner">;
|
|
117
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
118
|
+
kind: z.ZodLiteral<"projects">;
|
|
119
|
+
projectIds: z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodArray<z.ZodString>>;
|
|
120
|
+
}, z.core.$strict>], "kind">>>;
|
|
121
|
+
actionsRevision: z.ZodLazy<z.ZodNumber>;
|
|
122
|
+
}, z.core.$strict>>;
|
|
123
|
+
type BackofficeAppInstallInput = z.output<typeof backofficeAppInstallInputSchema>;
|
|
124
|
+
/** Approval names the reviewed revision, so a declaration changed since review is never approved. */
|
|
125
|
+
declare const backofficeAppInstallationActionsApprovalInputSchema: z.ZodLazy<z.ZodObject<{
|
|
126
|
+
appId: z.ZodString;
|
|
127
|
+
actionsRevision: z.ZodLazy<z.ZodNumber>;
|
|
128
|
+
}, z.core.$strict>>;
|
|
129
|
+
type BackofficeAppInstallationActionsApprovalInput = z.infer<typeof backofficeAppInstallationActionsApprovalInputSchema>;
|
|
130
|
+
/** Cursors remain bound to the owner even when each object has its own database. */
|
|
131
|
+
declare const backofficeAppInstallationPageInputSchema: z.ZodLazy<z.ZodObject<{
|
|
132
|
+
pageSize: z.ZodNumber;
|
|
133
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
type BackofficeAppInstallationPageInput = z.infer<typeof backofficeAppInstallationPageInputSchema>;
|
|
136
|
+
/**
|
|
137
|
+
* Installation authority belongs to its owner, an organization or a person, not to the installing
|
|
138
|
+
* user: an organization's installation outlives the administrator who approved it.
|
|
139
|
+
*/
|
|
140
|
+
declare const backofficeAppInstallationSchema: z.ZodLazy<z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
appId: z.ZodString;
|
|
143
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
144
|
+
kind: z.ZodLiteral<"org">;
|
|
145
|
+
orgId: z.ZodString;
|
|
146
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
147
|
+
kind: z.ZodLiteral<"user">;
|
|
148
|
+
userId: z.ZodString;
|
|
149
|
+
}, z.core.$strict>>], "kind">>;
|
|
150
|
+
grantedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
151
|
+
resourceScope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
152
|
+
kind: z.ZodLiteral<"owner">;
|
|
153
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
154
|
+
kind: z.ZodLiteral<"projects">;
|
|
155
|
+
projectIds: z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodArray<z.ZodString>>;
|
|
156
|
+
}, z.core.$strict>], "kind">>;
|
|
157
|
+
externalAccount: z.ZodNullable<z.ZodLazy<z.ZodObject<{
|
|
158
|
+
id: z.ZodString;
|
|
159
|
+
label: z.ZodString;
|
|
160
|
+
}, z.core.$strict>>>;
|
|
161
|
+
installedByUserId: z.ZodString;
|
|
162
|
+
status: z.ZodEnum<{
|
|
163
|
+
active: "active";
|
|
164
|
+
uninstalled: "uninstalled";
|
|
165
|
+
}>;
|
|
166
|
+
activation: z.ZodNumber;
|
|
167
|
+
approvedActionsRevision: z.ZodNumber;
|
|
168
|
+
createdAt: z.ZodISODateTime;
|
|
169
|
+
updatedAt: z.ZodISODateTime;
|
|
170
|
+
}, z.core.$strict>>;
|
|
171
|
+
type BackofficeAppInstallation = z.infer<typeof backofficeAppInstallationSchema>;
|
|
172
|
+
/** Reinstallation preserves the transaction-resolved installation identity. */
|
|
173
|
+
declare const backofficeAppInstallationMutationResultSchema: z.ZodLazy<z.ZodObject<{
|
|
174
|
+
installationId: z.ZodString;
|
|
175
|
+
changed: z.ZodBoolean;
|
|
176
|
+
}, z.core.$strict>>;
|
|
177
|
+
type BackofficeAppInstallationMutationResult = z.infer<typeof backofficeAppInstallationMutationResultSchema>;
|
|
178
|
+
/** An owner's installation history includes uninstalled records. */
|
|
179
|
+
declare const backofficeAppInstallationPageSchema: z.ZodLazy<z.ZodObject<{
|
|
180
|
+
installations: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
181
|
+
id: z.ZodString;
|
|
182
|
+
appId: z.ZodString;
|
|
183
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
184
|
+
kind: z.ZodLiteral<"org">;
|
|
185
|
+
orgId: z.ZodString;
|
|
186
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
187
|
+
kind: z.ZodLiteral<"user">;
|
|
188
|
+
userId: z.ZodString;
|
|
189
|
+
}, z.core.$strict>>], "kind">>;
|
|
190
|
+
grantedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
191
|
+
resourceScope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
192
|
+
kind: z.ZodLiteral<"owner">;
|
|
193
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
194
|
+
kind: z.ZodLiteral<"projects">;
|
|
195
|
+
projectIds: z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodArray<z.ZodString>>;
|
|
196
|
+
}, z.core.$strict>], "kind">>;
|
|
197
|
+
externalAccount: z.ZodNullable<z.ZodLazy<z.ZodObject<{
|
|
198
|
+
id: z.ZodString;
|
|
199
|
+
label: z.ZodString;
|
|
200
|
+
}, z.core.$strict>>>;
|
|
201
|
+
installedByUserId: z.ZodString;
|
|
202
|
+
status: z.ZodEnum<{
|
|
203
|
+
active: "active";
|
|
204
|
+
uninstalled: "uninstalled";
|
|
205
|
+
}>;
|
|
206
|
+
activation: z.ZodNumber;
|
|
207
|
+
approvedActionsRevision: z.ZodNumber;
|
|
208
|
+
createdAt: z.ZodISODateTime;
|
|
209
|
+
updatedAt: z.ZodISODateTime;
|
|
210
|
+
}, z.core.$strict>>>;
|
|
211
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
212
|
+
hasNextPage: z.ZodBoolean;
|
|
213
|
+
}, z.core.$strict>>;
|
|
214
|
+
type BackofficeAppInstallationPage = z.infer<typeof backofficeAppInstallationPageSchema>;
|
|
215
|
+
/**
|
|
216
|
+
* App operations manage the installations of the scoped owner, an organization or the calling
|
|
217
|
+
* user's personal scope, as the calling user.
|
|
218
|
+
*/
|
|
219
|
+
declare const appsOperations: {
|
|
220
|
+
"apps.get": {
|
|
221
|
+
description: string;
|
|
222
|
+
permissions: {
|
|
223
|
+
readonly namespace: "apps";
|
|
224
|
+
readonly permission: "read";
|
|
225
|
+
}[];
|
|
226
|
+
input: z.ZodLazy<z.ZodObject<{
|
|
227
|
+
appId: z.ZodString;
|
|
228
|
+
}, z.core.$strict>>;
|
|
229
|
+
output: z.ZodLazy<z.ZodNullable<z.ZodLazy<z.ZodObject<{
|
|
230
|
+
id: z.ZodString;
|
|
231
|
+
slug: z.ZodLazy<z.ZodString>;
|
|
232
|
+
oauthClientId: z.ZodString;
|
|
233
|
+
requestedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
234
|
+
actions: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
235
|
+
kind: z.ZodLiteral<"none">;
|
|
236
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
237
|
+
kind: z.ZodLiteral<"endpoint">;
|
|
238
|
+
endpointUrl: z.ZodURL;
|
|
239
|
+
changeApproval: z.ZodEnum<{
|
|
240
|
+
installation: "installation";
|
|
241
|
+
automatic: "automatic";
|
|
242
|
+
}>;
|
|
243
|
+
actions: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
244
|
+
id: z.ZodString;
|
|
245
|
+
label: z.ZodString;
|
|
246
|
+
description: z.ZodString;
|
|
247
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
248
|
+
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
249
|
+
}, z.core.$strict>>>;
|
|
250
|
+
}, z.core.$strict>], "kind">>;
|
|
251
|
+
actionsRevision: z.ZodLazy<z.ZodNumber>;
|
|
252
|
+
createdAt: z.ZodISODateTime;
|
|
253
|
+
}, z.core.$strict>>>>;
|
|
254
|
+
};
|
|
255
|
+
"apps.install": {
|
|
256
|
+
description: string;
|
|
257
|
+
permissions: {
|
|
258
|
+
readonly namespace: "apps";
|
|
259
|
+
readonly permission: "manage";
|
|
260
|
+
}[];
|
|
261
|
+
input: z.ZodLazy<z.ZodObject<{
|
|
262
|
+
appId: z.ZodString;
|
|
263
|
+
grantedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
264
|
+
resourceScope: z.ZodDefault<z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
265
|
+
kind: z.ZodLiteral<"owner">;
|
|
266
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
267
|
+
kind: z.ZodLiteral<"projects">;
|
|
268
|
+
projectIds: z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodArray<z.ZodString>>;
|
|
269
|
+
}, z.core.$strict>], "kind">>>;
|
|
270
|
+
actionsRevision: z.ZodLazy<z.ZodNumber>;
|
|
271
|
+
}, z.core.$strict>>;
|
|
272
|
+
output: z.ZodLazy<z.ZodObject<{
|
|
273
|
+
installationId: z.ZodString;
|
|
274
|
+
changed: z.ZodBoolean;
|
|
275
|
+
}, z.core.$strict>>;
|
|
276
|
+
};
|
|
277
|
+
"apps.installations.get": {
|
|
278
|
+
description: string;
|
|
279
|
+
permissions: {
|
|
280
|
+
readonly namespace: "apps";
|
|
281
|
+
readonly permission: "read";
|
|
282
|
+
}[];
|
|
283
|
+
input: z.ZodLazy<z.ZodObject<{
|
|
284
|
+
appId: z.ZodString;
|
|
285
|
+
}, z.core.$strict>>;
|
|
286
|
+
output: z.ZodLazy<z.ZodNullable<z.ZodLazy<z.ZodObject<{
|
|
287
|
+
id: z.ZodString;
|
|
288
|
+
appId: z.ZodString;
|
|
289
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
290
|
+
kind: z.ZodLiteral<"org">;
|
|
291
|
+
orgId: z.ZodString;
|
|
292
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
293
|
+
kind: z.ZodLiteral<"user">;
|
|
294
|
+
userId: z.ZodString;
|
|
295
|
+
}, z.core.$strict>>], "kind">>;
|
|
296
|
+
grantedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
297
|
+
resourceScope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
298
|
+
kind: z.ZodLiteral<"owner">;
|
|
299
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
300
|
+
kind: z.ZodLiteral<"projects">;
|
|
301
|
+
projectIds: z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodArray<z.ZodString>>;
|
|
302
|
+
}, z.core.$strict>], "kind">>;
|
|
303
|
+
externalAccount: z.ZodNullable<z.ZodLazy<z.ZodObject<{
|
|
304
|
+
id: z.ZodString;
|
|
305
|
+
label: z.ZodString;
|
|
306
|
+
}, z.core.$strict>>>;
|
|
307
|
+
installedByUserId: z.ZodString;
|
|
308
|
+
status: z.ZodEnum<{
|
|
309
|
+
active: "active";
|
|
310
|
+
uninstalled: "uninstalled";
|
|
311
|
+
}>;
|
|
312
|
+
activation: z.ZodNumber;
|
|
313
|
+
approvedActionsRevision: z.ZodNumber;
|
|
314
|
+
createdAt: z.ZodISODateTime;
|
|
315
|
+
updatedAt: z.ZodISODateTime;
|
|
316
|
+
}, z.core.$strict>>>>;
|
|
317
|
+
};
|
|
318
|
+
"apps.installations.list": {
|
|
319
|
+
description: string;
|
|
320
|
+
permissions: {
|
|
321
|
+
readonly namespace: "apps";
|
|
322
|
+
readonly permission: "read";
|
|
323
|
+
}[];
|
|
324
|
+
input: z.ZodLazy<z.ZodObject<{
|
|
325
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
326
|
+
cursor: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
327
|
+
}, z.core.$strict>>;
|
|
328
|
+
output: z.ZodLazy<z.ZodObject<{
|
|
329
|
+
installations: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
330
|
+
id: z.ZodString;
|
|
331
|
+
appId: z.ZodString;
|
|
332
|
+
owner: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
|
|
333
|
+
kind: z.ZodLiteral<"org">;
|
|
334
|
+
orgId: z.ZodString;
|
|
335
|
+
}, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
|
|
336
|
+
kind: z.ZodLiteral<"user">;
|
|
337
|
+
userId: z.ZodString;
|
|
338
|
+
}, z.core.$strict>>], "kind">>;
|
|
339
|
+
grantedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
340
|
+
resourceScope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
341
|
+
kind: z.ZodLiteral<"owner">;
|
|
342
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
343
|
+
kind: z.ZodLiteral<"projects">;
|
|
344
|
+
projectIds: z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodArray<z.ZodString>>;
|
|
345
|
+
}, z.core.$strict>], "kind">>;
|
|
346
|
+
externalAccount: z.ZodNullable<z.ZodLazy<z.ZodObject<{
|
|
347
|
+
id: z.ZodString;
|
|
348
|
+
label: z.ZodString;
|
|
349
|
+
}, z.core.$strict>>>;
|
|
350
|
+
installedByUserId: z.ZodString;
|
|
351
|
+
status: z.ZodEnum<{
|
|
352
|
+
active: "active";
|
|
353
|
+
uninstalled: "uninstalled";
|
|
354
|
+
}>;
|
|
355
|
+
activation: z.ZodNumber;
|
|
356
|
+
approvedActionsRevision: z.ZodNumber;
|
|
357
|
+
createdAt: z.ZodISODateTime;
|
|
358
|
+
updatedAt: z.ZodISODateTime;
|
|
359
|
+
}, z.core.$strict>>>;
|
|
360
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
361
|
+
hasNextPage: z.ZodBoolean;
|
|
362
|
+
}, z.core.$strict>>;
|
|
363
|
+
};
|
|
364
|
+
"apps.installations.update": {
|
|
365
|
+
description: string;
|
|
366
|
+
permissions: {
|
|
367
|
+
readonly namespace: "apps";
|
|
368
|
+
readonly permission: "manage";
|
|
369
|
+
}[];
|
|
370
|
+
input: z.ZodLazy<z.ZodObject<{
|
|
371
|
+
appId: z.ZodString;
|
|
372
|
+
grantedPermissions: z.ZodLazy<z.ZodArray<z.ZodType<BackofficePermissionRequirement, unknown, z.core.$ZodTypeInternals<BackofficePermissionRequirement, unknown>>>>;
|
|
373
|
+
resourceScope: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
374
|
+
kind: z.ZodLiteral<"owner">;
|
|
375
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
376
|
+
kind: z.ZodLiteral<"projects">;
|
|
377
|
+
projectIds: z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>, z.ZodArray<z.ZodString>>;
|
|
378
|
+
}, z.core.$strict>], "kind">>;
|
|
379
|
+
}, z.core.$strict>>;
|
|
380
|
+
output: z.ZodLazy<z.ZodObject<{
|
|
381
|
+
installationId: z.ZodString;
|
|
382
|
+
changed: z.ZodBoolean;
|
|
383
|
+
}, z.core.$strict>>;
|
|
384
|
+
};
|
|
385
|
+
"apps.installations.approveActions": {
|
|
386
|
+
description: string;
|
|
387
|
+
permissions: {
|
|
388
|
+
readonly namespace: "apps";
|
|
389
|
+
readonly permission: "manage";
|
|
390
|
+
}[];
|
|
391
|
+
input: z.ZodLazy<z.ZodObject<{
|
|
392
|
+
appId: z.ZodString;
|
|
393
|
+
actionsRevision: z.ZodLazy<z.ZodNumber>;
|
|
394
|
+
}, z.core.$strict>>;
|
|
395
|
+
output: z.ZodLazy<z.ZodObject<{
|
|
396
|
+
installationId: z.ZodString;
|
|
397
|
+
changed: z.ZodBoolean;
|
|
398
|
+
}, z.core.$strict>>;
|
|
399
|
+
};
|
|
400
|
+
"apps.uninstall": {
|
|
401
|
+
description: string;
|
|
402
|
+
permissions: {
|
|
403
|
+
readonly namespace: "apps";
|
|
404
|
+
readonly permission: "manage";
|
|
405
|
+
}[];
|
|
406
|
+
input: z.ZodLazy<z.ZodObject<{
|
|
407
|
+
appId: z.ZodString;
|
|
408
|
+
}, z.core.$strict>>;
|
|
409
|
+
output: z.ZodLazy<z.ZodObject<{
|
|
410
|
+
installationId: z.ZodString;
|
|
411
|
+
changed: z.ZodBoolean;
|
|
412
|
+
}, z.core.$strict>>;
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
//#endregion
|
|
416
|
+
export { AppAction, AppActionsDeclaration, AppInstallationExternalAccount, AppInstallationResourceScope, BackofficeApp, BackofficeAppInstallInput, BackofficeAppInstallation, BackofficeAppInstallationAccessInput, BackofficeAppInstallationActionsApprovalInput, BackofficeAppInstallationMutationResult, BackofficeAppInstallationPage, BackofficeAppInstallationPageInput, BackofficeAppLookupInput, appActionSchema, appActionsDeclarationSchema, appInstallationAccessSchema, appInstallationExternalAccountSchema, appPermissionsSchema, appSlugSchema, appsOperations, backofficeAppInstallInputSchema, backofficeAppInstallationAccessInputSchema, backofficeAppInstallationActionsApprovalInputSchema, backofficeAppInstallationMutationResultSchema, backofficeAppInstallationPageInputSchema, backofficeAppInstallationPageSchema, backofficeAppInstallationSchema, backofficeAppLookupInputSchema, backofficeAppSchema };
|
|
417
|
+
//# sourceMappingURL=apps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps.d.ts","names":[],"sources":["../../src/v0/apps.ts"],"mappings":";;;;cAQa,sBAAoB,EAAA,QAAA,EAAA,SAAA,EAAA,QAApB,0CAAoB,EAAA,KAAA,kBAAA;;cAYpB,gCAA8B,EAAA,QAAA,EAAA;;;KAG/B,2BAA2B,EAAE,aAAa;;cAGzC,eAAa,EAAA,QAAA,EAAA;;cAgBb,iBAAe,EAAA,QAAA,EAAA;;;;;;;KAqBhB,YAAY,EAAE,aAAa;;;;;cAM1B,6BAA2B,EAAA,QAAA,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;KAgC5B,wBAAwB,EAAE,aAAa;;cAOtC,qBAAmB,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAapB,gBAAgB,EAAE,aAAa;;;;;;cAOrC,oCAAkC,EAAA,QAAA,EAAA,uBAAA,EAAA;;;;;;KAiB5B,+BAA+B,EAAE,aAAa;;cAG7C,6BAA2B,EAAA,QAAA,EAAA;qDAA3B;;;;;;;;;cAQA,sCAAoC,EAAA,QAAA,EAAA;;;;KAMrC,iCAAiC,EAAE,aAAa;;cAG/C,4CAA0C,EAAA,QAAA,EAAA;;;;;;;;;;KAK3C,uCAAuC,EAAE,aAC5C;;cAII,iCAA+B,EAAA,QAAA,EAAA;;;;;;;;;;;KAQhC,4BAA4B,EAAE,cAAc;;cAG3C,qDAAmD,EAAA,QAAA,EAAA;;;;KAOpD,gDAAgD,EAAE,aACrD;;cAII,0CAAwC,EAAA,QAAA,EAAA;;;;KAMzC,qCAAqC,EAAE,aAC1C;;;;;cAOI,iCAA+B,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0BhC,4BAA4B,EAAE,aAAa;;cAG1C,+CAA6C,EAAA,QAAA,EAAA;;;;KAQ9C,0CAA0C,EAAE,aAC/C;;cAII,qCAAmC,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KASpC,gCAAgC,EAAE,aAAa;;;;;cAM9C"}
|
package/dist/v0/apps.js
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { BACKOFFICE_PERMISSION, backofficePermissionRequirementSchema } from "./shared/permissions.js";
|
|
2
|
+
import { backofficeRootOwnerSchema } from "./shared/scope.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/v0/apps.ts
|
|
5
|
+
/** App permission declarations and grants are sets; duplicate entries are malformed input. */
|
|
6
|
+
const appPermissionsSchema = z.lazy(() => z.array(backofficePermissionRequirementSchema).refine((permissions) => new Set(permissions.map(({ namespace, permission }) => `${namespace}.${permission}`)).size === permissions.length, "Backoffice app permissions must not contain duplicates."));
|
|
7
|
+
/** App identity is global; an installation refers to the same registry ID. */
|
|
8
|
+
const backofficeAppLookupInputSchema = z.lazy(() => z.strictObject({ appId: z.string().min(1).max(191) }));
|
|
9
|
+
/** Addresses outlive the registration's other fields, so a slug never changes once chosen. */
|
|
10
|
+
const appSlugSchema = z.lazy(() => z.string().max(63).regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, "App slugs are lowercase words separated by '-', e.g. bookkeeping.").describe("Unique, permanent name for the app; its integration connection is app#<slug>, e.g. app#bookkeeping."));
|
|
11
|
+
const LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set([
|
|
12
|
+
"127.0.0.1",
|
|
13
|
+
"localhost",
|
|
14
|
+
"[::1]"
|
|
15
|
+
]);
|
|
16
|
+
/** One operation an app serves on its own server, called through the app's integration connection. */
|
|
17
|
+
const appActionSchema = z.lazy(() => z.strictObject({
|
|
18
|
+
id: z.string().max(100).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/, "App action IDs are lowercase words separated by '.', '-', or '_', e.g. invoices.list."),
|
|
19
|
+
label: z.string().trim().min(1).max(100),
|
|
20
|
+
description: z.string().trim().min(1).max(1e3),
|
|
21
|
+
inputSchema: z.record(z.string(), z.unknown()).describe("JSON Schema (2020-12 or draft-07) for the action's object input."),
|
|
22
|
+
outputSchema: z.record(z.string(), z.unknown()).describe("JSON Schema (2020-12 or draft-07) for the action's result.")
|
|
23
|
+
})).meta({ id: "AppAction" });
|
|
24
|
+
/**
|
|
25
|
+
* What an app lets Backoffice call. Each installation approves one revision of it; with
|
|
26
|
+
* `changeApproval: "automatic"`, later revisions apply to every installation without approval.
|
|
27
|
+
*/
|
|
28
|
+
const appActionsDeclarationSchema = z.lazy(() => z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("none") }), z.strictObject({
|
|
29
|
+
kind: z.literal("endpoint"),
|
|
30
|
+
endpointUrl: z.url({ protocol: /^https?$/ }).refine((url) => url.startsWith("https:") || LOOPBACK_HOSTNAMES.has(new URL(url).hostname), "App action endpoints use HTTPS; plain HTTP is allowed only on loopback for development.").describe("Receives each signed action request as a POST; the request token's audience is this URL."),
|
|
31
|
+
changeApproval: z.enum(["installation", "automatic"]).describe("installation: each installation approves a changed declaration before new or changed actions run. automatic: changes apply immediately; only administrators register apps, so reserve it for apps they operate."),
|
|
32
|
+
actions: z.array(appActionSchema).min(1).max(100).refine((actions) => new Set(actions.map(({ id }) => id)).size === actions.length, "App action IDs must be unique.")
|
|
33
|
+
})])).meta({ id: "AppActionsDeclaration" });
|
|
34
|
+
const appActionsRevisionSchema = z.lazy(() => z.number().int().positive().describe("Increments whenever the app's action declaration changes."));
|
|
35
|
+
/** Backoffice-specific registration data; OAuth metadata remains authoritative in Auth. */
|
|
36
|
+
const backofficeAppSchema = z.lazy(() => z.strictObject({
|
|
37
|
+
id: z.string().min(1),
|
|
38
|
+
slug: appSlugSchema,
|
|
39
|
+
oauthClientId: z.string().min(1),
|
|
40
|
+
requestedPermissions: appPermissionsSchema,
|
|
41
|
+
actions: appActionsDeclarationSchema,
|
|
42
|
+
actionsRevision: appActionsRevisionSchema,
|
|
43
|
+
createdAt: z.iso.datetime()
|
|
44
|
+
})).meta({ id: "BackofficeApp" });
|
|
45
|
+
/**
|
|
46
|
+
* The owner's resources an installation may act on: everything the owner has, or some of the
|
|
47
|
+
* projects it owns. Project lists are sets; they are normalized so equal selections compare equal
|
|
48
|
+
* regardless of order.
|
|
49
|
+
*/
|
|
50
|
+
const appInstallationResourceScopeSchema = z.lazy(() => z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("owner") }), z.strictObject({
|
|
51
|
+
kind: z.literal("projects"),
|
|
52
|
+
projectIds: z.array(z.string().trim().min(1).max(191)).min(1).max(100).transform((projectIds) => [...new Set(projectIds)].sort()).pipe(z.array(z.string()))
|
|
53
|
+
})])).meta({ id: "AppInstallationResourceScope" });
|
|
54
|
+
/** What an owner approves: permissions, and the resources they apply to. */
|
|
55
|
+
const appInstallationAccessSchema = z.lazy(() => z.strictObject({
|
|
56
|
+
grantedPermissions: appPermissionsSchema,
|
|
57
|
+
resourceScope: appInstallationResourceScopeSchema
|
|
58
|
+
}));
|
|
59
|
+
/** An app-side tenant, such as a Bookkeeping organization, claimed by the app's server. */
|
|
60
|
+
const appInstallationExternalAccountSchema = z.lazy(() => z.strictObject({
|
|
61
|
+
id: z.string().trim().min(1).max(191),
|
|
62
|
+
label: z.string().trim().min(1).max(191)
|
|
63
|
+
}));
|
|
64
|
+
/** Access changes are explicit control-plane operations and cannot change the owner. */
|
|
65
|
+
const backofficeAppInstallationAccessInputSchema = z.lazy(() => backofficeAppLookupInputSchema._zod.innerType.extend(appInstallationAccessSchema._zod.innerType.shape));
|
|
66
|
+
/** Installing approves access and, at the reviewed revision, the app's declared actions. */
|
|
67
|
+
const backofficeAppInstallInputSchema = z.lazy(() => backofficeAppInstallationAccessInputSchema._zod.innerType.extend({
|
|
68
|
+
resourceScope: appInstallationResourceScopeSchema.default({ kind: "owner" }),
|
|
69
|
+
actionsRevision: appActionsRevisionSchema.describe("The actionsRevision reviewed with apps.get; installation fails if the declaration changed since.")
|
|
70
|
+
}));
|
|
71
|
+
/** Approval names the reviewed revision, so a declaration changed since review is never approved. */
|
|
72
|
+
const backofficeAppInstallationActionsApprovalInputSchema = z.lazy(() => backofficeAppLookupInputSchema._zod.innerType.extend({ actionsRevision: appActionsRevisionSchema.describe("The actionsRevision reviewed with apps.get; approval fails if the declaration changed since.") }));
|
|
73
|
+
/** Cursors remain bound to the owner even when each object has its own database. */
|
|
74
|
+
const backofficeAppInstallationPageInputSchema = z.lazy(() => z.strictObject({
|
|
75
|
+
pageSize: z.number().int().min(1).max(100),
|
|
76
|
+
cursor: z.string().min(1).nullable()
|
|
77
|
+
}));
|
|
78
|
+
/**
|
|
79
|
+
* Installation authority belongs to its owner, an organization or a person, not to the installing
|
|
80
|
+
* user: an organization's installation outlives the administrator who approved it.
|
|
81
|
+
*/
|
|
82
|
+
const backofficeAppInstallationSchema = z.lazy(() => z.strictObject({
|
|
83
|
+
id: z.string().min(1),
|
|
84
|
+
appId: z.string().min(1),
|
|
85
|
+
owner: backofficeRootOwnerSchema,
|
|
86
|
+
grantedPermissions: appPermissionsSchema,
|
|
87
|
+
resourceScope: appInstallationResourceScopeSchema,
|
|
88
|
+
/** Null until the app's server claims the installation for one of its own tenants. */
|
|
89
|
+
externalAccount: appInstallationExternalAccountSchema.nullable(),
|
|
90
|
+
installedByUserId: z.string().min(1),
|
|
91
|
+
status: z.enum(["active", "uninstalled"]),
|
|
92
|
+
/** Increments on reinstallation; app credentials are bound to the activation that issued them. */
|
|
93
|
+
activation: z.number().int().positive(),
|
|
94
|
+
approvedActionsRevision: z.number().int().nonnegative().describe("The app's actionsRevision this installation approved; 0 when it approved no declaration."),
|
|
95
|
+
createdAt: z.iso.datetime(),
|
|
96
|
+
updatedAt: z.iso.datetime()
|
|
97
|
+
})).meta({ id: "BackofficeAppInstallation" });
|
|
98
|
+
/** Reinstallation preserves the transaction-resolved installation identity. */
|
|
99
|
+
const backofficeAppInstallationMutationResultSchema = z.lazy(() => z.strictObject({
|
|
100
|
+
installationId: z.string().min(1),
|
|
101
|
+
changed: z.boolean()
|
|
102
|
+
})).meta({ id: "BackofficeAppInstallationMutationResult" });
|
|
103
|
+
/** An owner's installation history includes uninstalled records. */
|
|
104
|
+
const backofficeAppInstallationPageSchema = z.lazy(() => z.strictObject({
|
|
105
|
+
installations: z.array(backofficeAppInstallationSchema),
|
|
106
|
+
nextCursor: z.string().nullable(),
|
|
107
|
+
hasNextPage: z.boolean()
|
|
108
|
+
})).meta({ id: "BackofficeAppInstallationPage" });
|
|
109
|
+
/**
|
|
110
|
+
* App operations manage the installations of the scoped owner, an organization or the calling
|
|
111
|
+
* user's personal scope, as the calling user.
|
|
112
|
+
*/
|
|
113
|
+
const appsOperations = {
|
|
114
|
+
"apps.get": {
|
|
115
|
+
description: "Review a registered app's requested permissions and declared actions before approving an installation.",
|
|
116
|
+
permissions: [BACKOFFICE_PERMISSION.apps.read],
|
|
117
|
+
input: backofficeAppLookupInputSchema,
|
|
118
|
+
output: z.lazy(() => backofficeAppSchema.nullable())
|
|
119
|
+
},
|
|
120
|
+
"apps.install": {
|
|
121
|
+
description: "Approve an app installation in the selected organization or personal scope, limited to explicit permissions and resources, and approve the app's declared actions at the reviewed revision. Installer identity comes from the authenticated user.",
|
|
122
|
+
permissions: [BACKOFFICE_PERMISSION.apps.manage],
|
|
123
|
+
input: backofficeAppInstallInputSchema,
|
|
124
|
+
output: backofficeAppInstallationMutationResultSchema
|
|
125
|
+
},
|
|
126
|
+
"apps.installations.get": {
|
|
127
|
+
description: "Inspect one app installation in the selected organization or personal scope, including approved grants.",
|
|
128
|
+
permissions: [BACKOFFICE_PERMISSION.apps.read],
|
|
129
|
+
input: backofficeAppLookupInputSchema,
|
|
130
|
+
output: z.lazy(() => backofficeAppInstallationSchema.nullable())
|
|
131
|
+
},
|
|
132
|
+
"apps.installations.list": {
|
|
133
|
+
description: "List the selected organization's or personal scope's active and uninstalled apps using cursor pagination. Does not expose other owners or OAuth credentials.",
|
|
134
|
+
permissions: [BACKOFFICE_PERMISSION.apps.read],
|
|
135
|
+
input: z.lazy(() => backofficeAppInstallationPageInputSchema._zod.innerType.extend({
|
|
136
|
+
pageSize: backofficeAppInstallationPageInputSchema._zod.innerType.shape.pageSize.default(25),
|
|
137
|
+
cursor: backofficeAppInstallationPageInputSchema._zod.innerType.shape.cursor.default(null)
|
|
138
|
+
})),
|
|
139
|
+
output: backofficeAppInstallationPageSchema
|
|
140
|
+
},
|
|
141
|
+
"apps.installations.update": {
|
|
142
|
+
description: "Replace an active installation's approved permissions and resources. Takes effect immediately, including for issued app credentials. Does not change installer attribution.",
|
|
143
|
+
permissions: [BACKOFFICE_PERMISSION.apps.manage],
|
|
144
|
+
input: backofficeAppInstallationAccessInputSchema,
|
|
145
|
+
output: backofficeAppInstallationMutationResultSchema
|
|
146
|
+
},
|
|
147
|
+
"apps.installations.approveActions": {
|
|
148
|
+
description: "Approve an app's current action declaration for the selected owner's installation, so its new and changed actions run. Only needed when the app's changeApproval is installation.",
|
|
149
|
+
permissions: [BACKOFFICE_PERMISSION.apps.manage],
|
|
150
|
+
input: backofficeAppInstallationActionsApprovalInputSchema,
|
|
151
|
+
output: backofficeAppInstallationMutationResultSchema
|
|
152
|
+
},
|
|
153
|
+
"apps.uninstall": {
|
|
154
|
+
description: "Uninstall an app in the selected organization or personal scope, clearing approved grants and its linked account while retaining installation identity. Immediately invalidates app credentials. Does not revoke personal OAuth consent.",
|
|
155
|
+
permissions: [BACKOFFICE_PERMISSION.apps.manage],
|
|
156
|
+
input: backofficeAppLookupInputSchema,
|
|
157
|
+
output: backofficeAppInstallationMutationResultSchema
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
//#endregion
|
|
161
|
+
export { appActionSchema, appActionsDeclarationSchema, appInstallationAccessSchema, appInstallationExternalAccountSchema, appPermissionsSchema, appSlugSchema, appsOperations, backofficeAppInstallInputSchema, backofficeAppInstallationAccessInputSchema, backofficeAppInstallationActionsApprovalInputSchema, backofficeAppInstallationMutationResultSchema, backofficeAppInstallationPageInputSchema, backofficeAppInstallationPageSchema, backofficeAppInstallationSchema, backofficeAppLookupInputSchema, backofficeAppSchema };
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=apps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps.js","names":[],"sources":["../../src/v0/apps.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { BackofficeApiOperation } from \"../api\";\nimport { BACKOFFICE_PERMISSION } from \"./shared/permissions\";\nimport { backofficePermissionRequirementSchema } from \"./shared/permissions\";\nimport { backofficeRootOwnerSchema } from \"./shared/scope\";\n\n/** App permission declarations and grants are sets; duplicate entries are malformed input. */\nexport const appPermissionsSchema = z.lazy(() =>\n z\n .array(backofficePermissionRequirementSchema)\n .refine(\n (permissions) =>\n new Set(permissions.map(({ namespace, permission }) => `${namespace}.${permission}`))\n .size === permissions.length,\n \"Backoffice app permissions must not contain duplicates.\",\n ),\n);\n\n/** App identity is global; an installation refers to the same registry ID. */\nexport const backofficeAppLookupInputSchema = z.lazy(() =>\n z.strictObject({ appId: z.string().min(1).max(191) }),\n);\nexport type BackofficeAppLookupInput = z.infer<typeof backofficeAppLookupInputSchema>;\n\n/** Addresses outlive the registration's other fields, so a slug never changes once chosen. */\nexport const appSlugSchema = z.lazy(() =>\n z\n .string()\n .max(63)\n .regex(\n /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,\n \"App slugs are lowercase words separated by '-', e.g. bookkeeping.\",\n )\n .describe(\n \"Unique, permanent name for the app; its integration connection is app#<slug>, e.g. app#bookkeeping.\",\n ),\n);\n\nconst LOOPBACK_HOSTNAMES = new Set([\"127.0.0.1\", \"localhost\", \"[::1]\"]);\n\n/** One operation an app serves on its own server, called through the app's integration connection. */\nexport const appActionSchema = z\n .lazy(() =>\n z.strictObject({\n id: z\n .string()\n .max(100)\n .regex(\n /^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/,\n \"App action IDs are lowercase words separated by '.', '-', or '_', e.g. invoices.list.\",\n ),\n label: z.string().trim().min(1).max(100),\n description: z.string().trim().min(1).max(1000),\n inputSchema: z\n .record(z.string(), z.unknown())\n .describe(\"JSON Schema (2020-12 or draft-07) for the action's object input.\"),\n outputSchema: z\n .record(z.string(), z.unknown())\n .describe(\"JSON Schema (2020-12 or draft-07) for the action's result.\"),\n }),\n )\n .meta({ id: \"AppAction\" });\nexport type AppAction = z.infer<typeof appActionSchema>;\n\n/**\n * What an app lets Backoffice call. Each installation approves one revision of it; with\n * `changeApproval: \"automatic\"`, later revisions apply to every installation without approval.\n */\nexport const appActionsDeclarationSchema = z\n .lazy(() =>\n z.discriminatedUnion(\"kind\", [\n z.strictObject({ kind: z.literal(\"none\") }),\n z.strictObject({\n kind: z.literal(\"endpoint\"),\n endpointUrl: z\n .url({ protocol: /^https?$/ })\n .refine(\n (url) => url.startsWith(\"https:\") || LOOPBACK_HOSTNAMES.has(new URL(url).hostname),\n \"App action endpoints use HTTPS; plain HTTP is allowed only on loopback for development.\",\n )\n .describe(\n \"Receives each signed action request as a POST; the request token's audience is this URL.\",\n ),\n changeApproval: z\n .enum([\"installation\", \"automatic\"])\n .describe(\n \"installation: each installation approves a changed declaration before new or changed actions run. automatic: changes apply immediately; only administrators register apps, so reserve it for apps they operate.\",\n ),\n actions: z\n .array(appActionSchema)\n .min(1)\n .max(100)\n .refine(\n (actions) => new Set(actions.map(({ id }) => id)).size === actions.length,\n \"App action IDs must be unique.\",\n ),\n }),\n ]),\n )\n .meta({ id: \"AppActionsDeclaration\" });\nexport type AppActionsDeclaration = z.infer<typeof appActionsDeclarationSchema>;\n\nconst appActionsRevisionSchema = z.lazy(() =>\n z.number().int().positive().describe(\"Increments whenever the app's action declaration changes.\"),\n);\n\n/** Backoffice-specific registration data; OAuth metadata remains authoritative in Auth. */\nexport const backofficeAppSchema = z\n .lazy(() =>\n z.strictObject({\n id: z.string().min(1),\n slug: appSlugSchema,\n oauthClientId: z.string().min(1),\n requestedPermissions: appPermissionsSchema,\n actions: appActionsDeclarationSchema,\n actionsRevision: appActionsRevisionSchema,\n createdAt: z.iso.datetime(),\n }),\n )\n .meta({ id: \"BackofficeApp\" });\nexport type BackofficeApp = z.infer<typeof backofficeAppSchema>;\n\n/**\n * The owner's resources an installation may act on: everything the owner has, or some of the\n * projects it owns. Project lists are sets; they are normalized so equal selections compare equal\n * regardless of order.\n */\nconst appInstallationResourceScopeSchema = z\n .lazy(() =>\n z.discriminatedUnion(\"kind\", [\n z.strictObject({ kind: z.literal(\"owner\") }),\n z.strictObject({\n kind: z.literal(\"projects\"),\n // Piping into an array schema keeps the normalized form describable as JSON Schema.\n projectIds: z\n .array(z.string().trim().min(1).max(191))\n .min(1)\n .max(100)\n .transform((projectIds) => [...new Set(projectIds)].sort())\n .pipe(z.array(z.string())),\n }),\n ]),\n )\n .meta({ id: \"AppInstallationResourceScope\" });\nexport type AppInstallationResourceScope = z.infer<typeof appInstallationResourceScopeSchema>;\n\n/** What an owner approves: permissions, and the resources they apply to. */\nexport const appInstallationAccessSchema = z.lazy(() =>\n z.strictObject({\n grantedPermissions: appPermissionsSchema,\n resourceScope: appInstallationResourceScopeSchema,\n }),\n);\n\n/** An app-side tenant, such as a Bookkeeping organization, claimed by the app's server. */\nexport const appInstallationExternalAccountSchema = z.lazy(() =>\n z.strictObject({\n id: z.string().trim().min(1).max(191),\n label: z.string().trim().min(1).max(191),\n }),\n);\nexport type AppInstallationExternalAccount = z.infer<typeof appInstallationExternalAccountSchema>;\n\n/** Access changes are explicit control-plane operations and cannot change the owner. */\nexport const backofficeAppInstallationAccessInputSchema = z.lazy(() =>\n backofficeAppLookupInputSchema._zod.innerType.extend(\n appInstallationAccessSchema._zod.innerType.shape,\n ),\n);\nexport type BackofficeAppInstallationAccessInput = z.infer<\n typeof backofficeAppInstallationAccessInputSchema\n>;\n\n/** Installing approves access and, at the reviewed revision, the app's declared actions. */\nexport const backofficeAppInstallInputSchema = z.lazy(() =>\n backofficeAppInstallationAccessInputSchema._zod.innerType.extend({\n resourceScope: appInstallationResourceScopeSchema.default({ kind: \"owner\" }),\n actionsRevision: appActionsRevisionSchema.describe(\n \"The actionsRevision reviewed with apps.get; installation fails if the declaration changed since.\",\n ),\n }),\n);\nexport type BackofficeAppInstallInput = z.output<typeof backofficeAppInstallInputSchema>;\n\n/** Approval names the reviewed revision, so a declaration changed since review is never approved. */\nexport const backofficeAppInstallationActionsApprovalInputSchema = z.lazy(() =>\n backofficeAppLookupInputSchema._zod.innerType.extend({\n actionsRevision: appActionsRevisionSchema.describe(\n \"The actionsRevision reviewed with apps.get; approval fails if the declaration changed since.\",\n ),\n }),\n);\nexport type BackofficeAppInstallationActionsApprovalInput = z.infer<\n typeof backofficeAppInstallationActionsApprovalInputSchema\n>;\n\n/** Cursors remain bound to the owner even when each object has its own database. */\nexport const backofficeAppInstallationPageInputSchema = z.lazy(() =>\n z.strictObject({\n pageSize: z.number().int().min(1).max(100),\n cursor: z.string().min(1).nullable(),\n }),\n);\nexport type BackofficeAppInstallationPageInput = z.infer<\n typeof backofficeAppInstallationPageInputSchema\n>;\n\n/**\n * Installation authority belongs to its owner, an organization or a person, not to the installing\n * user: an organization's installation outlives the administrator who approved it.\n */\nexport const backofficeAppInstallationSchema = z\n .lazy(() =>\n z.strictObject({\n id: z.string().min(1),\n appId: z.string().min(1),\n owner: backofficeRootOwnerSchema,\n grantedPermissions: appPermissionsSchema,\n resourceScope: appInstallationResourceScopeSchema,\n /** Null until the app's server claims the installation for one of its own tenants. */\n externalAccount: appInstallationExternalAccountSchema.nullable(),\n installedByUserId: z.string().min(1),\n status: z.enum([\"active\", \"uninstalled\"]),\n /** Increments on reinstallation; app credentials are bound to the activation that issued them. */\n activation: z.number().int().positive(),\n approvedActionsRevision: z\n .number()\n .int()\n .nonnegative()\n .describe(\n \"The app's actionsRevision this installation approved; 0 when it approved no declaration.\",\n ),\n createdAt: z.iso.datetime(),\n updatedAt: z.iso.datetime(),\n }),\n )\n .meta({ id: \"BackofficeAppInstallation\" });\nexport type BackofficeAppInstallation = z.infer<typeof backofficeAppInstallationSchema>;\n\n/** Reinstallation preserves the transaction-resolved installation identity. */\nexport const backofficeAppInstallationMutationResultSchema = z\n .lazy(() =>\n z.strictObject({\n installationId: z.string().min(1),\n changed: z.boolean(),\n }),\n )\n .meta({ id: \"BackofficeAppInstallationMutationResult\" });\nexport type BackofficeAppInstallationMutationResult = z.infer<\n typeof backofficeAppInstallationMutationResultSchema\n>;\n\n/** An owner's installation history includes uninstalled records. */\nexport const backofficeAppInstallationPageSchema = z\n .lazy(() =>\n z.strictObject({\n installations: z.array(backofficeAppInstallationSchema),\n nextCursor: z.string().nullable(),\n hasNextPage: z.boolean(),\n }),\n )\n .meta({ id: \"BackofficeAppInstallationPage\" });\nexport type BackofficeAppInstallationPage = z.infer<typeof backofficeAppInstallationPageSchema>;\n\n/**\n * App operations manage the installations of the scoped owner, an organization or the calling\n * user's personal scope, as the calling user.\n */\nexport const appsOperations = {\n \"apps.get\": {\n description:\n \"Review a registered app's requested permissions and declared actions before approving an installation.\",\n permissions: [BACKOFFICE_PERMISSION.apps.read],\n input: backofficeAppLookupInputSchema,\n output: z.lazy(() => backofficeAppSchema.nullable()),\n },\n \"apps.install\": {\n description:\n \"Approve an app installation in the selected organization or personal scope, limited to explicit permissions and resources, and approve the app's declared actions at the reviewed revision. Installer identity comes from the authenticated user.\",\n permissions: [BACKOFFICE_PERMISSION.apps.manage],\n input: backofficeAppInstallInputSchema,\n output: backofficeAppInstallationMutationResultSchema,\n },\n \"apps.installations.get\": {\n description:\n \"Inspect one app installation in the selected organization or personal scope, including approved grants.\",\n permissions: [BACKOFFICE_PERMISSION.apps.read],\n input: backofficeAppLookupInputSchema,\n output: z.lazy(() => backofficeAppInstallationSchema.nullable()),\n },\n \"apps.installations.list\": {\n description:\n \"List the selected organization's or personal scope's active and uninstalled apps using cursor pagination. Does not expose other owners or OAuth credentials.\",\n permissions: [BACKOFFICE_PERMISSION.apps.read],\n input: z.lazy(() =>\n backofficeAppInstallationPageInputSchema._zod.innerType.extend({\n pageSize:\n backofficeAppInstallationPageInputSchema._zod.innerType.shape.pageSize.default(25),\n cursor: backofficeAppInstallationPageInputSchema._zod.innerType.shape.cursor.default(null),\n }),\n ),\n output: backofficeAppInstallationPageSchema,\n },\n \"apps.installations.update\": {\n description:\n \"Replace an active installation's approved permissions and resources. Takes effect immediately, including for issued app credentials. Does not change installer attribution.\",\n permissions: [BACKOFFICE_PERMISSION.apps.manage],\n input: backofficeAppInstallationAccessInputSchema,\n output: backofficeAppInstallationMutationResultSchema,\n },\n \"apps.installations.approveActions\": {\n description:\n \"Approve an app's current action declaration for the selected owner's installation, so its new and changed actions run. Only needed when the app's changeApproval is installation.\",\n permissions: [BACKOFFICE_PERMISSION.apps.manage],\n input: backofficeAppInstallationActionsApprovalInputSchema,\n output: backofficeAppInstallationMutationResultSchema,\n },\n \"apps.uninstall\": {\n description:\n \"Uninstall an app in the selected organization or personal scope, clearing approved grants and its linked account while retaining installation identity. Immediately invalidates app credentials. Does not revoke personal OAuth consent.\",\n permissions: [BACKOFFICE_PERMISSION.apps.manage],\n input: backofficeAppLookupInputSchema,\n output: backofficeAppInstallationMutationResultSchema,\n },\n} satisfies Record<string, BackofficeApiOperation>;\n"],"mappings":";;;;;AAQA,MAAa,uBAAuB,EAAE,WACpC,EACG,MAAM,qCAAqC,CAAC,CAC5C,QACE,gBACC,IAAI,IAAI,YAAY,KAAK,EAAE,WAAW,iBAAiB,GAAG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