@makeswift/runtime 0.28.10-canary.7 → 0.28.10-canary.9

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.
Files changed (53) hide show
  1. package/dist/cjs/api/graphql/documents/queries.js +0 -14
  2. package/dist/cjs/api/graphql/documents/queries.js.map +1 -1
  3. package/dist/cjs/api/graphql/generated/types.js.map +1 -1
  4. package/dist/cjs/api/graphql-api-client.js +1 -8
  5. package/dist/cjs/api/graphql-api-client.js.map +1 -1
  6. package/dist/cjs/api/makeswift-api-resources-client.js +1 -7
  7. package/dist/cjs/api/makeswift-api-resources-client.js.map +1 -1
  8. package/dist/cjs/api/rest-api-client.js +14 -1
  9. package/dist/cjs/api/rest-api-client.js.map +1 -1
  10. package/dist/cjs/api-handler/handlers/manifest.js +1 -1
  11. package/dist/cjs/client/index.js +0 -3
  12. package/dist/cjs/client/index.js.map +1 -1
  13. package/dist/cjs/controls/index.js +10 -0
  14. package/dist/cjs/controls/index.js.map +1 -1
  15. package/dist/cjs/runtimes/react/react-runtime-core.js.map +1 -1
  16. package/dist/cjs/runtimes/react/runtime-core.js +0 -1
  17. package/dist/cjs/runtimes/react/runtime-core.js.map +1 -1
  18. package/dist/esm/api/graphql/documents/queries.js +0 -13
  19. package/dist/esm/api/graphql/documents/queries.js.map +1 -1
  20. package/dist/esm/api/graphql/generated/types.js.map +1 -1
  21. package/dist/esm/api/graphql-api-client.js +2 -9
  22. package/dist/esm/api/graphql-api-client.js.map +1 -1
  23. package/dist/esm/api/makeswift-api-resources-client.js +1 -7
  24. package/dist/esm/api/makeswift-api-resources-client.js.map +1 -1
  25. package/dist/esm/api/rest-api-client.js +14 -1
  26. package/dist/esm/api/rest-api-client.js.map +1 -1
  27. package/dist/esm/api-handler/handlers/manifest.js +1 -1
  28. package/dist/esm/client/index.js +0 -3
  29. package/dist/esm/client/index.js.map +1 -1
  30. package/dist/esm/controls/index.js +10 -0
  31. package/dist/esm/controls/index.js.map +1 -1
  32. package/dist/esm/runtimes/react/react-runtime-core.js.map +1 -1
  33. package/dist/esm/runtimes/react/runtime-core.js +0 -1
  34. package/dist/esm/runtimes/react/runtime-core.js.map +1 -1
  35. package/dist/types/api/graphql/documents/queries.d.ts +0 -1
  36. package/dist/types/api/graphql/documents/queries.d.ts.map +1 -1
  37. package/dist/types/api/graphql/generated/types.d.ts +0 -55
  38. package/dist/types/api/graphql/generated/types.d.ts.map +1 -1
  39. package/dist/types/api/graphql-api-client.d.ts +0 -2
  40. package/dist/types/api/graphql-api-client.d.ts.map +1 -1
  41. package/dist/types/api/makeswift-api-resources-client.d.ts +1 -3
  42. package/dist/types/api/makeswift-api-resources-client.d.ts.map +1 -1
  43. package/dist/types/api/rest-api-client.d.ts +2 -1
  44. package/dist/types/api/rest-api-client.d.ts.map +1 -1
  45. package/dist/types/client/index.d.ts +0 -2
  46. package/dist/types/client/index.d.ts.map +1 -1
  47. package/dist/types/controls/index.d.ts +1 -1
  48. package/dist/types/controls/index.d.ts.map +1 -1
  49. package/dist/types/runtimes/react/react-runtime-core.d.ts +2 -2
  50. package/dist/types/runtimes/react/react-runtime-core.d.ts.map +1 -1
  51. package/dist/types/runtimes/react/runtime-core.d.ts.map +1 -1
  52. package/dist/types/slate/InlineModePlugin/index.d.ts +1 -1
  53. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/controls/index.ts"],"sourcesContent":["export * from './control'\n\nexport {\n ControlDefinition,\n Checkbox,\n CheckboxDefinition,\n Code,\n CodeDefinition,\n Color,\n ColorDefinition,\n Combobox,\n ComboboxDefinition,\n Font,\n FontDefinition,\n unstable_Gallery,\n unstable_GalleryDefinition,\n type GalleryOption,\n type GalleryPage,\n Group,\n GroupDefinition,\n GroupControl,\n IconRadioGroup,\n IconRadioGroupDefinition,\n type IconRadioGroupIcon,\n Image,\n ImageDefinition,\n List,\n ListDefinition,\n ListControl,\n Number,\n NumberDefinition,\n Select,\n SelectDefinition,\n Shape,\n ShapeDefinition,\n ShapeControl,\n Slider,\n SliderDefinition,\n Style,\n StyleDefinition,\n type StyleProperty,\n StyleControl,\n TextInput,\n TextInputDefinition,\n TextArea,\n TextAreaDefinition,\n unstable_Typography,\n unstable_TypographyDefinition,\n} from '@makeswift/controls'\n\nexport { Link, LinkDefinition } from './link'\nexport { RichTextV1Definition, RichTextV1Control } from './rich-text'\nexport { RichText, RichTextV2Definition, RichTextV2Control } from './rich-text-v2'\nexport { Slot, SlotDefinition, SlotControl } from './slot'\nexport { unstable_StyleV2, StyleV2Definition, StyleV2Control } from './style-v2/style-v2'\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAc,sBAAd;AAEA,sBA8CO;AAEP,kBAAqC;AACrC,uBAAwD;AACxD,0BAAkE;AAClE,kBAAkD;AAClD,sBAAoE;","names":[]}
1
+ {"version":3,"sources":["../../../src/controls/index.ts"],"sourcesContent":["export * from './control'\n\nexport {\n ControlDefinition,\n ControlDefinitionVisitor,\n Checkbox,\n CheckboxDefinition,\n Code,\n CodeDefinition,\n Color,\n ColorDefinition,\n Combobox,\n ComboboxDefinition,\n isDependsOnConfig,\n isProvidesConfig,\n isContextValue,\n unstable_ContextValue,\n type ProvidesConfig,\n type DependsOnConfig,\n type AnyContextValue,\n type ContextValueDependencies,\n type ContextValues,\n Font,\n FontDefinition,\n unstable_Gallery,\n unstable_GalleryDefinition,\n type GalleryOption,\n type GalleryPage,\n Group,\n GroupDefinition,\n GroupControl,\n IconRadioGroup,\n IconRadioGroupDefinition,\n type IconRadioGroupIcon,\n Image,\n ImageDefinition,\n List,\n ListDefinition,\n ListControl,\n Number,\n NumberDefinition,\n Select,\n SelectDefinition,\n Shape,\n ShapeDefinition,\n ShapeControl,\n Slider,\n SliderDefinition,\n Style,\n StyleDefinition,\n type StyleProperty,\n StyleControl,\n TextInput,\n TextInputDefinition,\n TextArea,\n TextAreaDefinition,\n unstable_Typography,\n unstable_TypographyDefinition,\n} from '@makeswift/controls'\n\nexport { Link, LinkDefinition } from './link'\nexport { RichTextV1Definition, RichTextV1Control } from './rich-text'\nexport { RichText, RichTextV2Definition, RichTextV2Control } from './rich-text-v2'\nexport { Slot, SlotDefinition, SlotControl } from './slot'\nexport { unstable_StyleV2, StyleV2Definition, StyleV2Control } from './style-v2/style-v2'\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAc,sBAAd;AAEA,sBAwDO;AAEP,kBAAqC;AACrC,uBAAwD;AACxD,0BAAkE;AAClE,kBAAkD;AAClD,sBAAoE;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/runtimes/react/react-runtime-core.ts"],"sourcesContent":["import { type Component, type PropsWithoutRef, type ReactNode, type RefAttributes } from 'react'\n\nimport { ControlDefinition as UnifiedControlDefinition } from '@makeswift/controls'\n\nimport { type LegacyDescriptor, type DescriptorValueType } from '../../prop-controllers/descriptors'\n\nimport { supportsActivity } from './components/activity-with-fallback'\n\nimport {\n registerComponentEffect,\n registerReactComponentEffect,\n} from '../../state/actions/internal/read-only-actions'\n\nimport { ComponentIcon } from '../../state/modules/components-meta'\nimport type { ComponentType } from '../../state/read-only-state'\n\nimport { type InjectableProps } from './server/injectable-props'\n\nimport { RuntimeCore } from './runtime-core'\n\nfunction validateComponentType({\n type,\n componentName,\n}: {\n type: string\n componentName: string\n}): void {\n if (typeof type !== 'string' || type === '') {\n throw new Error(\n `${componentName}: A non-empty string \\`type\\` is required for component registration, got ${type}`,\n )\n }\n}\n\ntype InjectedPropsConfig = Record<string, keyof InjectableProps>\n\ntype ServerComponentConfig<I extends InjectedPropsConfig> =\n | boolean\n | {\n unstable_injectedProps: I\n }\n\ntype InjectedProps<I extends InjectedPropsConfig> = {\n [K in keyof I]: InjectableProps[I[K]]\n}\n\ntype ResolvedProps<P extends Record<string, LegacyDescriptor | UnifiedControlDefinition>> = {\n [K in keyof P]: DescriptorValueType<P[K]>\n}\n\ntype RegisteredComponentType<\n P extends Record<string, LegacyDescriptor | UnifiedControlDefinition>,\n I extends InjectedPropsConfig,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T = any,\n> =\n | {\n new (\n props: PropsWithoutRef<ResolvedProps<P>> & InjectedProps<I> & RefAttributes<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n context?: any,\n ): Component<ResolvedProps<P> & InjectedProps<I>>\n }\n | ((\n props: PropsWithoutRef<ResolvedProps<P>> & InjectedProps<I> & RefAttributes<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n context?: any,\n ) => ReactNode)\n\nexport class ReactRuntimeCore extends RuntimeCore {\n registerComponent<\n ControlDef extends UnifiedControlDefinition,\n P extends Record<string, LegacyDescriptor | ControlDef>,\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n const I extends InjectedPropsConfig = {},\n C extends RegisteredComponentType<P, I> = RegisteredComponentType<P, I>,\n >(\n component: C,\n {\n type,\n label,\n icon = ComponentIcon.Cube,\n hidden = false,\n description,\n builtinSuspense,\n unstable_migration,\n server = false,\n props,\n }: {\n type: string\n label: string\n icon?: ComponentIcon\n hidden?: boolean\n description?: string\n /**\n * In React <= 19.1, controls the default `<Suspense>` boundary.\n * Ignored in React >= 19.2; components are always wrapped in `<Activity>`.\n * Defaults to `true`.\n */\n builtinSuspense?: boolean\n /**\n * Marks this registration as superseded by `replacementType`. When\n * `replacementType` differs from `type`, the builder offers a way to\n * update existing instances.\n */\n unstable_migration?: { replacementType: string }\n server?: ServerComponentConfig<I>\n props?: P\n },\n ): () => void {\n const isServerComponent = server !== false\n const injectedProps = typeof server === 'object' ? server.unstable_injectedProps : {}\n\n validateComponentType(\n // make sure we don't access `component?.name` and trigger loading of the server\n // component unless we're running in the RSC environment\n isServerComponent && !this.isRSCEnv()\n ? { type, componentName: label || 'Unknown server component' }\n : {\n type,\n componentName: component?.name || label || 'Unknown component',\n },\n )\n\n const unregisterComponent = this.protoStore.dispatch(\n registerComponentEffect(\n type,\n {\n label,\n icon,\n hidden,\n description,\n builtinSuspense,\n unstable_migration,\n server: isServerComponent,\n injectedProps,\n },\n props ?? {},\n ),\n )\n\n if (supportsActivity() && builtinSuspense !== undefined) {\n console.warn(\n 'builtinSuspense is ignored in React >= 19.2; components are always wrapped in <Activity>.',\n )\n }\n\n if (isServerComponent && !this.isRSCEnv()) {\n // we can't load server components code outside of the RSC environment, but we also\n // don't need to: if everything is set up correctly, React has already rendered and\n // streamed the corresponding React elements to the client for us -- see\n // `ServerElementsCache` and `ElementDataServer`\n return () => {\n unregisterComponent()\n }\n }\n\n const unregisterReactComponent = this.protoStore.dispatch(\n registerReactComponentEffect(type, component as unknown as ComponentType),\n )\n\n return () => {\n unregisterComponent()\n unregisterReactComponent()\n }\n }\n\n protected isRSCEnv() {\n return false\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA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BAAyB;AAAA,IAC3B;AAAA,EACF;AAAA,EAEU,WAAW;AACnB,WAAO;AAAA,EACT;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/runtimes/react/react-runtime-core.ts"],"sourcesContent":["import { type Component, type PropsWithoutRef, type ReactNode, type RefAttributes } from 'react'\n\nimport {\n ControlDefinition as UnifiedControlDefinition,\n type PropsWithValidContextUsage,\n} from '@makeswift/controls'\n\nimport { type LegacyDescriptor, type DescriptorValueType } from '../../prop-controllers/descriptors'\n\nimport { supportsActivity } from './components/activity-with-fallback'\n\nimport {\n registerComponentEffect,\n registerReactComponentEffect,\n} from '../../state/actions/internal/read-only-actions'\n\nimport { ComponentIcon } from '../../state/modules/components-meta'\nimport type { ComponentType } from '../../state/read-only-state'\n\nimport { type InjectableProps } from './server/injectable-props'\n\nimport { RuntimeCore } from './runtime-core'\n\nfunction validateComponentType({\n type,\n componentName,\n}: {\n type: string\n componentName: string\n}): void {\n if (typeof type !== 'string' || type === '') {\n throw new Error(\n `${componentName}: A non-empty string \\`type\\` is required for component registration, got ${type}`,\n )\n }\n}\n\ntype InjectedPropsConfig = Record<string, keyof InjectableProps>\n\ntype ServerComponentConfig<I extends InjectedPropsConfig> =\n | boolean\n | {\n unstable_injectedProps: I\n }\n\ntype InjectedProps<I extends InjectedPropsConfig> = {\n [K in keyof I]: InjectableProps[I[K]]\n}\n\ntype ResolvedProps<P extends Record<string, LegacyDescriptor | UnifiedControlDefinition>> = {\n [K in keyof P]: DescriptorValueType<P[K]>\n}\n\ntype RegisteredComponentType<\n P extends Record<string, LegacyDescriptor | UnifiedControlDefinition>,\n I extends InjectedPropsConfig,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T = any,\n> =\n | {\n new (\n props: PropsWithoutRef<ResolvedProps<P>> & InjectedProps<I> & RefAttributes<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n context?: any,\n ): Component<ResolvedProps<P> & InjectedProps<I>>\n }\n | ((\n props: PropsWithoutRef<ResolvedProps<P>> & InjectedProps<I> & RefAttributes<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n context?: any,\n ) => ReactNode)\n\nexport class ReactRuntimeCore extends RuntimeCore {\n registerComponent<\n ControlDef extends UnifiedControlDefinition,\n P extends Record<string, LegacyDescriptor | ControlDef>,\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n const I extends InjectedPropsConfig = {},\n C extends RegisteredComponentType<P, I> = RegisteredComponentType<P, I>,\n >(\n component: C,\n {\n type,\n label,\n icon = ComponentIcon.Cube,\n hidden = false,\n description,\n builtinSuspense,\n unstable_migration,\n server = false,\n props,\n }: {\n type: string\n label: string\n icon?: ComponentIcon\n hidden?: boolean\n description?: string\n /**\n * In React <= 19.1, controls the default `<Suspense>` boundary.\n * Ignored in React >= 19.2; components are always wrapped in `<Activity>`.\n * Defaults to `true`.\n */\n builtinSuspense?: boolean\n /**\n * Marks this registration as superseded by `replacementType`. When\n * `replacementType` differs from `type`, the builder offers a way to\n * update existing instances.\n */\n unstable_migration?: { replacementType: string }\n server?: ServerComponentConfig<I>\n props?: P & PropsWithValidContextUsage<P>\n },\n ): () => void {\n const isServerComponent = server !== false\n const injectedProps = typeof server === 'object' ? server.unstable_injectedProps : {}\n\n validateComponentType(\n // make sure we don't access `component?.name` and trigger loading of the server\n // component unless we're running in the RSC environment\n isServerComponent && !this.isRSCEnv()\n ? { type, componentName: label || 'Unknown server component' }\n : {\n type,\n componentName: component?.name || label || 'Unknown component',\n },\n )\n\n const unregisterComponent = this.protoStore.dispatch(\n registerComponentEffect(\n type,\n {\n label,\n icon,\n hidden,\n description,\n builtinSuspense,\n unstable_migration,\n server: isServerComponent,\n injectedProps,\n },\n props ?? {},\n ),\n )\n\n if (supportsActivity() && builtinSuspense !== undefined) {\n console.warn(\n 'builtinSuspense is ignored in React >= 19.2; components are always wrapped in <Activity>.',\n )\n }\n\n if (isServerComponent && !this.isRSCEnv()) {\n // we can't load server components code outside of the RSC environment, but we also\n // don't need to: if everything is set up correctly, React has already rendered and\n // streamed the corresponding React elements to the client for us -- see\n // `ServerElementsCache` and `ElementDataServer`\n return () => {\n unregisterComponent()\n }\n }\n\n const unregisterReactComponent = this.protoStore.dispatch(\n registerReactComponentEffect(type, component as unknown as ComponentType),\n )\n\n return () => {\n unregisterComponent()\n unregisterReactComponent()\n }\n }\n\n protected isRSCEnv() {\n return false\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,oCAAiC;AAEjC,+BAGO;AAEP,6BAA8B;AAK9B,0BAA4B;AAE5B,SAAS,sBAAsB;AAAA,EAC7B;AAAA,EACA;AACF,GAGS;AACP,MAAI,OAAO,SAAS,YAAY,SAAS,IAAI;AAC3C,UAAM,IAAI;AAAA,MACR,GAAG,aAAa,6EAA6E,IAAI;AAAA,IACnG;AAAA,EACF;AACF;AAqCO,MAAM,yBAAyB,gCAAY;AAAA,EAChD,kBAOE,WACA;AAAA,IACE;AAAA,IACA;AAAA,IACA,OAAO,qCAAc;AAAA,IACrB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EACF,GAqBY;AACZ,UAAM,oBAAoB,WAAW;AACrC,UAAM,gBAAgB,OAAO,WAAW,WAAW,OAAO,yBAAyB,CAAC;AAEpF;AAAA;AAAA;AAAA,MAGE,qBAAqB,CAAC,KAAK,SAAS,IAChC,EAAE,MAAM,eAAe,SAAS,2BAA2B,IAC3D;AAAA,QACE;AAAA,QACA,eAAe,WAAW,QAAQ,SAAS;AAAA,MAC7C;AAAA,IACN;AAEA,UAAM,sBAAsB,KAAK,WAAW;AAAA,UAC1C;AAAA,QACE;AAAA,QACA;AAAA,UACE;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,QAAQ;AAAA,UACR;AAAA,QACF;AAAA,QACA,SAAS,CAAC;AAAA,MACZ;AAAA,IACF;AAEA,YAAI,gDAAiB,KAAK,oBAAoB,QAAW;AACvD,cAAQ;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAEA,QAAI,qBAAqB,CAAC,KAAK,SAAS,GAAG;AAKzC,aAAO,MAAM;AACX,4BAAoB;AAAA,MACtB;AAAA,IACF;AAEA,UAAM,2BAA2B,KAAK,WAAW;AAAA,UAC/C,uDAA6B,MAAM,SAAqC;AAAA,IAC1E;AAEA,WAAO,MAAM;AACX,0BAAoB;AACpB,+BAAyB;AAAA,IAC3B;AAAA,EACF;AAAA,EAEU,WAAW;AACnB,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -116,7 +116,6 @@ class RuntimeCore {
116
116
  fetch: this.fetch,
117
117
  apiKey: this.apiKey,
118
118
  apiOrigin: this.apiOrigin,
119
- graphqlApiEndpoint: this.graphqlApiEndpoint,
120
119
  preloadedState
121
120
  });
122
121
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/runtimes/react/runtime-core.ts"],"sourcesContent":["import { type SerializableReplacementContext } from '@makeswift/controls'\n\nimport { ApiResourcesClient } from '../../api/api-resources-client'\nimport { HostApiResourcesClient } from '../../api/host-api-resources-client'\nimport { MakeswiftApiResourcesClient } from '../../api/makeswift-api-resources-client'\nimport { type HttpFetch } from '../../api/types'\nimport { type SiteVersion } from '../../api/site-version'\n\nimport {\n type Breakpoints,\n type BreakpointsInput,\n parseBreakpointsInput,\n} from '../../state/modules/breakpoints'\n\nimport { copyElementTree } from '../../state/ops/copy-element-tree'\n\nimport { getBreakpoints, type Element, type ElementData } from '../../state/read-only-state'\nimport {\n configureProtoStore,\n configureReadWriteStore,\n type ProtoStore,\n type Store,\n} from '../../state/store'\n\nimport { RefCountedMap } from '../../utils/ref-counted-map'\nimport { isServer } from '../../utils/is-server'\n\nexport type StoreKey = {\n siteVersion: SiteVersion | null\n locale: string | undefined\n}\n\nconst VERSION_TAG_LIVE = 'ref:live'\n\nexport class RuntimeCore {\n // The unowned entry TTL affects performance, not correctness. The TTL controls how long an unretained store stays\n // in the map. If an entry expires and is removed from the map before React commits, the store remains retained\n // via `<StoreContext.Provider>`. The only impact is that future lookups will create a new store instance instead of\n // reusing the existing one, reducing cache efficiency.\n private readonly activeStores = new RefCountedMap<string | null, Store>({\n unownedEntryTtlMs: 1000,\n // Checking on retain/release is sufficient on the client, and we don't need to check on get on the server\n // as the only scenario in which we add the store to the map is when the runtime is already bound to the\n // requested site version, which should be the only site version for which the store is requested\n ttlCheck: RefCountedMap.TTLCheck.ON_RETAIN | RefCountedMap.TTLCheck.ON_RELEASE,\n })\n\n private readonly apiKey: string | undefined\n\n readonly protoStore: ProtoStore\n readonly appOrigin: string\n readonly apiOrigin: string\n readonly requestKey: StoreKey | undefined\n readonly fetch: HttpFetch\n\n constructor({\n appOrigin = 'https://app.makeswift.com',\n apiOrigin = 'https://api.makeswift.com',\n apiKey,\n breakpoints,\n requestKey,\n fetch,\n }: {\n appOrigin?: string\n apiOrigin?: string\n apiKey?: string\n breakpoints?: BreakpointsInput\n requestKey?: StoreKey\n fetch: HttpFetch\n }) {\n this.appOrigin = validateOrigin(appOrigin, 'appOrigin')\n this.apiOrigin = validateOrigin(apiOrigin, 'apiOrigin')\n this.apiKey = apiKey\n this.requestKey = requestKey\n this.fetch = fetch\n\n this.protoStore = configureProtoStore({\n name: 'Runtime proto-store',\n breakpoints: breakpoints ? parseBreakpointsInput(breakpoints) : undefined,\n })\n }\n\n getOrCreateStore({ siteVersion, locale }: StoreKey): Store {\n const key = storeCacheKey({ siteVersion, locale })\n\n const createStore = () => {\n // API resources client includes an in-memory cache of the site's resources and thus also has to be versioned\n const apiResourcesClient = this.createApiResourcesClient({ siteVersion, locale })\n\n // TODO: we need to decouple editability from the site version; specifically, previewing\n // a draft version of the site should not lead to switching to the read-write state\n const isReadOnly = siteVersion == null\n\n return configureReadWriteStore({\n name: `Runtime read-write store (site version: ${key})`,\n appOrigin: this.appOrigin,\n apiResourcesClient,\n preloadedState: { ...this.protoStore.getState(), siteVersion, isReadOnly, locale },\n })\n }\n\n // On the server, stores are ephemeral by default so SSR does not retain them in a long-lived runtime.\n // The exception is a runtime that is already bound to the requested site version & locale, where we\n // can safely reuse the store across multiple root regions and benefit from the host API client's\n // in-memory cache.\n //\n // On the client, stores are reference-counted by site version so multiple root regions can share a store\n // instance, which preserves the pre-v0.17 per-site-version store behavior without requiring a separate\n // runtime per root.\n const usePersistentStore = this.shouldUsePersistentStore(key)\n return usePersistentStore ? this.activeStores.getOrCreate(key, createStore) : createStore()\n }\n\n retainStore({ siteVersion, locale }: StoreKey, store: Store): void {\n const key = storeCacheKey({ siteVersion, locale })\n\n if (!this.shouldUsePersistentStore(key)) {\n console.error('RuntimeCore: attempt to retain an ephemeral store', { key })\n return\n }\n\n if (this.activeStores.retain(key, store)) {\n store.startBreakpointWatch()\n }\n }\n\n releaseStore({ siteVersion, locale }: StoreKey, store: Store): void {\n const key = storeCacheKey({ siteVersion, locale })\n\n if (!this.shouldUsePersistentStore(key)) {\n console.error('RuntimeCore: attempt to release an ephemeral store', { key })\n return\n }\n\n if (this.activeStores.release(key, store)) {\n store.stopBreakpointWatch()\n }\n }\n\n copyElementTree(\n elementTree: ElementData,\n replacementContext: SerializableReplacementContext,\n ): Element {\n return copyElementTree(this.protoStore.getState(), elementTree, replacementContext)\n }\n\n getBreakpoints(): Breakpoints {\n return getBreakpoints(this.protoStore.getState())\n }\n\n get graphqlApiEndpoint(): string {\n return new URL('graphql', this.apiOrigin).href\n }\n\n private createApiResourcesClient(preloadedState: {\n siteVersion: SiteVersion | null\n locale: string | undefined\n }): ApiResourcesClient {\n if (isServer() && this.apiKey) {\n return new MakeswiftApiResourcesClient({\n fetch: this.fetch,\n apiKey: this.apiKey,\n apiOrigin: this.apiOrigin,\n graphqlApiEndpoint: this.graphqlApiEndpoint,\n preloadedState,\n })\n }\n\n return new HostApiResourcesClient({\n fetch: this.fetch,\n preloadedState,\n })\n }\n\n private shouldUsePersistentStore(key: string): boolean {\n // don't persist stores on the server unless the runtime instance is bound to a request\n // and the requested store matches the request's site version and locale\n return !isServer() || (this.requestKey !== undefined && storeCacheKey(this.requestKey) === key)\n }\n}\n\nconst storeCacheKey = ({ siteVersion, locale }: StoreKey): string =>\n `${siteVersionTag(siteVersion)}/${locale ?? 'default'}`\n\nconst siteVersionTag = (siteVersion: SiteVersion | null): string =>\n siteVersion?.version ?? VERSION_TAG_LIVE\n\nfunction validateOrigin(url: string, name: string): string {\n try {\n return new URL(url).origin\n } catch {\n throw new Error(`The Makeswift runtime received an invalid \\`${name}\\` parameter: \"${url}\".`)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uCAAuC;AACvC,4CAA4C;AAI5C,yBAIO;AAEP,+BAAgC;AAEhC,6BAA+D;AAC/D,mBAKO;AAEP,6BAA8B;AAC9B,uBAAyB;AAOzB,MAAM,mBAAmB;AAElB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAKN,eAAe,IAAI,qCAAoC;AAAA,IACtE,mBAAmB;AAAA;AAAA;AAAA;AAAA,IAInB,UAAU,qCAAc,SAAS,YAAY,qCAAc,SAAS;AAAA,EACtE,CAAC;AAAA,EAEgB;AAAA,EAER;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY;AAAA,IACV,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAOG;AACD,SAAK,YAAY,eAAe,WAAW,WAAW;AACtD,SAAK,YAAY,eAAe,WAAW,WAAW;AACtD,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,QAAQ;AAEb,SAAK,iBAAa,kCAAoB;AAAA,MACpC,MAAM;AAAA,MACN,aAAa,kBAAc,0CAAsB,WAAW,IAAI;AAAA,IAClE,CAAC;AAAA,EACH;AAAA,EAEA,iBAAiB,EAAE,aAAa,OAAO,GAAoB;AACzD,UAAM,MAAM,cAAc,EAAE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I,qBAA6B;AAC/B,WAAO,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE;AAAA,EAC5C;AAAA,EAEQ,yBAAyB,gBAGV;AACrB,YAAI,2BAAS,KAAK,KAAK,QAAQ;AAC7B,aAAO,IAAI,kEAA4B;AAAA,QACrC,OAAO,KAAK;AAAA,QACZ,QAAQ,KAAK;AAAA,QACb,WAAW,KAAK;AAAA,QAChB,oBAAoB,KAAK;AAAA,QACzB;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO,IAAI,wDAAuB;AAAA,MAChC,OAAO,KAAK;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEQ,yBAAyB,KAAsB;AAGrD,WAAO,KAAC,2BAAS,KAAM,KAAK,eAAe,UAAa,cAAc,KAAK,UAAU,MAAM;AAAA,EAC7F;AACF;AAEA,MAAM,gBAAgB,CAAC,EAAE,aAAa,OAAO,MAC3C,GAAG,eAAe,WAAW,CAAC,IAAI,UAAU,SAAS;AAEvD,MAAM,iBAAiB,CAAC,gBACtB,aAAa,WAAW;AAE1B,SAAS,eAAe,KAAa,MAAsB;AACzD,MAAI;AACF,WAAO,IAAI,IAAI,GAAG,EAAE;AAAA,EACtB,QAAQ;AACN,UAAM,IAAI,MAAM,+CAA+C,IAAI,kBAAkB,GAAG,IAAI;AAAA,EAC9F;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/runtimes/react/runtime-core.ts"],"sourcesContent":["import { type SerializableReplacementContext } from '@makeswift/controls'\n\nimport { ApiResourcesClient } from '../../api/api-resources-client'\nimport { HostApiResourcesClient } from '../../api/host-api-resources-client'\nimport { MakeswiftApiResourcesClient } from '../../api/makeswift-api-resources-client'\nimport { type HttpFetch } from '../../api/types'\nimport { type SiteVersion } from '../../api/site-version'\n\nimport {\n type Breakpoints,\n type BreakpointsInput,\n parseBreakpointsInput,\n} from '../../state/modules/breakpoints'\n\nimport { copyElementTree } from '../../state/ops/copy-element-tree'\n\nimport { getBreakpoints, type Element, type ElementData } from '../../state/read-only-state'\nimport {\n configureProtoStore,\n configureReadWriteStore,\n type ProtoStore,\n type Store,\n} from '../../state/store'\n\nimport { RefCountedMap } from '../../utils/ref-counted-map'\nimport { isServer } from '../../utils/is-server'\n\nexport type StoreKey = {\n siteVersion: SiteVersion | null\n locale: string | undefined\n}\n\nconst VERSION_TAG_LIVE = 'ref:live'\n\nexport class RuntimeCore {\n // The unowned entry TTL affects performance, not correctness. The TTL controls how long an unretained store stays\n // in the map. If an entry expires and is removed from the map before React commits, the store remains retained\n // via `<StoreContext.Provider>`. The only impact is that future lookups will create a new store instance instead of\n // reusing the existing one, reducing cache efficiency.\n private readonly activeStores = new RefCountedMap<string | null, Store>({\n unownedEntryTtlMs: 1000,\n // Checking on retain/release is sufficient on the client, and we don't need to check on get on the server\n // as the only scenario in which we add the store to the map is when the runtime is already bound to the\n // requested site version, which should be the only site version for which the store is requested\n ttlCheck: RefCountedMap.TTLCheck.ON_RETAIN | RefCountedMap.TTLCheck.ON_RELEASE,\n })\n\n private readonly apiKey: string | undefined\n\n readonly protoStore: ProtoStore\n readonly appOrigin: string\n readonly apiOrigin: string\n readonly requestKey: StoreKey | undefined\n readonly fetch: HttpFetch\n\n constructor({\n appOrigin = 'https://app.makeswift.com',\n apiOrigin = 'https://api.makeswift.com',\n apiKey,\n breakpoints,\n requestKey,\n fetch,\n }: {\n appOrigin?: string\n apiOrigin?: string\n apiKey?: string\n breakpoints?: BreakpointsInput\n requestKey?: StoreKey\n fetch: HttpFetch\n }) {\n this.appOrigin = validateOrigin(appOrigin, 'appOrigin')\n this.apiOrigin = validateOrigin(apiOrigin, 'apiOrigin')\n this.apiKey = apiKey\n this.requestKey = requestKey\n this.fetch = fetch\n\n this.protoStore = configureProtoStore({\n name: 'Runtime proto-store',\n breakpoints: breakpoints ? parseBreakpointsInput(breakpoints) : undefined,\n })\n }\n\n getOrCreateStore({ siteVersion, locale }: StoreKey): Store {\n const key = storeCacheKey({ siteVersion, locale })\n\n const createStore = () => {\n // API resources client includes an in-memory cache of the site's resources and thus also has to be versioned\n const apiResourcesClient = this.createApiResourcesClient({ siteVersion, locale })\n\n // TODO: we need to decouple editability from the site version; specifically, previewing\n // a draft version of the site should not lead to switching to the read-write state\n const isReadOnly = siteVersion == null\n\n return configureReadWriteStore({\n name: `Runtime read-write store (site version: ${key})`,\n appOrigin: this.appOrigin,\n apiResourcesClient,\n preloadedState: { ...this.protoStore.getState(), siteVersion, isReadOnly, locale },\n })\n }\n\n // On the server, stores are ephemeral by default so SSR does not retain them in a long-lived runtime.\n // The exception is a runtime that is already bound to the requested site version & locale, where we\n // can safely reuse the store across multiple root regions and benefit from the host API client's\n // in-memory cache.\n //\n // On the client, stores are reference-counted by site version so multiple root regions can share a store\n // instance, which preserves the pre-v0.17 per-site-version store behavior without requiring a separate\n // runtime per root.\n const usePersistentStore = this.shouldUsePersistentStore(key)\n return usePersistentStore ? this.activeStores.getOrCreate(key, createStore) : createStore()\n }\n\n retainStore({ siteVersion, locale }: StoreKey, store: Store): void {\n const key = storeCacheKey({ siteVersion, locale })\n\n if (!this.shouldUsePersistentStore(key)) {\n console.error('RuntimeCore: attempt to retain an ephemeral store', { key })\n return\n }\n\n if (this.activeStores.retain(key, store)) {\n store.startBreakpointWatch()\n }\n }\n\n releaseStore({ siteVersion, locale }: StoreKey, store: Store): void {\n const key = storeCacheKey({ siteVersion, locale })\n\n if (!this.shouldUsePersistentStore(key)) {\n console.error('RuntimeCore: attempt to release an ephemeral store', { key })\n return\n }\n\n if (this.activeStores.release(key, store)) {\n store.stopBreakpointWatch()\n }\n }\n\n copyElementTree(\n elementTree: ElementData,\n replacementContext: SerializableReplacementContext,\n ): Element {\n return copyElementTree(this.protoStore.getState(), elementTree, replacementContext)\n }\n\n getBreakpoints(): Breakpoints {\n return getBreakpoints(this.protoStore.getState())\n }\n\n get graphqlApiEndpoint(): string {\n return new URL('graphql', this.apiOrigin).href\n }\n\n private createApiResourcesClient(preloadedState: {\n siteVersion: SiteVersion | null\n locale: string | undefined\n }): ApiResourcesClient {\n if (isServer() && this.apiKey) {\n return new MakeswiftApiResourcesClient({\n fetch: this.fetch,\n apiKey: this.apiKey,\n apiOrigin: this.apiOrigin,\n preloadedState,\n })\n }\n\n return new HostApiResourcesClient({\n fetch: this.fetch,\n preloadedState,\n })\n }\n\n private shouldUsePersistentStore(key: string): boolean {\n // don't persist stores on the server unless the runtime instance is bound to a request\n // and the requested store matches the request's site version and locale\n return !isServer() || (this.requestKey !== undefined && storeCacheKey(this.requestKey) === key)\n }\n}\n\nconst storeCacheKey = ({ siteVersion, locale }: StoreKey): string =>\n `${siteVersionTag(siteVersion)}/${locale ?? 'default'}`\n\nconst siteVersionTag = (siteVersion: SiteVersion | null): string =>\n siteVersion?.version ?? VERSION_TAG_LIVE\n\nfunction validateOrigin(url: string, name: string): string {\n try {\n return new URL(url).origin\n } catch {\n throw new Error(`The Makeswift runtime received an invalid \\`${name}\\` parameter: \"${url}\".`)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uCAAuC;AACvC,4CAA4C;AAI5C,yBAIO;AAEP,+BAAgC;AAEhC,6BAA+D;AAC/D,mBAKO;AAEP,6BAA8B;AAC9B,uBAAyB;AAOzB,MAAM,mBAAmB;AAElB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAKN,eAAe,IAAI,qCAAoC;AAAA,IACtE,mBAAmB;AAAA;AAAA;AAAA;AAAA,IAInB,UAAU,qCAAc,SAAS,YAAY,qCAAc,SAAS;AAAA,EACtE,CAAC;AAAA,EAEgB;AAAA,EAER;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY;AAAA,IACV,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAOG;AACD,SAAK,YAAY,eAAe,WAAW,WAAW;AACtD,SAAK,YAAY,eAAe,WAAW,W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AAK,KAAK,GAAG;AACzC,YAAM,oBAAoB;AAAA,IAC5B;AAAA,EACF;AAAA,EAEA,gBACE,aACA,oBACS;AACT,eAAO,0CAAgB,KAAK,WAAW,SAAS,GAAG,aAAa,kBAAkB;AAAA,EACpF;AAAA,EAEA,iBAA8B;AAC5B,eAAO,uCAAe,KAAK,WAAW,SAAS,CAAC;AAAA,EAClD;AAAA,EAEA,IAAI,qBAA6B;AAC/B,WAAO,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE;AAAA,EAC5C;AAAA,EAEQ,yBAAyB,gBAGV;AACrB,YAAI,2BAAS,KAAK,KAAK,QAAQ;AAC7B,aAAO,IAAI,kEAA4B;AAAA,QACrC,OAAO,KAAK;AAAA,QACZ,QAAQ,KAAK;AAAA,QACb,WAAW,KAAK;AAAA,QAChB;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO,IAAI,wDAAuB;AAAA,MAChC,OAAO,KAAK;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEQ,yBAAyB,KAAsB;AAGrD,WAAO,KAAC,2BAAS,KAAM,KAAK,eAAe,UAAa,cAAc,KAAK,UAAU,MAAM;AAAA,EAC7F;AACF;AAEA,MAAM,gBAAgB,CAAC,EAAE,aAAa,OAAO,MAC3C,GAAG,eAAe,WAAW,CAAC,IAAI,UAAU,SAAS;AAEvD,MAAM,iBAAiB,CAAC,gBACtB,aAAa,WAAW;AAE1B,SAAS,eAAe,KAAa,MAAsB;AACzD,MAAI;AACF,WAAO,IAAI,IAAI,GAAG,EAAE;AAAA,EACtB,QAAQ;AACN,UAAM,IAAI,MAAM,+CAA+C,IAAI,kBAAkB,GAAG,IAAI;AAAA,EAC9F;AACF;","names":[]}
@@ -46,18 +46,6 @@ const TypographyQuery = (
46
46
  ${TypographyFragment}
47
47
  `
48
48
  );
49
- const TableQuery = (
50
- /* GraphQL */
51
- `
52
- query Table($tableId: ID!) {
53
- table(id: $tableId) {
54
- ...Table
55
- }
56
- }
57
-
58
- ${TableFragment}
59
- `
60
- );
61
49
  const TypographiesQuery = (
62
50
  /* GraphQL */
63
51
  `
@@ -85,7 +73,6 @@ const GlobalElementQuery = (
85
73
  export {
86
74
  GlobalElementQuery,
87
75
  SwatchQuery,
88
- TableQuery,
89
76
  TypographiesQuery,
90
77
  TypographyQuery,
91
78
  UnversionedResourcesQuery
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/api/graphql/documents/queries.ts"],"sourcesContent":["import {\n FileFragment,\n GlobalElementFragment,\n SwatchFragment,\n TableFragment,\n TypographyFragment,\n} from './fragments'\n\nexport const UnversionedResourcesQuery = /* GraphQL */ `\n query UnversionedResources($fileIds: [ID!]!, $tableIds: [ID!]!) {\n files(ids: $fileIds) {\n ...File\n }\n\n tables(ids: $tableIds) {\n ...Table\n }\n }\n\n ${FileFragment}\n ${TableFragment}\n`\n\nexport const SwatchQuery = /* GraphQL */ `\n query Swatch($swatchId: ID!) {\n swatch(id: $swatchId) {\n ...Swatch\n }\n }\n\n ${SwatchFragment}\n`\n\nexport const TypographyQuery = /* GraphQL */ `\n query Typography($typographyId: ID!) {\n typography(id: $typographyId) {\n ...Typography\n }\n }\n\n ${TypographyFragment}\n`\n\nexport const TableQuery = /* GraphQL */ `\n query Table($tableId: ID!) {\n table(id: $tableId) {\n ...Table\n }\n }\n\n ${TableFragment}\n`\n\nexport const TypographiesQuery = /* GraphQL */ `\n query Typographies($typographyIds: [ID!]!) {\n typographies(ids: $typographyIds) {\n ...Typography\n }\n }\n\n ${TypographyFragment}\n`\n\nexport const GlobalElementQuery = /* GraphQL */ `\n query GlobalElement($globalElementId: ID!) {\n globalElement(id: $globalElementId) {\n ...GlobalElement\n }\n }\n\n ${GlobalElementFragment}\n`\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM;AAAA;AAAA,EAA0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWnD,YAAY;AAAA,IACZ,aAAa;AAAA;AAAA;AAGV,MAAM;AAAA;AAAA,EAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOrC,cAAc;AAAA;AAAA;AAGX,MAAM;AAAA;AAAA,EAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOzC,kBAAkB;AAAA;AAAA;AAGf,MAAM;AAAA;AAAA,EAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOpC,aAAa;AAAA;AAAA;AAGV,MAAM;AAAA;AAAA,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAO3C,kBAAkB;AAAA;AAAA;AAGf,MAAM;AAAA;AAAA,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAO5C,qBAAqB;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/api/graphql/documents/queries.ts"],"sourcesContent":["import {\n FileFragment,\n GlobalElementFragment,\n SwatchFragment,\n TableFragment,\n TypographyFragment,\n} from './fragments'\n\nexport const UnversionedResourcesQuery = /* GraphQL */ `\n query UnversionedResources($fileIds: [ID!]!, $tableIds: [ID!]!) {\n files(ids: $fileIds) {\n ...File\n }\n\n tables(ids: $tableIds) {\n ...Table\n }\n }\n\n ${FileFragment}\n ${TableFragment}\n`\n\nexport const SwatchQuery = /* GraphQL */ `\n query Swatch($swatchId: ID!) {\n swatch(id: $swatchId) {\n ...Swatch\n }\n }\n\n ${SwatchFragment}\n`\n\nexport const TypographyQuery = /* GraphQL */ `\n query Typography($typographyId: ID!) {\n typography(id: $typographyId) {\n ...Typography\n }\n }\n\n ${TypographyFragment}\n`\n\nexport const TypographiesQuery = /* GraphQL */ `\n query Typographies($typographyIds: [ID!]!) {\n typographies(ids: $typographyIds) {\n ...Typography\n }\n }\n\n ${TypographyFragment}\n`\n\nexport const GlobalElementQuery = /* GraphQL */ `\n query GlobalElement($globalElementId: ID!) {\n globalElement(id: $globalElementId) {\n ...GlobalElement\n }\n }\n\n ${GlobalElementFragment}\n`\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM;AAAA;AAAA,EAA0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWnD,YAAY;AAAA,IACZ,aAAa;AAAA;AAAA;AAGV,MAAM;AAAA;AAAA,EAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOrC,cAAc;AAAA;AAAA;AAGX,MAAM;AAAA;AAAA,EAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOzC,kBAAkB;AAAA;AAAA;AAGf,MAAM;AAAA;AAAA,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAO3C,kBAAkB;AAAA;AAAA;AAGf,MAAM;AAAA;AAAA,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAO5C,qBAAqB;AAAA;AAAA;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/api/graphql/generated/types.ts"],"sourcesContent":["export type Maybe<T> = T | null\nexport type InputMaybe<T> = Maybe<T>\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] }\n\ntype Json = null | boolean | number | string | Json[] | { [key: string]: Json }\n\ntype Scalars = {\n ID: string\n JSON: Json\n Locale: string\n}\n\nexport type CreateTableRecordInput = {\n data: CreateTableRecordInputData\n}\n\nexport type CreateTableRecordInputData = {\n columns: Array<CreateTableRecordInputDataColumn>\n tableId?: InputMaybe<Scalars['ID']>\n}\n\nexport type CreateTableRecordInputDataColumn = {\n columnId: Scalars['ID']\n data: Scalars['JSON']\n}\n\nexport const SnippetLocation = {\n Body: 'BODY',\n Head: 'HEAD',\n} as const\n\nexport type SnippetLocation = (typeof SnippetLocation)[keyof typeof SnippetLocation]\n\nexport type SwatchFragment = {\n __typename: 'Swatch'\n id: string\n hue: number\n saturation: number\n lightness: number\n}\n\nexport type FileFragment = {\n __typename: 'File'\n id: string\n name: string\n extension: string | null\n publicUrl: string\n dimensions: { width: number; height: number } | null\n}\n\nexport type TypographyFragment = {\n __typename: 'Typography'\n id: string\n name: string\n style: Array<{\n deviceId: string\n value: {\n fontFamily: string | null\n lineHeight: number | null\n letterSpacing: number | null\n fontWeight: number | null\n textAlign: string | null\n uppercase: boolean | null\n underline: boolean | null\n strikethrough: boolean | null\n italic: boolean | null\n fontSize: { value: number | null; unit: string | null } | null\n color: { swatchId: string | null; alpha: number | null } | null\n }\n }>\n}\n\nexport type PagePathnameSliceFragment = {\n __typename: 'PagePathnameSlice'\n id: string\n pathname: string\n}\n\nexport type GlobalElementFragment = { __typename: 'GlobalElement'; id: string; data: Json }\n\nexport type LocalizedGlobalElementFragment = {\n __typename: 'LocalizedGlobalElement'\n id: string\n data: Json\n}\n\nexport type TableFragment = {\n __typename: 'Table'\n id: string\n name: string\n columns: Array<\n | { __typename: 'CheckboxTableColumn'; id: string; name: string }\n | { __typename: 'EmailTableColumn'; id: string; name: string }\n | { __typename: 'LongTextTableColumn'; id: string; name: string }\n | {\n __typename: 'MultipleSelectTableColumn'\n id: string\n name: string\n options: Array<{ id: string; name: string }>\n }\n | { __typename: 'NumberTableColumn'; id: string; name: string }\n | { __typename: 'PhoneNumberTableColumn'; id: string; name: string }\n | { __typename: 'SingleLineTextTableColumn'; id: string; name: string }\n | {\n __typename: 'SingleSelectTableColumn'\n id: string\n name: string\n options: Array<{ id: string; name: string }>\n }\n | { __typename: 'URLTableColumn'; id: string; name: string }\n >\n}\n\nexport type SnippetFragment = {\n __typename: 'Snippet'\n id: string\n name: string\n code: string\n cleanup: string | null\n location: SnippetLocation\n shouldAddToNewPages: boolean\n liveEnabled: boolean\n builderEnabled: boolean\n}\n\nexport type PageFragment = {\n __typename: 'Page'\n id: string\n snippets: Array<{\n __typename: 'Snippet'\n id: string\n name: string\n code: string\n cleanup: string | null\n location: SnippetLocation\n shouldAddToNewPages: boolean\n liveEnabled: boolean\n builderEnabled: boolean\n }>\n}\n\nexport type SiteFragment = {\n __typename: 'Site'\n id: string\n googleFonts: {\n edges: Array<{\n activeVariants: Array<{ specifier: string }>\n node: { family: string; variants: Array<{ specifier: string }> }\n } | null>\n }\n}\n\nexport type UnversionedResourcesQueryVariables = Exact<{\n fileIds: Array<Scalars['ID']> | Scalars['ID']\n tableIds: Array<Scalars['ID']> | Scalars['ID']\n}>\n\nexport type UnversionedResourcesQueryResult = {\n files: Array<{\n __typename: 'File'\n id: string\n name: string\n extension: string | null\n publicUrl: string\n dimensions: { width: number; height: number } | null\n } | null>\n tables: Array<{\n __typename: 'Table'\n id: string\n name: string\n columns: Array<\n | { __typename: 'CheckboxTableColumn'; id: string; name: string }\n | { __typename: 'EmailTableColumn'; id: string; name: string }\n | { __typename: 'LongTextTableColumn'; id: string; name: string }\n | {\n __typename: 'MultipleSelectTableColumn'\n id: string\n name: string\n options: Array<{ id: string; name: string }>\n }\n | { __typename: 'NumberTableColumn'; id: string; name: string }\n | { __typename: 'PhoneNumberTableColumn'; id: string; name: string }\n | { __typename: 'SingleLineTextTableColumn'; id: string; name: string }\n | {\n __typename: 'SingleSelectTableColumn'\n id: string\n name: string\n options: Array<{ id: string; name: string }>\n }\n | { __typename: 'URLTableColumn'; id: string; name: string }\n >\n } | null>\n}\n\nexport type SwatchQueryVariables = Exact<{\n swatchId: Scalars['ID']\n}>\n\nexport type SwatchQueryResult = {\n swatch: {\n __typename: 'Swatch'\n id: string\n hue: number\n saturation: number\n lightness: number\n } | null\n}\n\nexport type TypographyQueryVariables = Exact<{\n typographyId: Scalars['ID']\n}>\n\nexport type TypographyQueryResult = {\n typography: {\n __typename: 'Typography'\n id: string\n name: string\n style: Array<{\n deviceId: string\n value: {\n fontFamily: string | null\n lineHeight: number | null\n letterSpacing: number | null\n fontWeight: number | null\n textAlign: string | null\n uppercase: boolean | null\n underline: boolean | null\n strikethrough: boolean | null\n italic: boolean | null\n fontSize: { value: number | null; unit: string | null } | null\n color: { swatchId: string | null; alpha: number | null } | null\n }\n }>\n } | null\n}\n\nexport type TableQueryVariables = Exact<{\n tableId: Scalars['ID']\n}>\n\nexport type TableQueryResult = {\n table: {\n __typename: 'Table'\n id: string\n name: string\n columns: Array<\n | { __typename: 'CheckboxTableColumn'; id: string; name: string }\n | { __typename: 'EmailTableColumn'; id: string; name: string }\n | { __typename: 'LongTextTableColumn'; id: string; name: string }\n | {\n __typename: 'MultipleSelectTableColumn'\n id: string\n name: string\n options: Array<{ id: string; name: string }>\n }\n | { __typename: 'NumberTableColumn'; id: string; name: string }\n | { __typename: 'PhoneNumberTableColumn'; id: string; name: string }\n | { __typename: 'SingleLineTextTableColumn'; id: string; name: string }\n | {\n __typename: 'SingleSelectTableColumn'\n id: string\n name: string\n options: Array<{ id: string; name: string }>\n }\n | { __typename: 'URLTableColumn'; id: string; name: string }\n >\n } | null\n}\n\nexport type TypographiesQueryVariables = Exact<{\n typographyIds: Array<Scalars['ID']> | Scalars['ID']\n}>\n\nexport type TypographiesQueryResult = {\n typographies: Array<{\n __typename: 'Typography'\n id: string\n name: string\n style: Array<{\n deviceId: string\n value: {\n fontFamily: string | null\n lineHeight: number | null\n letterSpacing: number | null\n fontWeight: number | null\n textAlign: string | null\n uppercase: boolean | null\n underline: boolean | null\n strikethrough: boolean | null\n italic: boolean | null\n fontSize: { value: number | null; unit: string | null } | null\n color: { swatchId: string | null; alpha: number | null } | null\n }\n }>\n } | null>\n}\n\nexport type GlobalElementQueryVariables = Exact<{\n globalElementId: Scalars['ID']\n}>\n\nexport type GlobalElementQueryResult = {\n globalElement: { __typename: 'GlobalElement'; id: string; data: Json } | null\n}\n\nexport type CreateTableRecordMutationVariables = Exact<{\n input: CreateTableRecordInput\n}>\n\nexport type CreateTableRecordMutationResult = { createTableRecord: { tableRecord: { id: string } } }\n"],"mappings":"AA0BO,MAAM,kBAAkB;AAAA,EAC7B,MAAM;AAAA,EACN,MAAM;AACR;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/api/graphql/generated/types.ts"],"sourcesContent":["export type Maybe<T> = T | null\nexport type InputMaybe<T> = Maybe<T>\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] }\n\ntype Json = null | boolean | number | string | Json[] | { [key: string]: Json }\n\ntype Scalars = {\n ID: string\n JSON: Json\n Locale: string\n}\n\nexport type CreateTableRecordInput = {\n data: CreateTableRecordInputData\n}\n\nexport type CreateTableRecordInputData = {\n columns: Array<CreateTableRecordInputDataColumn>\n tableId?: InputMaybe<Scalars['ID']>\n}\n\nexport type CreateTableRecordInputDataColumn = {\n columnId: Scalars['ID']\n data: Scalars['JSON']\n}\n\nexport const SnippetLocation = {\n Body: 'BODY',\n Head: 'HEAD',\n} as const\n\nexport type SnippetLocation = (typeof SnippetLocation)[keyof typeof SnippetLocation]\n\nexport type SwatchFragment = {\n __typename: 'Swatch'\n id: string\n hue: number\n saturation: number\n lightness: number\n}\n\nexport type FileFragment = {\n __typename: 'File'\n id: string\n name: string\n extension: string | null\n publicUrl: string\n dimensions: { width: number; height: number } | null\n}\n\nexport type TypographyFragment = {\n __typename: 'Typography'\n id: string\n name: string\n style: Array<{\n deviceId: string\n value: {\n fontFamily: string | null\n lineHeight: number | null\n letterSpacing: number | null\n fontWeight: number | null\n textAlign: string | null\n uppercase: boolean | null\n underline: boolean | null\n strikethrough: boolean | null\n italic: boolean | null\n fontSize: { value: number | null; unit: string | null } | null\n color: { swatchId: string | null; alpha: number | null } | null\n }\n }>\n}\n\nexport type PagePathnameSliceFragment = {\n __typename: 'PagePathnameSlice'\n id: string\n pathname: string\n}\n\nexport type GlobalElementFragment = { __typename: 'GlobalElement'; id: string; data: Json }\n\nexport type LocalizedGlobalElementFragment = {\n __typename: 'LocalizedGlobalElement'\n id: string\n data: Json\n}\n\nexport type TableFragment = {\n __typename: 'Table'\n id: string\n name: string\n columns: Array<\n | { __typename: 'CheckboxTableColumn'; id: string; name: string }\n | { __typename: 'EmailTableColumn'; id: string; name: string }\n | { __typename: 'LongTextTableColumn'; id: string; name: string }\n | {\n __typename: 'MultipleSelectTableColumn'\n id: string\n name: string\n options: Array<{ id: string; name: string }>\n }\n | { __typename: 'NumberTableColumn'; id: string; name: string }\n | { __typename: 'PhoneNumberTableColumn'; id: string; name: string }\n | { __typename: 'SingleLineTextTableColumn'; id: string; name: string }\n | {\n __typename: 'SingleSelectTableColumn'\n id: string\n name: string\n options: Array<{ id: string; name: string }>\n }\n | { __typename: 'URLTableColumn'; id: string; name: string }\n >\n}\n\nexport type SnippetFragment = {\n __typename: 'Snippet'\n id: string\n name: string\n code: string\n cleanup: string | null\n location: SnippetLocation\n shouldAddToNewPages: boolean\n liveEnabled: boolean\n builderEnabled: boolean\n}\n\nexport type PageFragment = {\n __typename: 'Page'\n id: string\n snippets: Array<{\n __typename: 'Snippet'\n id: string\n name: string\n code: string\n cleanup: string | null\n location: SnippetLocation\n shouldAddToNewPages: boolean\n liveEnabled: boolean\n builderEnabled: boolean\n }>\n}\n\nexport type SiteFragment = {\n __typename: 'Site'\n id: string\n googleFonts: {\n edges: Array<{\n activeVariants: Array<{ specifier: string }>\n node: { family: string; variants: Array<{ specifier: string }> }\n } | null>\n }\n}\n\nexport type UnversionedResourcesQueryVariables = Exact<{\n fileIds: Array<Scalars['ID']> | Scalars['ID']\n tableIds: Array<Scalars['ID']> | Scalars['ID']\n}>\n\nexport type UnversionedResourcesQueryResult = {\n files: Array<{\n __typename: 'File'\n id: string\n name: string\n extension: string | null\n publicUrl: string\n dimensions: { width: number; height: number } | null\n } | null>\n tables: Array<{\n __typename: 'Table'\n id: string\n name: string\n columns: Array<\n | { __typename: 'CheckboxTableColumn'; id: string; name: string }\n | { __typename: 'EmailTableColumn'; id: string; name: string }\n | { __typename: 'LongTextTableColumn'; id: string; name: string }\n | {\n __typename: 'MultipleSelectTableColumn'\n id: string\n name: string\n options: Array<{ id: string; name: string }>\n }\n | { __typename: 'NumberTableColumn'; id: string; name: string }\n | { __typename: 'PhoneNumberTableColumn'; id: string; name: string }\n | { __typename: 'SingleLineTextTableColumn'; id: string; name: string }\n | {\n __typename: 'SingleSelectTableColumn'\n id: string\n name: string\n options: Array<{ id: string; name: string }>\n }\n | { __typename: 'URLTableColumn'; id: string; name: string }\n >\n } | null>\n}\n\nexport type SwatchQueryVariables = Exact<{\n swatchId: Scalars['ID']\n}>\n\nexport type SwatchQueryResult = {\n swatch: {\n __typename: 'Swatch'\n id: string\n hue: number\n saturation: number\n lightness: number\n } | null\n}\n\nexport type TypographyQueryVariables = Exact<{\n typographyId: Scalars['ID']\n}>\n\nexport type TypographyQueryResult = {\n typography: {\n __typename: 'Typography'\n id: string\n name: string\n style: Array<{\n deviceId: string\n value: {\n fontFamily: string | null\n lineHeight: number | null\n letterSpacing: number | null\n fontWeight: number | null\n textAlign: string | null\n uppercase: boolean | null\n underline: boolean | null\n strikethrough: boolean | null\n italic: boolean | null\n fontSize: { value: number | null; unit: string | null } | null\n color: { swatchId: string | null; alpha: number | null } | null\n }\n }>\n } | null\n}\n\nexport type TypographiesQueryVariables = Exact<{\n typographyIds: Array<Scalars['ID']> | Scalars['ID']\n}>\n\nexport type TypographiesQueryResult = {\n typographies: Array<{\n __typename: 'Typography'\n id: string\n name: string\n style: Array<{\n deviceId: string\n value: {\n fontFamily: string | null\n lineHeight: number | null\n letterSpacing: number | null\n fontWeight: number | null\n textAlign: string | null\n uppercase: boolean | null\n underline: boolean | null\n strikethrough: boolean | null\n italic: boolean | null\n fontSize: { value: number | null; unit: string | null } | null\n color: { swatchId: string | null; alpha: number | null } | null\n }\n }>\n } | null>\n}\n\nexport type GlobalElementQueryVariables = Exact<{\n globalElementId: Scalars['ID']\n}>\n\nexport type GlobalElementQueryResult = {\n globalElement: { __typename: 'GlobalElement'; id: string; data: Json } | null\n}\n\nexport type CreateTableRecordMutationVariables = Exact<{\n input: CreateTableRecordInput\n}>\n\nexport type CreateTableRecordMutationResult = { createTableRecord: { tableRecord: { id: string } } }\n"],"mappings":"AA0BO,MAAM,kBAAkB;AAAA,EAC7B,MAAM;AAAA,EACN,MAAM;AACR;","names":[]}
@@ -1,10 +1,10 @@
1
1
  import { GraphQLClient } from "./graphql/client";
2
- import { TableQuery, UnversionedResourcesQuery } from "./graphql/documents";
2
+ import { UnversionedResourcesQuery } from "./graphql/documents";
3
3
  class MakeswiftGraphQLApiClient {
4
4
  graphqlClient;
5
5
  constructor({ endpoint }) {
6
6
  this.graphqlClient = new GraphQLClient(endpoint, {
7
- "makeswift-runtime-version": "0.28.10-canary.7"
7
+ "makeswift-runtime-version": "0.28.10-canary.9"
8
8
  });
9
9
  }
10
10
  async getUnversionedResources({
@@ -13,13 +13,6 @@ class MakeswiftGraphQLApiClient {
13
13
  }) {
14
14
  return await this.graphqlClient.request(UnversionedResourcesQuery, { fileIds, tableIds });
15
15
  }
16
- async getTable(tableId) {
17
- const result = await this.graphqlClient.request(
18
- TableQuery,
19
- { tableId }
20
- );
21
- return result.table;
22
- }
23
16
  }
24
17
  export {
25
18
  MakeswiftGraphQLApiClient
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/api/graphql-api-client.ts"],"sourcesContent":["import { GraphQLClient } from './graphql/client'\n\nimport { TableQuery, UnversionedResourcesQuery } from './graphql/documents'\n\nimport {\n type TableQueryResult,\n type TableQueryVariables,\n type UnversionedResourcesQueryResult,\n type UnversionedResourcesQueryVariables,\n} from './graphql/generated/types'\n\nimport { type Table } from './types'\n\nexport class MakeswiftGraphQLApiClient {\n readonly graphqlClient: GraphQLClient\n\n constructor({ endpoint }: { endpoint: string }) {\n this.graphqlClient = new GraphQLClient(endpoint, {\n 'makeswift-runtime-version': PACKAGE_VERSION,\n })\n }\n\n async getUnversionedResources({\n fileIds,\n tableIds,\n }: UnversionedResourcesQueryVariables): Promise<UnversionedResourcesQueryResult> {\n return await this.graphqlClient.request<\n UnversionedResourcesQueryResult,\n UnversionedResourcesQueryVariables\n >(UnversionedResourcesQuery, { fileIds, tableIds })\n }\n\n async getTable(tableId: string): Promise<Table | null> {\n const result = await this.graphqlClient.request<TableQueryResult, TableQueryVariables>(\n TableQuery,\n { tableId },\n )\n\n return result.table\n }\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAE9B,SAAS,YAAY,iCAAiC;AAW/C,MAAM,0BAA0B;AAAA,EAC5B;AAAA,EAET,YAAY,EAAE,SAAS,GAAyB;AAC9C,SAAK,gBAAgB,IAAI,cAAc,UAAU;AAAA,MAC/C,6BAA6B;AAAA,IAC/B,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,wBAAwB;AAAA,IAC5B;AAAA,IACA;AAAA,EACF,GAAiF;AAC/E,WAAO,MAAM,KAAK,cAAc,QAG9B,2BAA2B,EAAE,SAAS,SAAS,CAAC;AAAA,EACpD;AAAA,EAEA,MAAM,SAAS,SAAwC;AACrD,UAAM,SAAS,MAAM,KAAK,cAAc;AAAA,MACtC;AAAA,MACA,EAAE,QAAQ;AAAA,IACZ;AAEA,WAAO,OAAO;AAAA,EAChB;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/api/graphql-api-client.ts"],"sourcesContent":["import { GraphQLClient } from './graphql/client'\n\nimport { UnversionedResourcesQuery } from './graphql/documents'\n\nimport {\n type UnversionedResourcesQueryResult,\n type UnversionedResourcesQueryVariables,\n} from './graphql/generated/types'\n\nexport class MakeswiftGraphQLApiClient {\n readonly graphqlClient: GraphQLClient\n\n constructor({ endpoint }: { endpoint: string }) {\n this.graphqlClient = new GraphQLClient(endpoint, {\n 'makeswift-runtime-version': PACKAGE_VERSION,\n })\n }\n\n async getUnversionedResources({\n fileIds,\n tableIds,\n }: UnversionedResourcesQueryVariables): Promise<UnversionedResourcesQueryResult> {\n return await this.graphqlClient.request<\n UnversionedResourcesQueryResult,\n UnversionedResourcesQueryVariables\n >(UnversionedResourcesQuery, { fileIds, tableIds })\n }\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAE9B,SAAS,iCAAiC;AAOnC,MAAM,0BAA0B;AAAA,EAC5B;AAAA,EAET,YAAY,EAAE,SAAS,GAAyB;AAC9C,SAAK,gBAAgB,IAAI,cAAc,UAAU;AAAA,MAC/C,6BAA6B;AAAA,IAC/B,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,wBAAwB;AAAA,IAC5B;AAAA,IACA;AAAA,EACF,GAAiF;AAC/E,WAAO,MAAM,KAAK,cAAc,QAG9B,2BAA2B,EAAE,SAAS,SAAS,CAAC;AAAA,EACpD;AACF;","names":[]}
@@ -2,12 +2,10 @@ import { configureClientStore } from "../state/api-client/client-store";
2
2
  import { ApiResourcesClient } from "./api-resources-client";
3
3
  class MakeswiftApiResourcesClient extends ApiResourcesClient {
4
4
  restApiClient;
5
- graphQlClient;
6
5
  constructor({
7
6
  fetch,
8
7
  apiKey,
9
8
  apiOrigin,
10
- graphqlApiEndpoint,
11
9
  preloadedState
12
10
  }) {
13
11
  super({
@@ -17,10 +15,6 @@ class MakeswiftApiResourcesClient extends ApiResourcesClient {
17
15
  const { MakeswiftRestAPIClient } = await import("./rest-api-client");
18
16
  return new MakeswiftRestAPIClient({ fetch, apiKey, apiOrigin });
19
17
  })();
20
- this.graphQlClient = (async () => {
21
- const { MakeswiftGraphQLApiClient } = await import("./graphql-api-client");
22
- return new MakeswiftGraphQLApiClient({ endpoint: graphqlApiEndpoint });
23
- })();
24
18
  }
25
19
  async fetchSwatchImpl(id, version) {
26
20
  return (await this.restApiClient).getSwatch(id, version);
@@ -41,7 +35,7 @@ class MakeswiftApiResourcesClient extends ApiResourcesClient {
41
35
  return (await this.restApiClient).getPagePathnameSlice(id, version, { locale });
42
36
  }
43
37
  async fetchTableImpl(id, _version) {
44
- return (await this.graphQlClient).getTable(id);
38
+ return (await this.restApiClient).getTable(id);
45
39
  }
46
40
  }
47
41
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/api/makeswift-api-resources-client.ts"],"sourcesContent":["import { type State as ApiClientState } from '../state/api-client/state'\nimport { configureClientStore } from '../state/api-client/client-store'\n\nimport {\n type File,\n type GlobalElement,\n type LocalizedGlobalElement,\n type PagePathnameSlice,\n type Swatch,\n type Table,\n type Typography,\n type HttpFetch,\n} from './types'\n\nimport { ApiResourcesClient } from './api-resources-client'\nimport { type SiteVersion } from './site-version'\n\n// see the comment in `MakeswiftApiResourcesClient` constructor below\nimport { type MakeswiftGraphQLApiClient } from './graphql-api-client'\nimport { type MakeswiftRestAPIClient } from './rest-api-client'\n\n/**\n * Server-side implementation that makes direct authenticated requests to the Makeswift API.\n * Requires an API key.\n *\n * For client-side usage, see `HostApiResourcesClient`, which goes through the host via\n * `/api/makeswift/...` endpoints.\n */\nexport class MakeswiftApiResourcesClient extends ApiResourcesClient {\n private restApiClient: Promise<MakeswiftRestAPIClient>\n private graphQlClient: Promise<MakeswiftGraphQLApiClient>\n\n constructor({\n fetch,\n apiKey,\n apiOrigin,\n graphqlApiEndpoint,\n preloadedState,\n }: {\n fetch: HttpFetch\n apiKey: string\n apiOrigin: string\n graphqlApiEndpoint: string\n preloadedState: Partial<ApiClientState>\n }) {\n super({\n store: configureClientStore({ preloadedState }),\n })\n\n // `MakeswiftApiResourcesClient` is used by the runtime and therefore will be imported\n // on the client; lazy import server-side REST/GraphQL clients to avoid unnecessarily\n // pulling their code into a client bundle.\n //\n // (we can't easily lazy-load `MakeswiftApiResourcesClient` itself, at it will make its\n // construction async, but because it shares most of its implementation with\n // `HostApiResourcesClient`, the overhead of this module on its own is negligible)\n this.restApiClient = (async () => {\n const { MakeswiftRestAPIClient } = await import('./rest-api-client')\n return new MakeswiftRestAPIClient({ fetch, apiKey, apiOrigin })\n })()\n\n this.graphQlClient = (async () => {\n const { MakeswiftGraphQLApiClient } = await import('./graphql-api-client')\n return new MakeswiftGraphQLApiClient({ endpoint: graphqlApiEndpoint })\n })()\n }\n\n protected async fetchSwatchImpl(id: string, version: SiteVersion | null): Promise<Swatch | null> {\n return (await this.restApiClient).getSwatch(id, version)\n }\n\n protected async fetchFileImpl(id: string, _version: SiteVersion | null): Promise<File | null> {\n // files are unversioned\n return (await this.restApiClient).getFile(id)\n }\n\n protected async fetchTypographyImpl(\n id: string,\n version: SiteVersion | null,\n ): Promise<Typography | null> {\n return (await this.restApiClient).getTypography(id, version)\n }\n\n protected async fetchGlobalElementImpl(\n id: string,\n version: SiteVersion | null,\n ): Promise<GlobalElement | null> {\n return (await this.restApiClient).getGlobalElement(id, version)\n }\n\n protected async fetchLocalizedGlobalElementImpl(\n id: string,\n version: SiteVersion | null,\n locale: string,\n ): Promise<LocalizedGlobalElement | null> {\n return (await this.restApiClient).getLocalizedGlobalElement(id, locale, version)\n }\n\n protected async fetchPagePathnameSliceImpl(\n id: string,\n version: SiteVersion | null,\n locale: string | null | undefined,\n ): Promise<PagePathnameSlice | null> {\n return (await this.restApiClient).getPagePathnameSlice(id, version, { locale })\n }\n\n protected async fetchTableImpl(id: string, _version: SiteVersion | null): Promise<Table | null> {\n // tables are unversioned\n return (await this.graphQlClient).getTable(id)\n }\n}\n"],"mappings":"AACA,SAAS,4BAA4B;AAarC,SAAS,0BAA0B;AAc5B,MAAM,oCAAoC,mBAAmB;AAAA,EAC1D;AAAA,EACA;AAAA,EAER,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAMG;AACD,UAAM;AAAA,MACJ,OAAO,qBAAqB,EAAE,eAAe,CAAC;AAAA,IAChD,CAAC;AASD,SAAK,iBAAiB,YAAY;AAChC,YAAM,EAAE,uBAAuB,IAAI,MAAM,OAAO,mBAAmB;AACnE,aAAO,IAAI,uBAAuB,EAAE,OAAO,QAAQ,UAAU,CAAC;AAAA,IAChE,GAAG;AAEH,SAAK,iBAAiB,YAAY;AAChC,YAAM,EAAE,0BAA0B,IAAI,MAAM,OAAO,sBAAsB;AACzE,aAAO,IAAI,0BAA0B,EAAE,UAAU,mBAAmB,CAAC;AAAA,IACvE,GAAG;AAAA,EACL;AAAA,EAEA,MAAgB,gBAAgB,IAAY,SAAqD;AAC/F,YAAQ,MAAM,KAAK,eAAe,UAAU,IAAI,OAAO;AAAA,EACzD;AAAA,EAEA,MAAgB,cAAc,IAAY,UAAoD;AAE5F,YAAQ,MAAM,KAAK,eAAe,QAAQ,EAAE;AAAA,EAC9C;AAAA,EAEA,MAAgB,oBACd,IACA,SAC4B;AAC5B,YAAQ,MAAM,KAAK,eAAe,cAAc,IAAI,OAAO;AAAA,EAC7D;AAAA,EAEA,MAAgB,uBACd,IACA,SAC+B;AAC/B,YAAQ,MAAM,KAAK,eAAe,iBAAiB,IAAI,OAAO;AAAA,EAChE;AAAA,EAEA,MAAgB,gCACd,IACA,SACA,QACwC;AACxC,YAAQ,MAAM,KAAK,eAAe,0BAA0B,IAAI,QAAQ,OAAO;AAAA,EACjF;AAAA,EAEA,MAAgB,2BACd,IACA,SACA,QACmC;AACnC,YAAQ,MAAM,KAAK,eAAe,qBAAqB,IAAI,SAAS,EAAE,OAAO,CAAC;AAAA,EAChF;AAAA,EAEA,MAAgB,eAAe,IAAY,UAAqD;AAE9F,YAAQ,MAAM,KAAK,eAAe,SAAS,EAAE;AAAA,EAC/C;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/api/makeswift-api-resources-client.ts"],"sourcesContent":["import { type State as ApiClientState } from '../state/api-client/state'\nimport { configureClientStore } from '../state/api-client/client-store'\n\nimport {\n type File,\n type GlobalElement,\n type LocalizedGlobalElement,\n type PagePathnameSlice,\n type Swatch,\n type Table,\n type Typography,\n type HttpFetch,\n} from './types'\n\nimport { ApiResourcesClient } from './api-resources-client'\nimport { type SiteVersion } from './site-version'\n\n// see the comment in `MakeswiftApiResourcesClient` constructor below\nimport { type MakeswiftRestAPIClient } from './rest-api-client'\n\n/**\n * Server-side implementation that makes direct authenticated requests to the Makeswift API.\n * Requires an API key.\n *\n * For client-side usage, see `HostApiResourcesClient`, which goes through the host via\n * `/api/makeswift/...` endpoints.\n */\nexport class MakeswiftApiResourcesClient extends ApiResourcesClient {\n private restApiClient: Promise<MakeswiftRestAPIClient>\n\n constructor({\n fetch,\n apiKey,\n apiOrigin,\n preloadedState,\n }: {\n fetch: HttpFetch\n apiKey: string\n apiOrigin: string\n preloadedState: Partial<ApiClientState>\n }) {\n super({\n store: configureClientStore({ preloadedState }),\n })\n\n // `MakeswiftApiResourcesClient` is used by the runtime and therefore will be imported\n // on the client; lazy import the server-side REST client to avoid unnecessarily\n // pulling its code into a client bundle.\n //\n // (we can't easily lazy-load `MakeswiftApiResourcesClient` itself, at it will make its\n // construction async, but because it shares most of its implementation with\n // `HostApiResourcesClient`, the overhead of this module on its own is negligible)\n this.restApiClient = (async () => {\n const { MakeswiftRestAPIClient } = await import('./rest-api-client')\n return new MakeswiftRestAPIClient({ fetch, apiKey, apiOrigin })\n })()\n }\n\n protected async fetchSwatchImpl(id: string, version: SiteVersion | null): Promise<Swatch | null> {\n return (await this.restApiClient).getSwatch(id, version)\n }\n\n protected async fetchFileImpl(id: string, _version: SiteVersion | null): Promise<File | null> {\n // files are unversioned\n return (await this.restApiClient).getFile(id)\n }\n\n protected async fetchTypographyImpl(\n id: string,\n version: SiteVersion | null,\n ): Promise<Typography | null> {\n return (await this.restApiClient).getTypography(id, version)\n }\n\n protected async fetchGlobalElementImpl(\n id: string,\n version: SiteVersion | null,\n ): Promise<GlobalElement | null> {\n return (await this.restApiClient).getGlobalElement(id, version)\n }\n\n protected async fetchLocalizedGlobalElementImpl(\n id: string,\n version: SiteVersion | null,\n locale: string,\n ): Promise<LocalizedGlobalElement | null> {\n return (await this.restApiClient).getLocalizedGlobalElement(id, locale, version)\n }\n\n protected async fetchPagePathnameSliceImpl(\n id: string,\n version: SiteVersion | null,\n locale: string | null | undefined,\n ): Promise<PagePathnameSlice | null> {\n return (await this.restApiClient).getPagePathnameSlice(id, version, { locale })\n }\n\n protected async fetchTableImpl(id: string, _version: SiteVersion | null): Promise<Table | null> {\n // tables are unversioned\n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localizedGlobalElement = await response.json();
112
112
  return localizedGlobalElement;
113
113
  }
114
+ async getTable(tableId) {
115
+ const response = await this.fetch(`v1/tables/${tableId}`, null);
116
+ if (!response.ok) {
117
+ const failedBody = await failedResponseBody(response);
118
+ if (response.status === 404)
119
+ return null;
120
+ throw new RestApiClientError(`Failed to get table '${tableId}'`, response, {
121
+ body: failedBody
122
+ });
123
+ }
124
+ const table = await response.json();
125
+ return table;
126
+ }
114
127
  async getPagePathnameSlices(pageIds, siteVersion, { locale }) {
115
128
  if (pageIds.length === 0)
116
129
  return [];
@@ -150,7 +163,7 @@ class MakeswiftRestAPIClient {
150
163
  const requestHeaders = new Headers({
151
164
  "x-api-key": this.apiKey,
152
165
  "makeswift-site-api-key": this.apiKey,
153
- "makeswift-runtime-version": "0.28.10-canary.7"
166
+ "makeswift-runtime-version": "0.28.10-canary.9"
154
167
  });
155
168
  if (siteVersion?.token) {
156
169
  requestUrl.searchParams.set("version", siteVersion.version);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/api/rest-api-client.ts"],"sourcesContent":["import ky, { HTTPError, isHTTPError, type KyInstance } from './ky'\n\nimport {\n type File,\n type GlobalElement,\n type LocalizedGlobalElement,\n type PagePathnameSlice,\n type Swatch,\n type Typography,\n type HttpFetch,\n} from './types'\n\nimport { type SiteVersion } from './site-version'\nimport * as Schema from './schema'\n\nconst RetryBackoffConfig = {\n MaxAttempts: 3,\n MaxDelayMs: 5_000,\n}\n\nexport class MakeswiftRestAPIClient {\n private _fetch: KyInstance\n\n readonly apiKey: string\n readonly apiOrigin: string\n\n constructor({\n fetch,\n apiKey,\n apiOrigin,\n }: {\n fetch: HttpFetch\n apiKey: string\n apiOrigin: string\n }) {\n this._fetch = ky.create({\n fetch,\n timeout: false,\n retry: {\n statusCodes: [429],\n limit: RetryBackoffConfig.MaxAttempts,\n backoffLimit: RetryBackoffConfig.MaxDelayMs,\n delay: attemptCount => 2 ** (attemptCount - 1) * 1000,\n jitter: true,\n },\n hooks: {\n beforeRetry: [\n async ({ request, error, retryCount }) => {\n console.warn(\n `Request to ${request.url} failed with ${error}. Retrying (${retryCount}/${RetryBackoffConfig.MaxAttempts})`,\n )\n // Drain the response body before retrying so we don't leak unconsumed\n // response bodies (see the comment on `failedResponseBody` below).\n if (isHTTPError(error)) await failedResponseBody(error.response)\n },\n ],\n },\n })\n\n this.apiKey = apiKey\n this.apiOrigin = apiOrigin\n }\n\n async getSwatch(swatchId: string, siteVersion: SiteVersion | null): Promise<Swatch | null> {\n const response = await this.fetch(`v3/swatches/${swatchId}`, siteVersion)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(`Failed to get swatch '${swatchId}'`, response, {\n body: failedBody,\n siteVersion,\n })\n }\n\n const swatch = await response.json()\n\n return swatch\n }\n\n async getFile(fileId: string): Promise<File | null> {\n const response = await this.fetch(`v1/files/${fileId}`, null)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(`Failed to get file '${fileId}'`, response, {\n body: failedBody,\n })\n }\n\n const file = await response.json()\n\n return file\n }\n\n async getTypography(\n typographyId: string,\n siteVersion: SiteVersion | null,\n ): Promise<Typography | null> {\n const response = await this.fetch(`v3/typographies/${typographyId}`, siteVersion)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(`Failed to get typography '${typographyId}'`, response, {\n body: failedBody,\n siteVersion,\n })\n }\n\n const typography = await response.json()\n\n return typography\n }\n\n async getGlobalElement(\n globalElementId: string,\n siteVersion: SiteVersion | null,\n ): Promise<GlobalElement | null> {\n const response = await this.fetch(`v3/global-elements/${globalElementId}`, siteVersion)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(`Failed to get global element '${globalElementId}'`, response, {\n body: failedBody,\n siteVersion,\n })\n }\n\n const globalElement = await response.json()\n\n return globalElement\n }\n\n async getLocalizedGlobalElement(\n globalElementId: string,\n locale: string,\n siteVersion: SiteVersion | null,\n ): Promise<LocalizedGlobalElement | null> {\n const response = await this.fetch(\n `v3/localized-global-elements/${globalElementId}?locale=${locale}`,\n siteVersion,\n )\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(\n `Failed to get localized global element '${globalElementId}'`,\n response,\n { body: failedBody, siteVersion, locale },\n )\n }\n\n const localizedGlobalElement = await response.json()\n\n return localizedGlobalElement\n }\n\n async getPagePathnameSlices(\n pageIds: string[],\n siteVersion: SiteVersion | null,\n { locale }: { locale?: string | null },\n ): Promise<(PagePathnameSlice | null)[]> {\n if (pageIds.length === 0) return []\n\n const url = new URL(`v3/page-pathname-slices/bulk`, this.apiOrigin)\n\n pageIds.forEach(id => url.searchParams.append('ids', id))\n if (locale != null) url.searchParams.set('locale', locale)\n\n const response = await this.fetch(url.pathname + url.search, siteVersion)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return []\n\n throw new RestApiClientError(\n `Failed to get page pathname slice(s) for ${pageIds.join(', ')}`,\n response,\n { body: failedBody, siteVersion, locale },\n )\n }\n\n const json = await response.json()\n\n const pagePathnameSlices = Schema.pagePathnameSlices.parse(json)\n\n // We're mapping the basePageId to be the id, because we're still using the GraphQL\n // fragment as our APIResource. The id on the APIResource needs to match the pageId\n // so that we can find the corresponding page pathname slice when we call getPagePathnameSlice(pageId).\n // TODO: Update this once we move away from the GraphQL fragments.\n return pagePathnameSlices.map(pagePathnameSlice => {\n if (pagePathnameSlice == null) return null\n\n return {\n ...pagePathnameSlice,\n id: pagePathnameSlice.basePageId,\n localizedPathname: pagePathnameSlice.localizedPathname ?? null,\n }\n })\n }\n\n async getPagePathnameSlice(\n pageId: string,\n siteVersion: SiteVersion | null,\n { locale }: { locale?: string | null } = {},\n ): Promise<PagePathnameSlice | null> {\n const pagePathnameSlices = await this.getPagePathnameSlices([pageId], siteVersion, { locale })\n\n return pagePathnameSlices.at(0) ?? null\n }\n\n protected async fetch(\n path: string,\n siteVersion: SiteVersion | null,\n init?: RequestInit,\n ): Promise<Response> {\n const requestUrl = new URL(path, this.apiOrigin)\n\n const requestHeaders = new Headers({\n 'x-api-key': this.apiKey,\n 'makeswift-site-api-key': this.apiKey,\n 'makeswift-runtime-version': PACKAGE_VERSION,\n })\n\n if (siteVersion?.token) {\n requestUrl.searchParams.set('version', siteVersion.version)\n requestHeaders.set('makeswift-preview-token', siteVersion.token)\n }\n\n if (init?.headers) {\n new Headers(init.headers).forEach((value, key) => {\n requestHeaders.set(key, value)\n })\n }\n\n try {\n return await this._fetch(requestUrl.toString(), {\n ...init,\n headers: requestHeaders,\n ...(siteVersion != null ? { cache: 'no-store' } : {}),\n })\n } catch (error) {\n if (error instanceof HTTPError) return error.response\n throw error\n }\n }\n}\n\n// This function attempts to consume the response body of a failed response, and\n// returns either the parsed JSON or raw text. This is useful for logging more\n// detailed error information when an API request fails.\n//\n// Cloudflare Worker Note: The Cloudflare Worker runtime has automatic deadlock\n// prevention (in the form of auto-cancelling responses) that triggers when too\n// many response bodies are unconsumed. This applies for error responses as\n// well. As such, in this client we use this function to consume the response\n// body whenever the request fails, even if we don't end up logging the body\n// itself, to avoid hitting the deadlock prevention.\nexport async function failedResponseBody(response: Response): Promise<unknown> {\n try {\n const text = await response.text()\n try {\n return JSON.parse(text)\n } catch {\n return text\n }\n } catch (e) {\n return `Failed to extract response body: ${e}`\n }\n}\n\nfunction responseError(response: Response): string {\n return `${response.status} ${response.statusText}`\n}\n\nexport class RestApiClientError extends Error {\n readonly status: number\n\n constructor(message: string, response: Response, cause: Record<string, unknown>) {\n super(`${message}: ${responseError(response)}`, { cause })\n\n this.name = 'RestApiClientError'\n this.status = response.status\n }\n}\n"],"mappings":"AAAA,OAAO,MAAM,WAAW,mBAAoC;AAa5D,YAAY,YAAY;AAExB,MAAM,qBAAqB;AAAA,EACzB,aAAa;AAAA,EACb,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,OAAO;AACZ,SAAK,SAAS,SAAS;AAAA,EACzB;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/api/rest-api-client.ts"],"sourcesContent":["import ky, { HTTPError, isHTTPError, type KyInstance } from './ky'\n\nimport {\n type File,\n type GlobalElement,\n type LocalizedGlobalElement,\n type PagePathnameSlice,\n type Swatch,\n type Table,\n type Typography,\n type HttpFetch,\n} from './types'\n\nimport { type SiteVersion } from './site-version'\nimport * as Schema from './schema'\n\nconst RetryBackoffConfig = {\n MaxAttempts: 3,\n MaxDelayMs: 5_000,\n}\n\nexport class MakeswiftRestAPIClient {\n private _fetch: KyInstance\n\n readonly apiKey: string\n readonly apiOrigin: string\n\n constructor({\n fetch,\n apiKey,\n apiOrigin,\n }: {\n fetch: HttpFetch\n apiKey: string\n apiOrigin: string\n }) {\n this._fetch = ky.create({\n fetch,\n timeout: false,\n retry: {\n statusCodes: [429],\n limit: RetryBackoffConfig.MaxAttempts,\n backoffLimit: RetryBackoffConfig.MaxDelayMs,\n delay: attemptCount => 2 ** (attemptCount - 1) * 1000,\n jitter: true,\n },\n hooks: {\n beforeRetry: [\n async ({ request, error, retryCount }) => {\n console.warn(\n `Request to ${request.url} failed with ${error}. Retrying (${retryCount}/${RetryBackoffConfig.MaxAttempts})`,\n )\n // Drain the response body before retrying so we don't leak unconsumed\n // response bodies (see the comment on `failedResponseBody` below).\n if (isHTTPError(error)) await failedResponseBody(error.response)\n },\n ],\n },\n })\n\n this.apiKey = apiKey\n this.apiOrigin = apiOrigin\n }\n\n async getSwatch(swatchId: string, siteVersion: SiteVersion | null): Promise<Swatch | null> {\n const response = await this.fetch(`v3/swatches/${swatchId}`, siteVersion)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(`Failed to get swatch '${swatchId}'`, response, {\n body: failedBody,\n siteVersion,\n })\n }\n\n const swatch = await response.json()\n\n return swatch\n }\n\n async getFile(fileId: string): Promise<File | null> {\n const response = await this.fetch(`v1/files/${fileId}`, null)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(`Failed to get file '${fileId}'`, response, {\n body: failedBody,\n })\n }\n\n const file = await response.json()\n\n return file\n }\n\n async getTypography(\n typographyId: string,\n siteVersion: SiteVersion | null,\n ): Promise<Typography | null> {\n const response = await this.fetch(`v3/typographies/${typographyId}`, siteVersion)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(`Failed to get typography '${typographyId}'`, response, {\n body: failedBody,\n siteVersion,\n })\n }\n\n const typography = await response.json()\n\n return typography\n }\n\n async getGlobalElement(\n globalElementId: string,\n siteVersion: SiteVersion | null,\n ): Promise<GlobalElement | null> {\n const response = await this.fetch(`v3/global-elements/${globalElementId}`, siteVersion)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(`Failed to get global element '${globalElementId}'`, response, {\n body: failedBody,\n siteVersion,\n })\n }\n\n const globalElement = await response.json()\n\n return globalElement\n }\n\n async getLocalizedGlobalElement(\n globalElementId: string,\n locale: string,\n siteVersion: SiteVersion | null,\n ): Promise<LocalizedGlobalElement | null> {\n const response = await this.fetch(\n `v3/localized-global-elements/${globalElementId}?locale=${locale}`,\n siteVersion,\n )\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(\n `Failed to get localized global element '${globalElementId}'`,\n response,\n { body: failedBody, siteVersion, locale },\n )\n }\n\n const localizedGlobalElement = await response.json()\n\n return localizedGlobalElement\n }\n\n async getTable(tableId: string): Promise<Table | null> {\n const response = await this.fetch(`v1/tables/${tableId}`, null)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return null\n\n throw new RestApiClientError(`Failed to get table '${tableId}'`, response, {\n body: failedBody,\n })\n }\n\n const table = await response.json()\n\n return table\n }\n\n async getPagePathnameSlices(\n pageIds: string[],\n siteVersion: SiteVersion | null,\n { locale }: { locale?: string | null },\n ): Promise<(PagePathnameSlice | null)[]> {\n if (pageIds.length === 0) return []\n\n const url = new URL(`v3/page-pathname-slices/bulk`, this.apiOrigin)\n\n pageIds.forEach(id => url.searchParams.append('ids', id))\n if (locale != null) url.searchParams.set('locale', locale)\n\n const response = await this.fetch(url.pathname + url.search, siteVersion)\n\n if (!response.ok) {\n const failedBody = await failedResponseBody(response)\n if (response.status === 404) return []\n\n throw new RestApiClientError(\n `Failed to get page pathname slice(s) for ${pageIds.join(', ')}`,\n response,\n { body: failedBody, siteVersion, locale },\n )\n }\n\n const json = await response.json()\n\n const pagePathnameSlices = Schema.pagePathnameSlices.parse(json)\n\n // We're mapping the basePageId to be the id, because we're still using the GraphQL\n // fragment as our APIResource. The id on the APIResource needs to match the pageId\n // so that we can find the corresponding page pathname slice when we call getPagePathnameSlice(pageId).\n // TODO: Update this once we move away from the GraphQL fragments.\n return pagePathnameSlices.map(pagePathnameSlice => {\n if (pagePathnameSlice == null) return null\n\n return {\n ...pagePathnameSlice,\n id: pagePathnameSlice.basePageId,\n localizedPathname: pagePathnameSlice.localizedPathname ?? null,\n }\n })\n }\n\n async getPagePathnameSlice(\n pageId: string,\n siteVersion: SiteVersion | null,\n { locale }: { locale?: string | null } = {},\n ): Promise<PagePathnameSlice | null> {\n const pagePathnameSlices = await this.getPagePathnameSlices([pageId], siteVersion, { locale })\n\n return pagePathnameSlices.at(0) ?? null\n }\n\n protected async fetch(\n path: string,\n siteVersion: SiteVersion | null,\n init?: RequestInit,\n ): Promise<Response> {\n const requestUrl = new URL(path, this.apiOrigin)\n\n const requestHeaders = new Headers({\n 'x-api-key': this.apiKey,\n 'makeswift-site-api-key': this.apiKey,\n 'makeswift-runtime-version': PACKAGE_VERSION,\n })\n\n if (siteVersion?.token) {\n requestUrl.searchParams.set('version', siteVersion.version)\n requestHeaders.set('makeswift-preview-token', siteVersion.token)\n }\n\n if (init?.headers) {\n new Headers(init.headers).forEach((value, key) => {\n requestHeaders.set(key, value)\n })\n }\n\n try {\n return await this._fetch(requestUrl.toString(), {\n ...init,\n headers: requestHeaders,\n ...(siteVersion != null ? { cache: 'no-store' } : {}),\n })\n } catch (error) {\n if (error instanceof HTTPError) return error.response\n throw error\n }\n }\n}\n\n// This function attempts to consume the response body of a failed response, and\n// returns either the parsed JSON or raw text. This is useful for logging more\n// detailed error information when an API request fails.\n//\n// Cloudflare Worker Note: The Cloudflare Worker runtime has automatic deadlock\n// prevention (in the form of auto-cancelling responses) that triggers when too\n// many response bodies are unconsumed. This applies for error responses as\n// well. As such, in this client we use this function to consume the response\n// body whenever the request fails, even if we don't end up logging the body\n// itself, to avoid hitting the deadlock prevention.\nexport async function failedResponseBody(response: Response): Promise<unknown> {\n try {\n const text = await response.text()\n try {\n return JSON.parse(text)\n } catch {\n return text\n }\n } catch (e) {\n return `Failed to extract response body: ${e}`\n }\n}\n\nfunction responseError(response: Response): string {\n return `${response.status} ${response.statusText}`\n}\n\nexport class RestApiClientError extends Error {\n readonly status: number\n\n constructor(message: string, response: Response, cause: Record<string, unknown>) {\n super(`${message}: ${responseError(response)}`, { cause })\n\n this.name = 'RestApiClientError'\n this.status = response.status\n }\n}\n"],"mappings":"AAAA,OAAO,MAAM,WAAW,mBAAoC;AAc5D,YAAY,YAAY;AAExB,MAAM,qBAAqB;AAAA,EACzB,aAAa;AAAA,EACb,YAAY;AACd;AAEO,MAAM,uBAAuB;AAAA,EAC1B;AAAA,EAEC;AAAA,EACA;AAAA,EAET,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAIG;AACD,SAAK,SAAS,GAAG,OAAO;AAAA,MACtB;AAAA,MACA,SAAS;AAAA,MACT,OAAO;AAAA,QACL,aAAa,CAAC,GAAG;AAAA,QACjB,OAAO,mBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,OAAO,kBAAgB,MAAM,eAAe,KAAK;AAAA,QACjD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AAEzD,SAAK,OAAO;AACZ,SAAK,SAAS,SAAS;AAAA,EACzB;AACF;","names":[]}
@@ -8,7 +8,7 @@ async function manifestHandler(req, { apiKey, manifest }) {
8
8
  return ApiResponse.json({ message: "Unauthorized" }, { status: 401 });
9
9
  }
10
10
  return ApiResponse.json({
11
- version: "0.28.10-canary.7",
11
+ version: "0.28.10-canary.9",
12
12
  interactionMode: true,
13
13
  clientSideNavigation: false,
14
14
  elementFromPoint: false,
@@ -674,9 +674,6 @@ Received "${apiKey}" instead.`
674
674
  );
675
675
  }
676
676
  }
677
- async getTable(tableId) {
678
- return this.graphqlClient.getTable(tableId);
679
- }
680
677
  getTranslatableData(elementTree) {
681
678
  return getTranslatableContent(this.getElementDescriptors(), elementTree);
682
679
  }