repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
jbwyme/action-destinations
packages/destination-actions/src/destinations/slack/postToChannel/index.ts
import type { ActionDefinition } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' const action: ActionDefinition<Settings, Payload> = { title: 'Post Message', description: 'Post a message to a Slack channel.', fields: { url: { ...
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-analytics-4/__tests__/viewCart.test.ts
<filename>packages/destination-actions/src/destinations/google-analytics-4/__tests__/viewCart.test.ts import nock from 'nock' import { createTestEvent, createTestIntegration } from '@segment/actions-core' import ga4 from '../index' const testDestination = createTestIntegration(ga4) const apiSecret = '<KEY>' const meas...
jbwyme/action-destinations
packages/destination-actions/src/destinations/customerio/triggerCampaign/index.ts
<gh_stars>0 import type { ActionDefinition, DynamicFieldResponse, RequestFn } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' interface Campaigns { campaigns: Campaign[] } interface Campaign { id: string name: string } const idAut...
jbwyme/action-destinations
packages/cli/templates/destinations/custom-auth/index.ts
<filename>packages/cli/templates/destinations/custom-auth/index.ts import type { DestinationDefinition } from '@segment/actions-core' import type { Settings } from './generated-types' const destination: DestinationDefinition<Settings> = { name: '{{name}}', slug: '{{slug}}', mode: 'cloud', authentication: { ...
jbwyme/action-destinations
packages/cli/templates/destinations/browser/__tests__/index.test.ts
<filename>packages/cli/templates/destinations/browser/__tests__/index.test.ts import { Analytics, Context } from '@segment/analytics-next' import * as jsdom from 'jsdom' import plugins, { destination } from '../index' describe('{{name}}', () => {})
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-analytics-4/customEvent/index.ts
<filename>packages/destination-actions/src/destinations/google-analytics-4/customEvent/index.ts<gh_stars>0 import type { ActionDefinition } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' const action: ActionDefinition<Settings, Payload> ...
jbwyme/action-destinations
packages/destination-actions/src/destinations/customerio/createUpdatePerson/generated-types.ts
<filename>packages/destination-actions/src/destinations/customerio/createUpdatePerson/generated-types.ts // Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * ID used to uniquely identify person in Customer.io. */ id: string /** * Anonymous ID to uniquely identify person in Custo...
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-enhanced-conversions/generated-types.ts
// Generated file. DO NOT MODIFY IT BY HAND. export interface Settings { /** * Tracking id that uniquely identifies your advertiser account. */ conversionTrackingId: string }
jbwyme/action-destinations
packages/destination-actions/src/destinations/customerio/__tests__/trackEvent.test.ts
<gh_stars>0 import nock from 'nock' import { createTestEvent, createTestIntegration } from '@segment/actions-core' import CustomerIO from '../index' const testDestination = createTestIntegration(CustomerIO) const trackEventService = nock('https://track.customer.io/api/v1') describe('CustomerIO', () => { describe('t...
jbwyme/action-destinations
packages/cli/src/commands/push.ts
<gh_stars>0 import { Command, flags } from '@oclif/command' import type { DestinationDefinition as CloudDestinationDefinition, MinimalInputField } from '@segment/actions-core' import { fieldsToJsonSchema } from '@segment/actions-core' import { manifest as cloudManifest, ManifestEntry as CloudManifest } from '@segment/a...
jbwyme/action-destinations
packages/destination-actions/src/destinations/pipedrive/createUpdateOrganization/index.ts
<gh_stars>0 import dayjs from '../../../lib/dayjs' import { get } from '@segment/actions-core' import type { ActionDefinition } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' const action: ActionDefinition<Settings, Payload> = { title:...
jbwyme/action-destinations
packages/core/src/mapping-kit/index.ts
<gh_stars>0 import { get } from '../get' import { JSONObject, JSONValue, JSONLike, JSONLikeObject } from '../json-object' import { isDirective } from './is-directive' import { render } from './placeholders' import { realTypeOf, isObject, isArray } from '../real-type-of' import { removeUndefined } from '../remove-undefi...
jbwyme/action-destinations
packages/cli/templates/destinations/basic-auth/index.ts
import type { DestinationDefinition } from '@segment/actions-core' import type { Settings } from './generated-types' const destination: DestinationDefinition<Settings> = { name: '{{name}}', slug: '{{slug}}', mode: 'cloud', authentication: { scheme: 'basic', fields: { username: { label: '...
jbwyme/action-destinations
packages/destination-actions/src/destinations/pipedrive/createUpdatePerson/generated-types.ts
// Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * Identifier used to find existing person in Pipedrive. Can be an email, name, phone number, or custom field value. Custom person fields may be included by using the long hash keys of the custom fields. These look like "33595c732cd7a027c4...
jbwyme/action-destinations
packages/core/src/destination-kit/action.ts
import { EventEmitter } from 'events' import createRequestClient from '../create-request-client' import { JSONLikeObject, JSONObject } from '../json-object' import { transform } from '../mapping-kit' import { fieldsToJsonSchema } from './fields-to-jsonschema' import { Response } from '../fetch' import type { ModifiedRe...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/braze/generated-types.ts
// Generated file. DO NOT MODIFY IT BY HAND. export interface Settings { /** * The version of the SDK to use. Defaults to 3.3. */ sdkVersion: string /** * Found in the Braze Dashboard under Settings → Manage Settings → Apps → Web */ api_key: string /** * Your Braze SDK endpoint. [See more deta...
jbwyme/action-destinations
packages/destination-actions/src/destinations/customerio/createUpdatePerson/index.ts
<reponame>jbwyme/action-destinations<filename>packages/destination-actions/src/destinations/customerio/createUpdatePerson/index.ts import dayjs from '../../../lib/dayjs' import type { ActionDefinition } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './gener...
jbwyme/action-destinations
packages/destination-actions/src/destinations/personas-messaging-twilio/sendSms/index.ts
<filename>packages/destination-actions/src/destinations/personas-messaging-twilio/sendSms/index.ts import Mustache from 'mustache' import type { ActionDefinition, RequestOptions } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' const getP...
jbwyme/action-destinations
packages/destination-actions/src/destinations/personas-messaging-twilio/__tests__/send-sms.test.ts
<gh_stars>0 import nock from 'nock' import { createTestEvent, createTestIntegration } from '@segment/actions-core' import Twilio from '..' const twilio = createTestIntegration(Twilio) const timestamp = new Date().toISOString() for (const environment of ['stage', 'production']) { const settings = { twilioAccount...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/braze/__tests__/debounce.test.ts
import { Analytics, Context } from '@segment/analytics-next' import * as jsdom from 'jsdom' import brazeDestination from '../index' let ajs: Analytics describe('debounce', () => { beforeEach(async () => { jest.restoreAllMocks() jest.resetAllMocks() const html = ` <!DOCTYPE html> <head> <scr...
jbwyme/action-destinations
packages/destination-actions/src/destinations/customerio/createUpdateDevice/index.ts
import dayjs from '../../../lib/dayjs' import type { ActionDefinition } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' const action: ActionDefinition<Settings, Payload> = { title: 'Create or Update Device', description: "Update a per...
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-enhanced-conversions/postConversion/index.ts
import { ActionDefinition, IntegrationError } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' import { formatCity, formatEmail, formatFirstName, formatLastName, formatPhone, formatStreet, formatRegion, cleanData } from './f...
jbwyme/action-destinations
packages/cli/src/lib/destinations.ts
<filename>packages/cli/src/lib/destinations.ts import type { DestinationDefinition as CloudDestinationDefinition } from '@segment/actions-core' import type { BrowserDestinationDefinition } from '@segment/browser-destinations' import path from 'path' import { clearRequireCache } from './require-cache' import { OAUTH_SCH...
jbwyme/action-destinations
packages/destination-actions/src/destinations/customerio/trackEvent/generated-types.ts
// Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * ID of the person who triggered this event. */ id?: string /** * Anonymous ID of the person who triggered this event. */ anonymous_id?: string /** * Name of the event */ name: string /** * Override event typ...
jbwyme/action-destinations
packages/destination-actions/src/destinations/pipedrive/generated-types.ts
// Generated file. DO NOT MODIFY IT BY HAND. export interface Settings { /** * Pipedrive domain. This is found in Pipedrive in Settings > Company settings > Company domain. */ domain: string /** * Pipedrive API token. This is found in Pipedrive in Settings > Personal preferences > API > Your personal AP...
jbwyme/action-destinations
packages/destination-actions/src/destinations/pipedrive/createUpdatePerson/index.ts
import dayjs from '../../../lib/dayjs' import { get } from '@segment/actions-core' import type { ActionDefinition } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' interface Organizations { data: Organization[] additional_data: { ...
jbwyme/action-destinations
packages/destination-actions/src/destinations/personas-messaging-twilio/index.ts
import type { DestinationDefinition } from '@segment/actions-core' import type { Settings } from './generated-types' import sendSms from './sendSms' const destination: DestinationDefinition<Settings> = { name: 'Actions Personas Messaging Twilio', mode: 'cloud', authentication: { scheme: 'custom', fields:...
jbwyme/action-destinations
packages/destination-actions/src/destinations/personas-messaging-sendgrid/generated-types.ts
<reponame>jbwyme/action-destinations<filename>packages/destination-actions/src/destinations/personas-messaging-sendgrid/generated-types.ts // Generated file. DO NOT MODIFY IT BY HAND. export interface Settings { /** * The Api Key for your sendGrid account */ sendGridApiKey: string /** * Profile API Envi...
jbwyme/action-destinations
packages/destination-actions/src/destinations/personas-messaging-sendgrid/__tests__/send-email.test.ts
<gh_stars>0 import nock from 'nock' import { createTestEvent, createTestIntegration } from '@segment/actions-core' import Sendgrid from '..' const sendgrid = createTestIntegration(Sendgrid) const timestamp = new Date().toISOString() for (const environment of ['stage', 'production']) { const settings = { sendGri...
jbwyme/action-destinations
packages/core/src/request-client.ts
<gh_stars>0 import AbortController from 'abort-controller' import { CustomError } from 'ts-custom-error' import { URL, URLSearchParams } from 'url' import fetch, { Headers, Request, Response } from './fetch' import { isObject } from './real-type-of' /** * The supported request options you can use with the request cli...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/fullstory/generated-types.ts
<gh_stars>0 // Generated file. DO NOT MODIFY IT BY HAND. export interface Settings { /** * The organization ID for FullStory */ orgId: string }
jbwyme/action-destinations
packages/destination-actions/src/destinations/amplitude/mapUser/generated-types.ts
// Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * The User ID to be associated */ user_id?: string /** * The global User ID to associate to */ global_user_id?: string /** * Amplitude has a default minimum id lenght of 5 characters for user_id and device_id fields. T...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/braze/__tests__/trackPurchase.test.ts
import appboy from '@braze/web-sdk' import { Analytics, Context } from '@segment/analytics-next' import * as jsdom from 'jsdom' import brazeDestination from '../index' beforeEach(async () => { jest.restoreAllMocks() jest.resetAllMocks() const html = ` <!DOCTYPE html> <head> <script>'hi'</script> ...
jbwyme/action-destinations
packages/destination-actions/src/destinations/personas-messaging-sendgrid/sendEmail/generated-types.ts
<gh_stars>0 // Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * User ID in Segment */ userId: string /** * Email to send to when testing */ toEmail?: string /** * From Email */ fromEmail: string /** * From Name displayed to end user email */ fromName: s...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/braze/index.ts
<reponame>jbwyme/action-destinations import type { Settings } from './generated-types' import type { BrowserDestinationDefinition } from '../../lib/browser-destinations' import { browserDestination } from '../../runtime/shim' import appboy from '@braze/web-sdk' import trackEvent from './trackEvent' import updateUserPro...
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-analytics-4/__tests__/purchase.test.ts
<gh_stars>0 import nock from 'nock' import { createTestEvent, createTestIntegration } from '@segment/actions-core' import ga4 from '../index' const testDestination = createTestIntegration(ga4) const apiSecret = '<KEY>' const measurementId = 'G-TESTTOKEN' describe('GA4', () => { describe('Purchase', () => { it('...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/intercom/generated-types.ts
// Generated file. DO NOT MODIFY IT BY HAND. export interface Settings { /** * Your workspace ID (this appears as app _id in your code) is a unique code assigned to your app when you create it in Intercom. https://www.intercom.com/help/en/articles/3539-where-can-i-find-my-workspace-id-app-id */ app_id: strin...
jbwyme/action-destinations
packages/destination-actions/src/destinations/customerio/index.ts
<gh_stars>0 import { defaultValues } from '@segment/actions-core' import createUpdateDevice from './createUpdateDevice' import createUpdatePerson from './createUpdatePerson' import trackEvent from './trackEvent' import triggerCampaign from './triggerCampaign' import type { DestinationDefinition } from '@segment/actions...
jbwyme/action-destinations
packages/cli/templates/actions/empty-browser-action/__tests__/index.test.ts
<gh_stars>0 import { Analytics, Context } from '@segment/analytics-next' import * as jsdom from 'jsdom' import { destination } from '../../index' describe('{{destination}}.{{slug}}', () => { // TODO: Test your action })
jbwyme/action-destinations
packages/destination-actions/src/destinations/amplitude/index.ts
import type { DestinationDefinition } from '@segment/actions-core' import { defaultValues } from '@segment/actions-core' import identifyUser from './identifyUser' import logEvent from './logEvent' import mapUser from './mapUser' import groupIdentifyUser from './groupIdentifyUser' import type { Settings } from './genera...
jbwyme/action-destinations
packages/destination-actions/src/destinations/braze/trackPurchase/generated-types.ts
<filename>packages/destination-actions/src/destinations/braze/trackPurchase/generated-types.ts // Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * The unique user identifier */ external_id?: string /** * A user alias object. See [the docs](https://www.braze.com/docs/api/objects...
jbwyme/action-destinations
packages/core/src/get.ts
<reponame>jbwyme/action-destinations /** * Lightweight alternative to lodash.get with similar coverage * Supports basic path lookup via dot notation `'foo.bar[0].baz'` or an array ['foo', 'bar', '0', 'baz'] */ export function get<T = unknown, Default = undefined>( // eslint-disable-next-line @typescript-eslint/no-...
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-analytics-4/__tests__/login.test.ts
<filename>packages/destination-actions/src/destinations/google-analytics-4/__tests__/login.test.ts import nock from 'nock' import { createTestEvent, createTestIntegration } from '@segment/actions-core' import ga4 from '../index' const testDestination = createTestIntegration(ga4) const apiSecret = '<KEY>' const measure...
jbwyme/action-destinations
packages/core/src/create-test-integration.ts
import { createTestEvent } from './create-test-event' import { Destination } from './destination-kit' import { mapValues } from './map-values' import type { DestinationDefinition } from './destination-kit' import type { JSONObject } from './json-object' import type { SegmentEvent } from './segment-event' import { AuthT...
jbwyme/action-destinations
packages/core/src/__tests__/destination-kit.test.ts
import { Destination, DestinationDefinition } from '../destination-kit' import { JSONObject } from '../json-object' import { SegmentEvent } from '../segment-event' const destinationCustomAuth: DestinationDefinition<JSONObject> = { name: 'Google Analytics 4', mode: 'cloud', authentication: { scheme: 'custom',...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/intercom/show/index.ts
/* eslint-disable @typescript-eslint/no-unsafe-call */ import type { BrowserActionDefinition } from '../../../lib/browser-destinations' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' const action: BrowserActionDefinition<Settings, Intercom_.IntercomStatic, Payload> ...
jbwyme/action-destinations
packages/cli/src/lib/control-plane-client.ts
<gh_stars>0 import { controlPlaneService, DestinationMetadata, DestinationMetadataAction, DestinationMetadataActionCreateInput, DestinationMetadataActionsUpdateInput, DestinationMetadataUpdateInput, DestinationSubscriptionPresetInput, RemotePlugin } from '../lib/control-plane-service' const NOOP_CONTEX...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/braze/__tests__/initialization.test.ts
import appboy from '@braze/web-sdk' import { Analytics, Context } from '@segment/analytics-next' import * as jsdom from 'jsdom' import brazeDestination from '../index' import { destination } from '../index' describe('initialization', () => { const settings = { safariWebsitePushId: 'safari', allowCrawlerActiv...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/braze/__tests__/integration.test.ts
<gh_stars>0 import { Analytics, Context } from '@segment/analytics-next' import * as jsdom from 'jsdom' import braze, { destination } from '..' import type { Subscription } from '../../../lib/browser-destinations' const example: Subscription[] = [ { partnerAction: 'trackEvent', name: 'Log Custom Event', ...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/fullstory/setUserVars/index.ts
<reponame>jbwyme/action-destinations<gh_stars>0 import type { BrowserActionDefinition } from '../../../lib/browser-destinations' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' import * as FullStory from '@fullstory/browser' // Change from unknown to the partner SDK ...
jbwyme/action-destinations
packages/core/src/destination-kit/fields-to-jsonschema.ts
import { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName } from 'json-schema' import type { InputField, GlobalSetting, FieldTypeName, Optional } from './types' function toJsonSchemaType(type: FieldTypeName): JSONSchema4TypeName | JSONSchema4TypeName[] { switch (type) { case 'string': case 'text': case ...
jbwyme/action-destinations
packages/core/src/schema-validation.ts
<reponame>jbwyme/action-destinations // @ts-ignore no types import { AggregateAjvError } from '@segment/ajv-human-errors' import Ajv from 'ajv' import dayjs from 'dayjs' const ajv = new Ajv({ // Coerce types to be a bit more liberal. coerceTypes: true, // Return all validation errors, not just the first. allEr...
jbwyme/action-destinations
packages/cli/src/commands/push-browser-destinations.ts
<reponame>jbwyme/action-destinations import { Command, flags } from '@oclif/command' import execa from 'execa' import chalk from 'chalk' import { manifest } from '@segment/browser-destinations' import ora from 'ora' import { assetPath } from '../config' import type { RemotePlugin } from '../lib/control-plane-service' i...
jbwyme/action-destinations
packages/destination-actions/src/destinations/amplitude/mapUser/index.ts
import { URLSearchParams } from 'url' import type { ActionDefinition } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' const action: ActionDefinition<Settings, Payload> = { title: 'Map User', description: 'Merge two users together tha...
jbwyme/action-destinations
packages/destination-actions/src/destinations/braze/updateUserProfile/index.ts
<reponame>jbwyme/action-destinations<gh_stars>0 import { omit, removeUndefined, IntegrationError } from '@segment/actions-core' import type { ActionDefinition } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' import dayjs from '../../../li...
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-enhanced-conversions/postConversion/formatter.ts
<filename>packages/destination-actions/src/destinations/google-enhanced-conversions/postConversion/formatter.ts import { createHash } from 'crypto' /** * Acceptable data types for k:v pairs. */ type DataValues = Record<string, string | string[] | number | undefined> /** * Removes all k:v pairs where the value is f...
jbwyme/action-destinations
packages/destination-actions/src/destinations/amplitude/identifyUser/index.ts
<filename>packages/destination-actions/src/destinations/amplitude/identifyUser/index.ts import { URLSearchParams } from 'url' import { ActionDefinition, omit, removeUndefined } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' import { conve...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/amplitude-plugins/sessionId/__tests__/sessionId.test.ts
<gh_stars>0 import { Analytics, Context, Plugin } from '@segment/analytics-next' import * as jsdom from 'jsdom' import browserPluginsDestination from '../..' import { Subscription } from '../../../../lib/browser-destinations' expect.extend({ toBeWithinOneSecondOf(got, expected) { if (typeof got === 'string') { ...
jbwyme/action-destinations
packages/destination-actions/src/destinations/slack/postToChannel/generated-types.ts
<gh_stars>0 // Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * Slack webhook URL. */ url: string /** * The text message to post to Slack. You can use [Slack's formatting syntax.](https://api.slack.com/reference/surfaces/formatting) */ text: string /** * Slack channel...
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-analytics-4/customEvent/generated-types.ts
<reponame>jbwyme/action-destinations // Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * Uniquely identifies a user instance of a web client. */ clientId: string /** * The unique name of the custom event created in GA4. */ name: string /** * The event parameters to se...
jbwyme/action-destinations
packages/destination-actions/src/destinations/twilio/sendSms/index.ts
<reponame>jbwyme/action-destinations<filename>packages/destination-actions/src/destinations/twilio/sendSms/index.ts import { URLSearchParams } from 'url' import type { ActionDefinition } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' con...
jbwyme/action-destinations
packages/core/src/index.ts
export { Destination, fieldsToJsonSchema } from './destination-kit' export { getAuthData } from './destination-kit/parse-settings' export { transform } from './mapping-kit' export { createTestEvent } from './create-test-event' export { createTestIntegration } from './create-test-integration' export { defaultValues } fr...
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-analytics-4/__tests__/beginCheckout.test.ts
<reponame>jbwyme/action-destinations<filename>packages/destination-actions/src/destinations/google-analytics-4/__tests__/beginCheckout.test.ts import nock from 'nock' import { createTestEvent, createTestIntegration } from '@segment/actions-core' import ga4 from '../index' const testDestination = createTestIntegration(...
jbwyme/action-destinations
packages/cli/src/lib/server.ts
<filename>packages/cli/src/lib/server.ts<gh_stars>0 import express from 'express' import http from 'http' import { once } from 'lodash' import logger from './logger' import path from 'path' import { loadDestination } from './destinations' import { Destination, DestinationDefinition as CloudDestinationDefinition } from ...
jbwyme/action-destinations
packages/destination-actions/src/destinations/customerio/createUpdateDevice/generated-types.ts
<reponame>jbwyme/action-destinations // Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * ID of the person that this device belongs to. */ person_id: string /** * Unique ID for this device. */ device_id: string /** * The device platform. */ platform: string /** ...
jbwyme/action-destinations
packages/destination-actions/src/destinations/amplitude/user-agent.ts
import UaParser from '@amplitude/ua-parser-js' interface ParsedUA { os_name?: string os_version?: string device_model?: string } export function parseUserAgentProperties(userAgent?: string): ParsedUA { if (!userAgent) { return {} } // eslint-disable-next-line @typescript-eslint/no-unsafe-call const...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/fullstory/__tests__/fullstory.test.ts
<reponame>jbwyme/action-destinations<filename>packages/browser-destinations/src/destinations/fullstory/__tests__/fullstory.test.ts import * as FullStory from '@fullstory/browser' import { Analytics, Context } from '@segment/analytics-next' import * as jsdom from 'jsdom' import fullstory, { destination } from '..' impor...
jbwyme/action-destinations
packages/core/src/mapping-kit/validate.ts
<reponame>jbwyme/action-destinations import AggregateError from 'aggregate-error' import { CustomError } from 'ts-custom-error' import { isDirective } from './is-directive' import { isObject, realTypeOf, Dictionary } from '../real-type-of' class ValidationError extends CustomError { constructor(message: string, stac...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/intercom/__tests__/intercom.test.ts
<reponame>jbwyme/action-destinations import { Analytics, Context } from '@segment/analytics-next' import * as jsdom from 'jsdom' import intercomPlugins, { destination } from '..' import { Subscription } from '../../../lib/browser-destinations' const example: Subscription[] = [ { partnerAction: 'show', name: ...
jbwyme/action-destinations
packages/core/src/destination-kit/types.ts
import type { RequestOptions } from '../request-client' import type { JSONObject } from '../json-object' import { AuthTokens } from './parse-settings' export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K> export interface Result { output?: JSONObject | string | null | undefined error?: JSO...
jbwyme/action-destinations
packages/destination-actions/src/destinations/amplitude/generated-types.ts
// Generated file. DO NOT MODIFY IT BY HAND. export interface Settings { /** * Amplitude project API key. You can find this key in the "General" tab of your Amplitude project. */ apiKey: string /** * Amplitude project secret key. You can find this key in the "General" tab of your Amplitude project. *...
jbwyme/action-destinations
packages/destination-actions/src/destinations/braze/__tests__/braze.test.ts
import nock from 'nock' import { createTestEvent, createTestIntegration } from '@segment/actions-core' import Braze from '../index' const testDestination = createTestIntegration(Braze) const receivedAt = '2021-08-03T17:40:04.055Z' const settings = { app_id: 'my-app-id', api_key: 'my-api-key', endpoint: 'https://...
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-analytics-4/viewPromotion/index.ts
import { ActionDefinition, IntegrationError } from '@segment/actions-core' import { CURRENCY_ISO_CODES } from '../constants' import { PromotionProductItem } from '../ga4-types' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' /** * Following GA4 View Promotion Spec a...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/index.ts
import type { BrowserDestinationDefinition } from '../lib/browser-destinations' import path from 'path' type MetadataId = string export interface ManifestEntry { // eslint-disable-next-line @typescript-eslint/no-explicit-any definition: BrowserDestinationDefinition<any, any> directory: string path: string } ...
jbwyme/action-destinations
packages/destination-actions/src/destinations/pipedrive/index.ts
import createUpdateOrganization from './createUpdateOrganization' import createUpdatePerson from './createUpdatePerson' import type { DestinationDefinition } from '@segment/actions-core' import type { Settings } from './generated-types' const destination: DestinationDefinition<Settings> = { name: 'Pipedrive', mode...
jbwyme/action-destinations
packages/destination-actions/src/destinations/pipedrive/createUpdateOrganization/generated-types.ts
<gh_stars>0 // Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * Identifier used to find existing organization in Pipedrive. Typically this is the name but it can also be a custom field value. Custom organization fields may be included by using the long hash keys of the custom fields. The...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/fullstory/event/generated-types.ts
<gh_stars>0 // Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * The name of the event to be tracked */ name: string /** * A propeties object containing a payload */ properties?: { [k: string]: unknown } }
jbwyme/action-destinations
packages/destination-subscriptions/src/__tests__/validate.test.ts
<filename>packages/destination-subscriptions/src/__tests__/validate.test.ts<gh_stars>0 import { validate as originalValidate } from '../index' // Helper to avoid caring about types in tests const validate = (ast: any, data: any): boolean => originalValidate(ast, data) test('should handle error in ast', () => { const...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/braze/__tests__/trackEvent.test.ts
<reponame>jbwyme/action-destinations import appboy from '@braze/web-sdk' import { Analytics, Context } from '@segment/analytics-next' import * as jsdom from 'jsdom' import brazeDestination from '../index' describe('trackEvent', () => { beforeEach(async () => { jest.restoreAllMocks() jest.resetAllMocks() ...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/braze/__tests__/updateUserProfile.test.ts
import appboy from '@braze/web-sdk' import { Analytics, Context } from '@segment/analytics-next' import * as jsdom from 'jsdom' import brazeDestination from '../index' describe('updateUserProfile', () => { let userMock: appboy.User const subscriptions = [ { partnerAction: 'updateUserProfile', name...
jbwyme/action-destinations
packages/destination-subscriptions/src/generate-fql.ts
import { Subscription, GroupCondition, EventTypeCondition, EventCondition, EventPropertyCondition, EventTraitCondition, EventContextCondition, Operator, ErrorCondition } from './types' const stringifyValue = ( value: string | boolean | number | undefined ): string => { if (typeof value === 'boolean' || type...
jbwyme/action-destinations
packages/core/src/segment-event.ts
<filename>packages/core/src/segment-event.ts<gh_stars>0 import { JSONValue } from './json-object' type ID = string | null | undefined type CompactMetricType = 'g' | 'c' interface CompactMetric { m: string // metric name v: number // value k: CompactMetricType t: string[] // tags e: number // timestamp in u...
jbwyme/action-destinations
packages/cli/src/commands/generate/action.ts
import { Command, flags } from '@oclif/command' import chalk from 'chalk' import fs from 'fs-extra' import globby from 'globby' import { camelCase, startCase } from 'lodash' import toTitleCase from 'to-title-case' import ora from 'ora' import path from 'path' import { autoPrompt } from '../../lib/prompt' import { rende...
jbwyme/action-destinations
packages/destination-subscriptions/src/parse-fql.ts
import { lex, Token, types as TokenType } from '@segment/fql-ts' import { Subscription, Condition, GroupConditionOperator, Operator, ConditionType } from './types' const tokenToConditionType: Record<string, ConditionType> = { type: 'event-type', event: 'event', properties: 'event-property', traits: 'event-tra...
jbwyme/action-destinations
packages/destination-subscriptions/src/validate.ts
import { get } from './get' import { Subscription, Condition, GroupCondition, Operator, ErrorCondition } from './types' const validateGroupCondition = ( condition: GroupCondition, // eslint-disable-next-line @typescript-eslint/no-explicit-any data: any ): boolean => { if (condition.operator === 'and') { ret...
jbwyme/action-destinations
packages/destination-actions/src/destinations/personas-messaging-twilio/sendSms/generated-types.ts
<filename>packages/destination-actions/src/destinations/personas-messaging-twilio/sendSms/generated-types.ts // Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * User ID in Segment */ userId: string /** * Number to send SMS to when testing */ toNumber?: string /** * Wh...
jbwyme/action-destinations
packages/destination-actions/src/destinations/braze/trackPurchase/index.ts
<filename>packages/destination-actions/src/destinations/braze/trackPurchase/index.ts import { omit, IntegrationError } from '@segment/actions-core' import type { ActionDefinition } from '@segment/actions-core' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' import day...
jbwyme/action-destinations
packages/destination-actions/src/destinations/google-analytics-4/generateLead/index.ts
import { ActionDefinition, IntegrationError } from '@segment/actions-core' import { CURRENCY_ISO_CODES } from '../constants' import type { Settings } from '../generated-types' import type { Payload } from './generated-types' const action: ActionDefinition<Settings, Payload> = { title: 'Generate Lead', description:...
jbwyme/action-destinations
packages/core/src/destination-kit/index.ts
<reponame>jbwyme/action-destinations<gh_stars>0 import { validate, parseFql, ErrorCondition } from '@segment/destination-subscriptions' import type { JSONSchema4 } from 'json-schema' import { Action, ActionDefinition, BaseActionDefinition, RequestFn } from './action' import { time, duration } from '../time' import { JS...
jbwyme/action-destinations
packages/browser-destinations/src/destinations/fullstory/index.ts
import * as FullStory from '@fullstory/browser' import type { BrowserDestinationDefinition } from '../../lib/browser-destinations' import { browserDestination } from '../../runtime/shim' import event from './event' import type { Settings } from './generated-types' import { initScript } from './init-script' import setUs...
jbwyme/action-destinations
packages/destination-actions/src/destinations/customerio/triggerCampaign/generated-types.ts
// Generated file. DO NOT MODIFY IT BY HAND. export interface Payload { /** * ID of the campaign to trigger. */ id: number /** * Custom Liquid merge data to include with the trigger. */ data?: { [k: string]: unknown } /** * Additional recipient conditions to filter recipients. If this is...
mathieueveillard/temp
src/index.spec.ts
namespace Ko { test("Can you make spareMoney idempotent?", function () { interface AbstractEvent<T extends string, P> { id: string; type: T; payload: P; } type MoneySparedEvent = AbstractEvent<"MONEY_SPARED_EVENT", number>; type MoneyWithdrawnEvent = AbstractEvent<"MONEY_WITHDRAWN_...
ChelesteWang/umi-next
packages/preset-umi/src/features/transform/transform.ts
<reponame>ChelesteWang/umi-next import * as Babel from '@umijs/bundler-utils/compiled/babel/core'; import * as t from '@umijs/bundler-utils/compiled/babel/types'; import { winPath } from '@umijs/utils'; import { join } from 'path'; import { IApi } from '../../types'; export default (api: IApi) => { api.addBeforeBabe...
ChelesteWang/umi-next
packages/preset-umi/src/features/configPlugins/schema.ts
import type { Root } from '@umijs/core/compiled/@hapi/joi'; import { NpmClientEnum } from '@umijs/utils'; export function getSchemas(): Record<string, (Joi: Root) => any> { return { plugins: (Joi) => Joi.array().items(Joi.string()), favicon: (Joi) => Joi.string(), headScripts: (Joi) => Joi.array().items(...
ChelesteWang/umi-next
packages/umi/index.d.ts
export * from '@umijs/renderer-react'; export type { IApi } from '../preset-umi'; export * from './dist/index';
snowlotus530/threejs_fiber_react
example/src/demos/ContextMenuOverride.tsx
import React, { useState } from 'react' import { Canvas } from '@react-three/fiber' export default function App() { const [state, set] = useState(false) return ( <Canvas orthographic camera={{ zoom: 150, fov: 75, position: [0, 0, 25] }}> <ambientLight /> <pointLight position={[10, 10, 10]} /> ...
snowlotus530/threejs_fiber_react
packages/fiber/src/web/index.tsx
<filename>packages/fiber/src/web/index.tsx import * as THREE from 'three' import * as React from 'react' import { RootTag } from 'react-reconciler' import { UseStore } from 'zustand' import { is } from '../core/is' import { createStore, StoreProps, isRenderer, context, RootState, Size } from '../core/store' import { c...
snowlotus530/threejs_fiber_react
packages/fiber/src/web/Canvas.tsx
<gh_stars>1-10 import * as React from 'react' import mergeRefs from 'react-merge-refs' import useMeasure, { Options as ResizeOptions } from 'react-use-measure' import { render, unmountComponentAtNode, RenderProps } from './index' import { createPointerEvents } from './events' import { UseStore } from 'zustand' import {...
snowlotus530/threejs_fiber_react
packages/fiber/src/web/events.ts
import { UseStore } from 'zustand' import { RootState } from '../core/store' import type { EventManager, Events } from '../core/events' import { createEvents } from '../core/events' export function createPointerEvents(store: UseStore<RootState>): EventManager<HTMLElement> { const { handlePointer } = createEvents(sto...
snowlotus530/threejs_fiber_react
packages/fiber/tests/web/web.core.test.tsx
jest.mock('scheduler', () => require('scheduler/unstable_mock')) import * as React from 'react' import { Color, Group, Camera, Scene, Mesh, BoxBufferGeometry, MeshBasicMaterial, MeshStandardMaterial, PCFSoftShadowMap, ACESFilmicToneMapping, sRGBEncoding, Object3D, } from 'three' import { create...