@cimplify/cli 0.7.4 → 0.7.5
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/dist/{add-4PBCFGM3.mjs → add-JHVJ5RGL.mjs} +1 -1
- package/dist/{chunk-NTY7JESF.mjs → chunk-6CIWEADS.mjs} +2 -2
- package/dist/{chunk-LRTPNNQG.mjs → chunk-HGFCYWS2.mjs} +1 -1
- package/dist/{chunk-QOPMMTVI.mjs → chunk-NOMGIGNO.mjs} +9 -9
- package/dist/dispatcher.mjs +9 -9
- package/dist/{doctor-ZVYWEE53.mjs → doctor-YC7H2JXR.mjs} +2 -2
- package/dist/{explain-S6S33HPN.mjs → explain-YRRYXXE2.mjs} +2 -2
- package/dist/{introspect-FFB7TA2E.mjs → introspect-2HEJ7EGB.mjs} +2 -2
- package/dist/{list-RLWFTEP4.mjs → list-FCWEQPDR.mjs} +1 -1
- package/dist/{update-WH6NDWIM.mjs → update-GVWXFVB3.mjs} +1 -1
- package/package.json +2 -2
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/components/signed-out-prompt.tsx +32 -0
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/package.json +1 -1
- package/templates/storefront-services/package.json +1 -1
package/dist/dispatcher.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { TEMPLATES } from './chunk-
|
|
3
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { TEMPLATES } from './chunk-NOMGIGNO.mjs';
|
|
3
|
+
import { package_default } from './chunk-6CIWEADS.mjs';
|
|
4
4
|
|
|
5
5
|
// src/dispatcher.ts
|
|
6
6
|
var VERSION = package_default.version ?? "unknown";
|
|
@@ -138,16 +138,16 @@ var COMMANDS = {
|
|
|
138
138
|
logs: () => import('./logs-YNN2PQ24.mjs'),
|
|
139
139
|
status: () => import('./status-JSYXM5RT.mjs'),
|
|
140
140
|
dev: () => import('./dev-ONW2S77K.mjs'),
|
|
141
|
-
introspect: () => import('./introspect-
|
|
141
|
+
introspect: () => import('./introspect-2HEJ7EGB.mjs'),
|
|
142
142
|
inspect: () => import('./inspect-CGYX4DDF.mjs'),
|
|
143
|
-
doctor: () => import('./doctor-
|
|
144
|
-
explain: () => import('./explain-
|
|
143
|
+
doctor: () => import('./doctor-YC7H2JXR.mjs'),
|
|
144
|
+
explain: () => import('./explain-YRRYXXE2.mjs'),
|
|
145
145
|
assets: () => import('./assets-74SK63TR.mjs'),
|
|
146
146
|
repo: () => import('./repo-KNQMSPVV.mjs'),
|
|
147
|
-
list: () => import('./list-
|
|
148
|
-
add: () => import('./add-
|
|
149
|
-
update: () => import('./update-
|
|
150
|
-
upgrade: () => import('./update-
|
|
147
|
+
list: () => import('./list-FCWEQPDR.mjs'),
|
|
148
|
+
add: () => import('./add-JHVJ5RGL.mjs'),
|
|
149
|
+
update: () => import('./update-GVWXFVB3.mjs'),
|
|
150
|
+
upgrade: () => import('./update-GVWXFVB3.mjs'),
|
|
151
151
|
"auth-step-up": () => import('./auth-step-up-BIUYQJP6.mjs')
|
|
152
152
|
};
|
|
153
153
|
var COMMAND_PREFIXES = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { gatherIntrospection } from './chunk-
|
|
2
|
+
import { gatherIntrospection } from './chunk-HGFCYWS2.mjs';
|
|
3
3
|
import './chunk-K5464A3L.mjs';
|
|
4
4
|
import './chunk-DBZ3UOQ2.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-6CIWEADS.mjs';
|
|
6
6
|
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
7
7
|
import { ApiClient } from './chunk-MAOO6ZZ5.mjs';
|
|
8
8
|
import { readAuthOrNull } from './chunk-UBAI443T.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-6CIWEADS.mjs';
|
|
3
3
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
4
4
|
import { bold, dim, info, result, CliError, CLI_ERROR_CODE } from './chunk-E2T2SBP5.mjs';
|
|
5
5
|
|
|
@@ -87,7 +87,7 @@ var TOPICS = [
|
|
|
87
87
|
"title": "Orders",
|
|
88
88
|
"description": "Order shape and status flow",
|
|
89
89
|
"source_url": "https://cimplify.dev/docs/sdk/orders",
|
|
90
|
-
"body": "## List orders\n\n \n \n\n```ts\nconst r = await client.orders.list({ limit: 20 })\nif (!r.ok) {\n console.error(r.error.code, r.error.message)\n return\n}\n\nconsole.log(r.value.length)\nfor (const order of r.value) {\n console.log(order.id, order.order_number, order.status)\n}\n```\n\n \n\n \n\n## Filter by status\n\n \n \n\n```ts\nconst pending = await client.orders.list({ status: 'pending' })\nconst completed = await client.orders.list({ status: 'completed', limit: 50 })\n\n// Convenience wrappers\nconst recent = await client.orders.getRecent(5) // last 5\nconst cancelled = await client.orders.getByStatus('cancelled')\n```\n\n \n\n \n\n## Get a single order\n\n \n\nFor guest orders the SDK appends the cached `bill_token` automatically; the lookup works in the same browser session that placed the order, with no auth.\n\n \n \n\n```ts\n\nconst r = await client.orders.get('ord_xxx')\nif (!r.ok) return\n\nconst order = r.value\nconsole.log(order.status)\nconsole.log(order.items.length)\nconsole.log(order.total_price) // Money string\nconsole.log(formatPrice(parsePrice(order.total_price), order.currency))\n```\n\n \n\n \n\n## Cancel an order\n\n \n \n\n```ts\nconst cancelled = await client.orders.cancel('ord_xxx', 'changed_mind')\nif (!cancelled.ok) {\n // Codes you'll see: ORDER_NOT_CANCELLABLE, ORDER_ALREADY_FULFILLED\n console.error(cancelled.error.code, cancelled.error.message)\n}\n\n// Idempotent retry: same key, same outcome on the server\nawait client.orders.cancel('ord_xxx', 'changed_mind', {\n idempotencyKey: 'cancel-ord_xxx-once',\n})\n```\n\n \n\n \n\n## Order status values\n\n \n \n\n| Status | Meaning |\n| --- | --- |\n| `pending` | Created, awaiting payment confirmation |\n| `confirmed` | Accepted by the business |\n| `preparing` | Being assembled or fulfilled |\n| `ready` | Ready for pickup or delivery dispatch |\n| `completed` | Fulfilled; terminal state |\n| `cancelled` | Cancelled; terminal state |\n| `refunded` | Payment refunded |\n\n \n\n \n\n## Poll until terminal\n\n \n \n\n```ts\nasync function pollUntilTerminal(orderId: string, intervalMs = 5000) {\n for (;;) {\n const r = await client.orders.get(orderId)\n if (!r.ok) return r\n\n const status = r.value.status\n if (status === 'completed' || status === 'cancelled' || status === 'refunded') {\n return r\n }\n\n await new Promise((resolve) => setTimeout(resolve, intervalMs))\n }\n}\n```\n\n \n\n \n\n## Method reference\n\n \n \n\n| Method | Returns |\n| --- | --- |\n| `list({ status?, limit?, offset? })` | `Result<Order[]>` |\n| `get(orderId)` | `Result<Order>` |\n| `cancel(orderId, reason?, opts?)` | `Result<Order>` |\n| `getRecent(limit?)` | `Result<Order[]>` |\n| `getByStatus(status)` | `Result<Order[]>` |\n\n \n\n \n\n## Related\n\n \n \n- [**Checkout**](/docs/sdk/checkout)\n Create the orders that this page lists\n\n \n- [**Subscriptions**](/docs/sdk/subscriptions)\n For recurring orders, see the subscription surface\n\n \n- [**Scheduling**](/docs/sdk/scheduling)\n Reschedule or cancel a booking line item\n\n \n- [**Error handling**](/docs/sdk/errors)\n Cancellation guards and retryable errors\n"
|
|
90
|
+
"body": "`client.orders.list()` returns different results depending on how the\nclient was constructed:\n\n- **Guest client** (`getServerClient()` with no `accessToken`, or the\n browser `cimplify` client with no signed-in shopper): returns nothing\n by default \u2014 the API has no customer to scope to. `client.orders.get()`\n still works on the same browser session that placed the order via the\n cached `bill_token`.\n- **Authenticated client** (`getAuthenticatedServerClient()` from the\n templates, or `getServerClient({ accessToken })` from a custom integration):\n returns *that customer's* orders at *this merchant*.\n\nSee [Sign in with Cimplify \u2192 Personalized server-side reads](/docs/sdk/auth#personalized-server-side-reads)\nfor the full setup.\n\n## Render orders for the signed-in shopper\n\n```tsx title=\"app/account/orders/page.tsx\"\n\nexport const revalidate = 0; // personalized; do not ISR-cache\n\nexport default async function OrdersPage() {\n const client = await getAuthenticatedServerClient();\n const r = await client.orders.list({ limit: 20 });\n if (!r.ok) throw new Error(r.error.message);\n\n if (r.value.length === 0) {\n return <p>No orders yet.</p>;\n }\n return (\n <ul>\n {r.value.map((o) => (\n <li key={o.id}>#{o.order_number} \u2014 {o.status} \u2014 {o.total_price}</li>\n ))}\n </ul>\n );\n}\n```\n\nIf `cimplify_access` is missing (signed-out shopper), `client.orders.list()`\nreturns the empty guest view. Branch on `getSession()` from `lib/auth.ts`\nif you want to redirect to sign-in instead.\n\n## List orders\n\n \n \n\n```ts\nconst r = await client.orders.list({ limit: 20 })\nif (!r.ok) {\n console.error(r.error.code, r.error.message)\n return\n}\n\nconsole.log(r.value.length)\nfor (const order of r.value) {\n console.log(order.id, order.order_number, order.status)\n}\n```\n\n \n\n \n\n## Filter by status\n\n \n \n\n```ts\nconst pending = await client.orders.list({ status: 'pending' })\nconst completed = await client.orders.list({ status: 'completed', limit: 50 })\n\n// Convenience wrappers\nconst recent = await client.orders.getRecent(5) // last 5\nconst cancelled = await client.orders.getByStatus('cancelled')\n```\n\n \n\n \n\n## Get a single order\n\n \n\nFor guest orders the SDK appends the cached `bill_token` automatically; the lookup works in the same browser session that placed the order, with no auth.\n\n \n \n\n```ts\n\nconst r = await client.orders.get('ord_xxx')\nif (!r.ok) return\n\nconst order = r.value\nconsole.log(order.status)\nconsole.log(order.items.length)\nconsole.log(order.total_price) // Money string\nconsole.log(formatPrice(parsePrice(order.total_price), order.currency))\n```\n\n \n\n \n\n## Cancel an order\n\n \n \n\n```ts\nconst cancelled = await client.orders.cancel('ord_xxx', 'changed_mind')\nif (!cancelled.ok) {\n // Codes you'll see: ORDER_NOT_CANCELLABLE, ORDER_ALREADY_FULFILLED\n console.error(cancelled.error.code, cancelled.error.message)\n}\n\n// Idempotent retry: same key, same outcome on the server\nawait client.orders.cancel('ord_xxx', 'changed_mind', {\n idempotencyKey: 'cancel-ord_xxx-once',\n})\n```\n\n \n\n \n\n## Order status values\n\n \n \n\n| Status | Meaning |\n| --- | --- |\n| `pending` | Created, awaiting payment confirmation |\n| `confirmed` | Accepted by the business |\n| `preparing` | Being assembled or fulfilled |\n| `ready` | Ready for pickup or delivery dispatch |\n| `completed` | Fulfilled; terminal state |\n| `cancelled` | Cancelled; terminal state |\n| `refunded` | Payment refunded |\n\n \n\n \n\n## Poll until terminal\n\n \n \n\n```ts\nasync function pollUntilTerminal(orderId: string, intervalMs = 5000) {\n for (;;) {\n const r = await client.orders.get(orderId)\n if (!r.ok) return r\n\n const status = r.value.status\n if (status === 'completed' || status === 'cancelled' || status === 'refunded') {\n return r\n }\n\n await new Promise((resolve) => setTimeout(resolve, intervalMs))\n }\n}\n```\n\n \n\n \n\n## Method reference\n\n \n \n\n| Method | Returns |\n| --- | --- |\n| `list({ status?, limit?, offset? })` | `Result<Order[]>` |\n| `get(orderId)` | `Result<Order>` |\n| `cancel(orderId, reason?, opts?)` | `Result<Order>` |\n| `getRecent(limit?)` | `Result<Order[]>` |\n| `getByStatus(status)` | `Result<Order[]>` |\n\n \n\n \n\n## Related\n\n \n \n- [**Checkout**](/docs/sdk/checkout)\n Create the orders that this page lists\n\n \n- [**Subscriptions**](/docs/sdk/subscriptions)\n For recurring orders, see the subscription surface\n\n \n- [**Scheduling**](/docs/sdk/scheduling)\n Reschedule or cancel a booking line item\n\n \n- [**Error handling**](/docs/sdk/errors)\n Cancellation guards and retryable errors\n"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"name": "subscriptions",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-
|
|
2
|
+
export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-HGFCYWS2.mjs';
|
|
3
3
|
import './chunk-K5464A3L.mjs';
|
|
4
4
|
import './chunk-DBZ3UOQ2.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-6CIWEADS.mjs';
|
|
6
6
|
import './chunk-C4M3DXKC.mjs';
|
|
7
7
|
import './chunk-UBAI443T.mjs';
|
|
8
8
|
import './chunk-E2T2SBP5.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { REGISTRY_INDEX } from './chunk-
|
|
2
|
+
import { REGISTRY_INDEX } from './chunk-NOMGIGNO.mjs';
|
|
3
3
|
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
4
4
|
import { CliError, CLI_ERROR_CODE, info, bold, dim, green, result } from './chunk-E2T2SBP5.mjs';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-6CIWEADS.mjs';
|
|
3
3
|
import { promptYesNo } from './chunk-ITAFAORS.mjs';
|
|
4
4
|
import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
|
|
5
5
|
import { success, bold, info, dim, result, failure, CliError, CLI_ERROR_CODE, step, isJsonMode } from './chunk-E2T2SBP5.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cimplify/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "Cimplify CLI — deploy, manage env vars, link projects, and scaffold storefronts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cimplify",
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
"vitest": "^4.1.5"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@cimplify/sdk": "^0.
|
|
48
|
+
"@cimplify/sdk": "^0.57.0"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CimplifySignInButton } from "@cimplify/sdk/react";
|
|
2
|
+
import { brand } from "@/lib/brand";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
heading?: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function SignedOutPrompt({ heading, subtitle }: Props) {
|
|
10
|
+
const clientId = process.env.NEXT_PUBLIC_CIMPLIFY_CLIENT_ID ?? "";
|
|
11
|
+
const redirectUri = process.env.NEXT_PUBLIC_CIMPLIFY_REDIRECT_URI ?? "";
|
|
12
|
+
return (
|
|
13
|
+
<div className="max-w-md mx-auto bg-card border border-border rounded-2xl p-8 sm:p-10 text-center">
|
|
14
|
+
<p className="text-[11px] font-semibold uppercase tracking-[0.16em] text-primary mb-2">
|
|
15
|
+
{brand.account.loginEyebrow}
|
|
16
|
+
</p>
|
|
17
|
+
<h2 className="font-serif text-2xl sm:text-3xl font-semibold mb-3 -tracking-[0.02em]">
|
|
18
|
+
{heading ?? brand.account.loginTitle}
|
|
19
|
+
</h2>
|
|
20
|
+
<p className="text-sm text-muted-foreground mb-7 leading-relaxed">
|
|
21
|
+
{subtitle ?? brand.account.loginSubtitle}
|
|
22
|
+
</p>
|
|
23
|
+
<CimplifySignInButton
|
|
24
|
+
clientId={clientId}
|
|
25
|
+
redirectUri={redirectUri}
|
|
26
|
+
variant="primary"
|
|
27
|
+
fullWidth
|
|
28
|
+
onSuccess={() => window.location.reload()}
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|