@stardeck-customer-apps/controls 0.4.0 → 0.5.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/SKILL.md +21 -0
- package/dist/index.cjs +10 -1
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +10 -1
- package/dist/server/index.cjs +10 -1
- package/dist/server/index.d.cts +11 -0
- package/dist/server/index.d.ts +11 -0
- package/dist/server/index.js +10 -1
- package/package.json +1 -1
package/SKILL.md
CHANGED
|
@@ -55,6 +55,7 @@ the last values stay.
|
|
|
55
55
|
| `payments.provider` | `"beam" \| "stripe" \| null` | yes |
|
|
56
56
|
| `payments.methods` | `{ card: boolean, promptPay: boolean }` | yes |
|
|
57
57
|
| `business.profile` | `BusinessProfile \| null` (see "Business details") | yes |
|
|
58
|
+
| `business.logo` | `{ url: string } \| null` (see "Business logo") | no |
|
|
58
59
|
|
|
59
60
|
- `plan.locations.included` is what the plan covers. `max` is a hard cap (the
|
|
60
61
|
entry plan has 1); `null` means no cap, and each location past `included` is
|
|
@@ -68,6 +69,8 @@ the last values stay.
|
|
|
68
69
|
- `business.profile` is the business the app is for, as Stardeck keeps it for
|
|
69
70
|
the organization. `null` means Stardeck has no record yet. See "Business
|
|
70
71
|
details" below.
|
|
72
|
+
- `business.logo` is the organization's logo (controls 0.5.0 or later). `null`
|
|
73
|
+
means it has none. See "Business logo" below.
|
|
71
74
|
- Keys are never removed in later versions, so code written against today's list
|
|
72
75
|
keeps working.
|
|
73
76
|
|
|
@@ -168,6 +171,24 @@ if (!parsed.success) return badRequest(parsed.error.issues[0]?.message);
|
|
|
168
171
|
const result = await setControl("business.profile", parsed.data, { userToken });
|
|
169
172
|
```
|
|
170
173
|
|
|
174
|
+
## Business logo
|
|
175
|
+
|
|
176
|
+
The organization's logo is the icon it set on Stardeck (onboarding asks for
|
|
177
|
+
one). It is the default logo for every app in the organization (needs controls
|
|
178
|
+
0.5.0 or later). Show it wherever the app shows a logo and has none of its own:
|
|
179
|
+
the site header, the admin shell, emails, receipts. When the owner uploads a
|
|
180
|
+
logo in the app, that one wins for this app; never copy the organization's logo
|
|
181
|
+
into the app's own setting, or a later change on Stardeck won't reach it.
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
const orgLogo = await getControl("business.logo");
|
|
185
|
+
// ok: false is "unknown right now": show the app's own logo, or none, and never fail.
|
|
186
|
+
const logoUrl = appLogoUrl ?? (orgLogo.ok ? (orgLogo.value?.url ?? null) : null);
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
The URL is an https image Stardeck's sign-in provider hosts. It is read-only:
|
|
190
|
+
`setControl("business.logo", …)` is refused with `NOT_WRITABLE`.
|
|
191
|
+
|
|
171
192
|
Types and the list itself are in the root export:
|
|
172
193
|
|
|
173
194
|
```ts
|
package/dist/index.cjs
CHANGED
|
@@ -102,7 +102,16 @@ var CONTROLS = {
|
|
|
102
102
|
* app that already has its own company details sends them up once. `{ ok: false }` means
|
|
103
103
|
* unknown right now: keep the company the app has.
|
|
104
104
|
*/
|
|
105
|
-
"business.profile": { schema: businessProfileSchema.nullable(), appWrite: true }
|
|
105
|
+
"business.profile": { schema: businessProfileSchema.nullable(), appWrite: true },
|
|
106
|
+
/**
|
|
107
|
+
* The org's logo: the icon it set in Stardeck (onboarding asks for one). The app shows it
|
|
108
|
+
* wherever it has no logo of its own, and an owner's own upload always wins. null means the
|
|
109
|
+
* org has no logo. Read-only: the app changes its own logo, never the org's.
|
|
110
|
+
*/
|
|
111
|
+
"business.logo": {
|
|
112
|
+
schema: import_zod.z.object({ url: import_zod.z.string().url().startsWith("https://", "the logo is served over https") }).nullable(),
|
|
113
|
+
appWrite: false
|
|
114
|
+
}
|
|
106
115
|
};
|
|
107
116
|
var CONTROL_KEYS = Object.keys(CONTROLS);
|
|
108
117
|
function isControlKey(key) {
|
package/dist/index.d.cts
CHANGED
|
@@ -104,6 +104,17 @@ declare const CONTROLS: {
|
|
|
104
104
|
}, z.core.$strip>>;
|
|
105
105
|
readonly appWrite: true;
|
|
106
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* The org's logo: the icon it set in Stardeck (onboarding asks for one). The app shows it
|
|
109
|
+
* wherever it has no logo of its own, and an owner's own upload always wins. null means the
|
|
110
|
+
* org has no logo. Read-only: the app changes its own logo, never the org's.
|
|
111
|
+
*/
|
|
112
|
+
readonly "business.logo": {
|
|
113
|
+
readonly schema: z.ZodNullable<z.ZodObject<{
|
|
114
|
+
url: z.ZodString;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
readonly appWrite: false;
|
|
117
|
+
};
|
|
107
118
|
};
|
|
108
119
|
type ControlKey = keyof typeof CONTROLS;
|
|
109
120
|
type ControlValue<K extends ControlKey> = z.infer<(typeof CONTROLS)[K]["schema"]>;
|
package/dist/index.d.ts
CHANGED
|
@@ -104,6 +104,17 @@ declare const CONTROLS: {
|
|
|
104
104
|
}, z.core.$strip>>;
|
|
105
105
|
readonly appWrite: true;
|
|
106
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* The org's logo: the icon it set in Stardeck (onboarding asks for one). The app shows it
|
|
109
|
+
* wherever it has no logo of its own, and an owner's own upload always wins. null means the
|
|
110
|
+
* org has no logo. Read-only: the app changes its own logo, never the org's.
|
|
111
|
+
*/
|
|
112
|
+
readonly "business.logo": {
|
|
113
|
+
readonly schema: z.ZodNullable<z.ZodObject<{
|
|
114
|
+
url: z.ZodString;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
readonly appWrite: false;
|
|
117
|
+
};
|
|
107
118
|
};
|
|
108
119
|
type ControlKey = keyof typeof CONTROLS;
|
|
109
120
|
type ControlValue<K extends ControlKey> = z.infer<(typeof CONTROLS)[K]["schema"]>;
|
package/dist/index.js
CHANGED
|
@@ -70,7 +70,16 @@ var CONTROLS = {
|
|
|
70
70
|
* app that already has its own company details sends them up once. `{ ok: false }` means
|
|
71
71
|
* unknown right now: keep the company the app has.
|
|
72
72
|
*/
|
|
73
|
-
"business.profile": { schema: businessProfileSchema.nullable(), appWrite: true }
|
|
73
|
+
"business.profile": { schema: businessProfileSchema.nullable(), appWrite: true },
|
|
74
|
+
/**
|
|
75
|
+
* The org's logo: the icon it set in Stardeck (onboarding asks for one). The app shows it
|
|
76
|
+
* wherever it has no logo of its own, and an owner's own upload always wins. null means the
|
|
77
|
+
* org has no logo. Read-only: the app changes its own logo, never the org's.
|
|
78
|
+
*/
|
|
79
|
+
"business.logo": {
|
|
80
|
+
schema: z.object({ url: z.string().url().startsWith("https://", "the logo is served over https") }).nullable(),
|
|
81
|
+
appWrite: false
|
|
82
|
+
}
|
|
74
83
|
};
|
|
75
84
|
var CONTROL_KEYS = Object.keys(CONTROLS);
|
|
76
85
|
function isControlKey(key) {
|
package/dist/server/index.cjs
CHANGED
|
@@ -102,7 +102,16 @@ var CONTROLS = {
|
|
|
102
102
|
* app that already has its own company details sends them up once. `{ ok: false }` means
|
|
103
103
|
* unknown right now: keep the company the app has.
|
|
104
104
|
*/
|
|
105
|
-
"business.profile": { schema: businessProfileSchema.nullable(), appWrite: true }
|
|
105
|
+
"business.profile": { schema: businessProfileSchema.nullable(), appWrite: true },
|
|
106
|
+
/**
|
|
107
|
+
* The org's logo: the icon it set in Stardeck (onboarding asks for one). The app shows it
|
|
108
|
+
* wherever it has no logo of its own, and an owner's own upload always wins. null means the
|
|
109
|
+
* org has no logo. Read-only: the app changes its own logo, never the org's.
|
|
110
|
+
*/
|
|
111
|
+
"business.logo": {
|
|
112
|
+
schema: import_zod.z.object({ url: import_zod.z.string().url().startsWith("https://", "the logo is served over https") }).nullable(),
|
|
113
|
+
appWrite: false
|
|
114
|
+
}
|
|
106
115
|
};
|
|
107
116
|
var CONTROL_KEYS = Object.keys(CONTROLS);
|
|
108
117
|
function parseOne(entry, schema) {
|
package/dist/server/index.d.cts
CHANGED
|
@@ -86,6 +86,17 @@ declare const CONTROLS: {
|
|
|
86
86
|
}, z.core.$strip>>;
|
|
87
87
|
readonly appWrite: true;
|
|
88
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* The org's logo: the icon it set in Stardeck (onboarding asks for one). The app shows it
|
|
91
|
+
* wherever it has no logo of its own, and an owner's own upload always wins. null means the
|
|
92
|
+
* org has no logo. Read-only: the app changes its own logo, never the org's.
|
|
93
|
+
*/
|
|
94
|
+
readonly "business.logo": {
|
|
95
|
+
readonly schema: z.ZodNullable<z.ZodObject<{
|
|
96
|
+
url: z.ZodString;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
readonly appWrite: false;
|
|
99
|
+
};
|
|
89
100
|
};
|
|
90
101
|
type ControlKey = keyof typeof CONTROLS;
|
|
91
102
|
type ControlValue<K extends ControlKey> = z.infer<(typeof CONTROLS)[K]["schema"]>;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -86,6 +86,17 @@ declare const CONTROLS: {
|
|
|
86
86
|
}, z.core.$strip>>;
|
|
87
87
|
readonly appWrite: true;
|
|
88
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* The org's logo: the icon it set in Stardeck (onboarding asks for one). The app shows it
|
|
91
|
+
* wherever it has no logo of its own, and an owner's own upload always wins. null means the
|
|
92
|
+
* org has no logo. Read-only: the app changes its own logo, never the org's.
|
|
93
|
+
*/
|
|
94
|
+
readonly "business.logo": {
|
|
95
|
+
readonly schema: z.ZodNullable<z.ZodObject<{
|
|
96
|
+
url: z.ZodString;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
readonly appWrite: false;
|
|
99
|
+
};
|
|
89
100
|
};
|
|
90
101
|
type ControlKey = keyof typeof CONTROLS;
|
|
91
102
|
type ControlValue<K extends ControlKey> = z.infer<(typeof CONTROLS)[K]["schema"]>;
|
package/dist/server/index.js
CHANGED
|
@@ -70,7 +70,16 @@ var CONTROLS = {
|
|
|
70
70
|
* app that already has its own company details sends them up once. `{ ok: false }` means
|
|
71
71
|
* unknown right now: keep the company the app has.
|
|
72
72
|
*/
|
|
73
|
-
"business.profile": { schema: businessProfileSchema.nullable(), appWrite: true }
|
|
73
|
+
"business.profile": { schema: businessProfileSchema.nullable(), appWrite: true },
|
|
74
|
+
/**
|
|
75
|
+
* The org's logo: the icon it set in Stardeck (onboarding asks for one). The app shows it
|
|
76
|
+
* wherever it has no logo of its own, and an owner's own upload always wins. null means the
|
|
77
|
+
* org has no logo. Read-only: the app changes its own logo, never the org's.
|
|
78
|
+
*/
|
|
79
|
+
"business.logo": {
|
|
80
|
+
schema: z.object({ url: z.string().url().startsWith("https://", "the logo is served over https") }).nullable(),
|
|
81
|
+
appWrite: false
|
|
82
|
+
}
|
|
74
83
|
};
|
|
75
84
|
var CONTROL_KEYS = Object.keys(CONTROLS);
|
|
76
85
|
function parseOne(entry, schema) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stardeck-customer-apps/controls",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"description": "Platform-owned app controls (feature flags, plan limits, POS Pro hardware, the Accounting edition, payment provider and methods) for Stardeck customer apps: a typed list plus a cached, signed sync client",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.js",
|